From 5339afdb4673becc7818e29df39fb54295b626c8 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Mon, 3 Mar 2008 12:47:05 +0100 Subject: [PATCH 001/352] Bug#34995 mysql-test-run doesn't allow client lib/binary selection --- mysql-test/mysql-test-run.pl | 47 +++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7c4677b8274..83024710ce6 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -110,6 +110,7 @@ our $glob_basedir; our $path_charsetsdir; our $path_client_bindir; +our $path_client_libdir; our $path_language; our $path_timefile; our $path_snapshot; @@ -623,6 +624,8 @@ sub command_line_setup () { 'vardir=s' => \$opt_vardir, 'benchdir=s' => \$glob_mysql_bench_dir, 'mem' => \$opt_mem, + 'client-bindir=s' => \$path_client_bindir, + 'client-libdir=s' => \$path_client_libdir, # Misc 'report-features' => \$opt_report_features, @@ -717,11 +720,19 @@ sub command_line_setup () { # # Look for the client binaries directory - $path_client_bindir= mtr_path_exists("$glob_basedir/client_release", - "$glob_basedir/client_debug", - vs_config_dirs('client', ''), - "$glob_basedir/client", - "$glob_basedir/bin"); + if ($path_client_bindir) + { + # --client-bindir=path set on command line, check that the path exists + $path_client_bindir= mtr_path_exists($path_client_bindir); + } + else + { + $path_client_bindir= mtr_path_exists("$glob_basedir/client_release", + "$glob_basedir/client_debug", + vs_config_dirs('client', ''), + "$glob_basedir/client", + "$glob_basedir/bin"); + } if (!$opt_extern) { @@ -1755,19 +1766,25 @@ sub environment_setup () { my @ld_library_paths; - # -------------------------------------------------------------------------- - # Setup LD_LIBRARY_PATH so the libraries from this distro/clone - # are used in favor of the system installed ones - # -------------------------------------------------------------------------- - if ( $source_dist ) + if ($path_client_libdir) { - push(@ld_library_paths, "$glob_basedir/libmysql/.libs/", - "$glob_basedir/libmysql_r/.libs/", - "$glob_basedir/zlib.libs/"); + # Use the --client-libdir passed on commandline + push(@ld_library_paths, "$path_client_libdir"); } else { - push(@ld_library_paths, "$glob_basedir/lib"); + # Setup LD_LIBRARY_PATH so the libraries from this distro/clone + # are used in favor of the system installed ones + if ( $source_dist ) + { + push(@ld_library_paths, "$glob_basedir/libmysql/.libs/", + "$glob_basedir/libmysql_r/.libs/", + "$glob_basedir/zlib.libs/"); + } + else + { + push(@ld_library_paths, "$glob_basedir/lib"); + } } # -------------------------------------------------------------------------- @@ -5235,6 +5252,8 @@ Misc options warnings | log-warnings Pass --log-warnings to mysqld sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time + client-bindir=PATH Path to the directory where client binaries are located + client-libdir=PATH Path to the directory where client libraries are located Deprecated options with-openssl Deprecated option for ssl From b1dafe5efec012a5c18f7e96b4e68aba8340bd2e Mon Sep 17 00:00:00 2001 From: "skozlov/ksm@mysql.com/virtop.(none)" <> Date: Fri, 4 Apr 2008 01:16:55 +0400 Subject: [PATCH 002/352] Bug#32653. Added --log-slave-updates because test requires it. The events based on LOAD DATA INFILE masked by --replace_regex instead restarting of slave. Added waiting start and stop of slave after START|STOP SLAVE statements. --- mysql-test/r/rpl_log.result | 15 +++++++-------- mysql-test/t/disabled.def | 1 - mysql-test/t/rpl_log-slave.opt | 2 +- mysql-test/t/rpl_log.test | 19 ++++++++----------- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/mysql-test/r/rpl_log.result b/mysql-test/r/rpl_log.result index 6ee0eb283b5..ae3fe107038 100644 --- a/mysql-test/r/rpl_log.result +++ b/mysql-test/r/rpl_log.result @@ -7,7 +7,7 @@ start slave; stop slave; reset master; reset slave; -reset master; +start slave; create table t1(n int not null auto_increment primary key); insert into t1 values (NULL); drop table t1; @@ -25,8 +25,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1 master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) master-bin.000001 338 Query 1 414 use `test`; drop table t1 master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) -master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 -master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=# +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=# master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 show binlog events from 98 limit 1; Log_name Pos Event_type Server_id End_log_pos Info @@ -41,7 +41,6 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) flush logs; create table t5 (a int); drop table t5; -start slave; flush logs; stop slave; create table t1 (n int); @@ -55,8 +54,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1 master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) master-bin.000001 338 Query 1 414 use `test`; drop table t1 master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) -master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 -master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=# +master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=# master-bin.000001 1269 Query 1 1345 use `test`; drop table t1 master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; @@ -84,8 +83,8 @@ slave-bin.000001 219 Intvar 1 247 INSERT_ID=1 slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL) slave-bin.000001 338 Query 1 414 use `test`; drop table t1 slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null) -slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581 -slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1 +slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=# +slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE 'words.dat' INTO table t1 ignore 1 lines ;file_id=# slave-bin.000001 1271 Query 1 1347 use `test`; drop table t1 slave-bin.000001 1347 Query 1 1433 use `test`; create table t5 (a int) slave-bin.000001 1433 Query 1 1509 use `test`; drop table t5 diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 297b6e70f39..591e9d71721 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -17,7 +17,6 @@ im_options_set : Bug#20294: Instance manager tests fail randomly im_options_unset : Bug#20294: Instance manager tests fail randomly im_utils : Bug#20294: Instance manager tests fail randomly grant_cache : Bug#32651: grant_cache.test fails -rpl_log : Bug#32653: rpl_log.test fails randomly rpl_view : Bug#32654: rpl_view.test fails randomly ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes diff --git a/mysql-test/t/rpl_log-slave.opt b/mysql-test/t/rpl_log-slave.opt index 8b137891791..203fc2287ec 100644 --- a/mysql-test/t/rpl_log-slave.opt +++ b/mysql-test/t/rpl_log-slave.opt @@ -1 +1 @@ - +--log-slave-updates diff --git a/mysql-test/t/rpl_log.test b/mysql-test/t/rpl_log.test index 578a39efd6e..52c4a3e0606 100644 --- a/mysql-test/t/rpl_log.test +++ b/mysql-test/t/rpl_log.test @@ -13,22 +13,15 @@ save_master_pos; connection slave; sync_with_master; stop slave; +--source include/wait_for_slave_to_stop.inc reset master; reset slave; -# We are going to read the slave's binlog which contains file_id (for some LOAD -# DATA INFILE); to make it repeatable (not influenced by other tests), we need -# to stop and start the slave, to be sure file_id will start from 1. -# This can be done with 'server_stop slave', but -# this would require the manager, so most of the time the test will be skipped -# :( -# To workaround this, I (Guilhem) add a (empty) rpl_log-slave.opt (because when -# mysql-test-run finds such a file it restarts the slave before doing the -# test). That's not very elegant but I could find no better way, sorry. +start slave; +--source include/wait_for_slave_to_start.inc let $VERSION=`select version()`; connection master; -reset master; create table t1(n int not null auto_increment primary key); insert into t1 values (NULL); drop table t1; @@ -37,6 +30,7 @@ load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines; select count(*) from t1; drop table t1; --replace_result $VERSION VERSION +--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/ show binlog events; show binlog events from 98 limit 1; show binlog events from 98 limit 2; @@ -69,10 +63,10 @@ connection slave; # Note that the above 'slave start' will cause a 3rd rotate event (a fake one) # to go into the relay log (the master always sends a fake one when replication # starts). -start slave; sync_with_master; flush logs; stop slave; +--source include/wait_for_slave_to_stop.inc connection master; # Create some entries for second log @@ -81,6 +75,7 @@ create table t1 (n int); insert into t1 values (1); drop table t1; --replace_result $VERSION VERSION +--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /infile '.+'/infile 'words.dat'/ show binlog events; --replace_result $VERSION VERSION show binlog events in 'master-bin.000002'; @@ -88,9 +83,11 @@ show binary logs; save_master_pos; connection slave; start slave; +--source include/wait_for_slave_to_start.inc sync_with_master; show binary logs; --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION +--replace_regex /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /INFILE '.+'/INFILE 'words.dat'/ show binlog events in 'slave-bin.000001' from 4; --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION show binlog events in 'slave-bin.000002' from 4; From a8b2853fa38cac33d574b281516788430b3d5929 Mon Sep 17 00:00:00 2001 From: "skozlov/ksm@mysql.com/virtop.(none)" <> Date: Sun, 6 Apr 2008 22:24:29 +0400 Subject: [PATCH 003/352] Bug#32654. The reason of bug is incorrect clean up during restarting of mysqld under Windows platform (seems some files were in-use). Mtr restarts servers because an option file exist for slave. The option file for slave forces to skip test.foo table for replication. But really test case does not invlved test.foo table at all. So option file can be removed and mtr will not restart servers for test case. --- mysql-test/t/disabled.def | 1 - mysql-test/t/rpl_view-slave.opt | 1 - 2 files changed, 2 deletions(-) delete mode 100644 mysql-test/t/rpl_view-slave.opt diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 297b6e70f39..2285f966a6d 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -18,7 +18,6 @@ im_options_unset : Bug#20294: Instance manager tests fail randomly im_utils : Bug#20294: Instance manager tests fail randomly grant_cache : Bug#32651: grant_cache.test fails rpl_log : Bug#32653: rpl_log.test fails randomly -rpl_view : Bug#32654: rpl_view.test fails randomly ndb_backup_print : Bug#32357: ndb_backup_print test fails sometimes in pushbuild rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes kill : Bug#29149 Test "kill" fails on Windows diff --git a/mysql-test/t/rpl_view-slave.opt b/mysql-test/t/rpl_view-slave.opt deleted file mode 100644 index 79b3bf6174b..00000000000 --- a/mysql-test/t/rpl_view-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---replicate-ignore-table=test.foo From 2c024c86e40cec10ad6ab192fca57a3ae7670324 Mon Sep 17 00:00:00 2001 From: "iggy@slim." <> Date: Mon, 7 Apr 2008 01:32:59 -0400 Subject: [PATCH 004/352] Changes for Visual Studio 9 --- CMakeLists.txt | 14 ++++++-------- zlib/zutil.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37956204faa..d4697efef93 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,18 +82,18 @@ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805") -IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") +# Disable warnings in Visual Studio 8 and above +IF(MSVC AND MSVC_VERSION GREATER 1399) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996") -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8") - -IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR - CMAKE_GENERATOR MATCHES "Visual Studio 8") +ENDIF(MSVC AND MSVC_VERSION GREATER 1399) +# Settings for Visual Studio 7 and above. +IF(MSVC AND MSVC_VERSION GREATER 1299) # replace /MDd with /MTd STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) @@ -123,9 +123,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR IF(NOT tmp_manifest) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") ENDIF(NOT tmp_manifest) - -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR - CMAKE_GENERATOR MATCHES "Visual Studio 8") +ENDIF(MSVC AND MSVC_VERSION GREATER 1299) ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") diff --git a/zlib/zutil.h b/zlib/zutil.h index b7d5eff81b6..4482957d6ac 100644 --- a/zlib/zutil.h +++ b/zlib/zutil.h @@ -194,7 +194,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # ifdef __TURBOC__ # define NO_vsnprintf # endif -# ifdef WIN32 +# if defined(WIN32) && (!defined(_MSC_VER) || _MSC_VER < 1500) /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ # if !defined(vsnprintf) && !defined(NO_vsnprintf) # define vsnprintf _vsnprintf From 454e94ea27a1c0d67a90759cdd21f7693de03809 Mon Sep 17 00:00:00 2001 From: "iggy@amd64.(none)" <> Date: Mon, 7 Apr 2008 18:40:37 -0400 Subject: [PATCH 005/352] Work around for older version of cmake. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4697efef93..ae069498da1 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,17 +83,17 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805") # Disable warnings in Visual Studio 8 and above -IF(MSVC AND MSVC_VERSION GREATER 1399) +IF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996") SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996") -ENDIF(MSVC AND MSVC_VERSION GREATER 1399) +ENDIF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7") # Settings for Visual Studio 7 and above. -IF(MSVC AND MSVC_VERSION GREATER 1299) +IF(MSVC) # replace /MDd with /MTd STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}) STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}) @@ -123,7 +123,7 @@ IF(MSVC AND MSVC_VERSION GREATER 1299) IF(NOT tmp_manifest) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") ENDIF(NOT tmp_manifest) -ENDIF(MSVC AND MSVC_VERSION GREATER 1299) +ENDIF(MSVC) ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") From 914e85b3f836f8e24217288c71e687a14a679526 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 9 May 2008 15:17:10 +0200 Subject: [PATCH 006/352] BUG#35543 mysqlbinlog.cc does not properly work with tmp files - Backport to 5.0, use --local-load to instruct myqlbinlog where to put the files it generate --- mysql-test/mysql-test-run.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 95fae4c1491..7b9206f0dfd 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2045,6 +2045,9 @@ sub environment_setup () { { $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir"; } + # Always use the given tmpdir for the LOAD files created + # by mysqlbinlog + $cmdline_mysqlbinlog .=" --local-load=$opt_tmpdir"; if ( $opt_debug ) { From bd4c6d9b8ccf5f8a3f8f743dde1c882506e08c7c Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 30 May 2008 13:21:45 +0300 Subject: [PATCH 007/352] Bug#37069: Make federated disabled by default The federated storage engine is now disabled by default. mysql-test-run.pl is updated to enable it whenever it's required and available. --- mysql-test/lib/mtr_cases.pl | 9 +++++++++ sql/sql_plugin.cc | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 2ca2669eb7f..4b0fad0f818 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -773,6 +773,13 @@ sub collect_one_test_case($$$$$$$$$) { if ( $::used_default_engine =~ /^innodb/i ); } + #enable federated for this test + if ($tinfo->{'federated_test'}) + { + push(@{$tinfo->{'master_opt'}}, "--loose-federated"); + push(@{$tinfo->{'slave_opt'}}, "--loose-federated"); + } + if ( $tinfo->{'big_test'} and ! $::opt_big_test ) { $tinfo->{'skip'}= 1; @@ -891,6 +898,8 @@ our @tags= ["include/have_ndb_extra.inc", "ndb_extra", 1], ["include/ndb_master-slave.inc", "ndb_test", 1], ["require_manager", "require_manager", 1], + ["include/federated.inc", "federated_test", 1], + ["include/have_federated_db.inc", "federated_test", 1], ); sub mtr_options_from_test_file($$) { diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 811b82ebe05..0fe79a8945d 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1137,9 +1137,10 @@ int plugin_init(int *argc, char **argv, int flags) { for (plugin= *builtins; plugin->info; plugin++) { - /* by default, only ndbcluster is disabled */ + /* by default, ndbcluster and federated are disabled */ def_enabled= - my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0; + my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0 && + my_strcasecmp(&my_charset_latin1, plugin->name, "FEDERATED") != 0; bzero(&tmp, sizeof(tmp)); tmp.plugin= plugin; tmp.name.str= (char *)plugin->name; From 9bc98e8df2a96e1324092cf65e8c6300c9a9ad1e Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Tue, 3 Jun 2008 13:12:37 +0300 Subject: [PATCH 008/352] Bug#37069 (5.0): implement --skip-federated --- mysql-test/r/federated_disabled.result | 0 mysql-test/t/federated_disabled-master.opt | 1 + mysql-test/t/federated_disabled.test | 3 +++ sql/mysqld.cc | 16 ++++++++++++++-- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 mysql-test/r/federated_disabled.result create mode 100644 mysql-test/t/federated_disabled-master.opt create mode 100644 mysql-test/t/federated_disabled.test diff --git a/mysql-test/r/federated_disabled.result b/mysql-test/r/federated_disabled.result new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/t/federated_disabled-master.opt b/mysql-test/t/federated_disabled-master.opt new file mode 100644 index 00000000000..4f2df1dd301 --- /dev/null +++ b/mysql-test/t/federated_disabled-master.opt @@ -0,0 +1 @@ +--skip-federated diff --git a/mysql-test/t/federated_disabled.test b/mysql-test/t/federated_disabled.test new file mode 100644 index 00000000000..99fcad76828 --- /dev/null +++ b/mysql-test/t/federated_disabled.test @@ -0,0 +1,3 @@ +source include/federated.inc; + +SHOW VARIABLES LIKE 'have_federated_engine'; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c239530f2fc..cdae94f0a61 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -328,7 +328,7 @@ static bool lower_case_table_names_used= 0; static bool volatile select_thread_in_use, signal_thread_in_use; static bool volatile ready_to_exit; static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; -static my_bool opt_bdb, opt_isam, opt_ndbcluster, opt_merge; +static my_bool opt_bdb, opt_isam, opt_ndbcluster, opt_merge, opt_federated; static my_bool opt_short_log_format= 0; static uint kill_cached_threads, wake_thread; static ulong killed_threads, thread_created; @@ -4989,7 +4989,8 @@ enum options_mysqld OPT_INNODB_ROLLBACK_ON_TIMEOUT, OPT_SECURE_FILE_PRIV, OPT_KEEP_FILES_ON_CREATE, - OPT_INNODB_ADAPTIVE_HASH_INDEX + OPT_INNODB_ADAPTIVE_HASH_INDEX, + OPT_FEDERATED }; @@ -5175,6 +5176,9 @@ Disable with --skip-external-locking.", 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"flush", OPT_FLUSH, "Flush tables to disk between SQL commands.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"federated", OPT_FEDERATED, "Enable Federated storage engine. Disable with \ +--skip-federated.", + (gptr*) &opt_federated, (gptr*) &opt_federated, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, /* We must always support the next option to make scripts like mysqltest easier to do */ {"gdb", OPT_DEBUGGING, @@ -7322,6 +7326,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else have_merge_db= SHOW_OPTION_DISABLED; break; +#ifdef HAVE_FEDERATED_DB + case OPT_FEDERATED: + if (opt_federated) + have_federated_db= SHOW_OPTION_YES; + else + have_federated_db= SHOW_OPTION_DISABLED; + break; +#endif #ifdef HAVE_BERKELEY_DB case OPT_BDB_NOSYNC: /* Deprecated option */ From 5e9ce4799283e80c49b821a777afaadf72615297 Mon Sep 17 00:00:00 2001 From: mysqldev Date: Tue, 10 Jun 2008 14:25:21 +0200 Subject: [PATCH 009/352] Raise version number after cloning 5.0.64 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index db14982840d..247a17da940 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.64) +AM_INIT_AUTOMAKE(mysql, 5.0.66) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=64 +NDB_VERSION_BUILD=66 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 2244456ddf632aef6a8452d8063ab1480da3e321 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 10 Jun 2008 21:10:56 +0200 Subject: [PATCH 010/352] Use skip-federated by default in all example configs. --- support-files/my-huge.cnf.sh | 3 +++ support-files/my-innodb-heavy-4G.cnf.sh | 3 +++ support-files/my-large.cnf.sh | 3 +++ support-files/my-medium.cnf.sh | 3 +++ support-files/my-small.cnf.sh | 3 +++ 5 files changed, 15 insertions(+) diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index 5dc3e5a1900..e4747ac4564 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -46,6 +46,9 @@ thread_concurrency = 8 # #skip-networking +# Disable Federated by default +skip-federated + # Replication Master Server (default) # binary logging is required for replication log-bin=mysql-bin diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 77c6cea56d5..cda11d661bc 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -357,6 +357,9 @@ myisam_repair_threads = 1 myisam_recover +# Disable Federated by default +skip-federated + # *** BDB Specific options *** # Use this option if you run a MySQL server with BDB support enabled but diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh index 4dc3f929c48..981b13731e4 100644 --- a/support-files/my-large.cnf.sh +++ b/support-files/my-large.cnf.sh @@ -46,6 +46,9 @@ thread_concurrency = 8 # #skip-networking +# Disable Federated by default +skip-federated + # Replication Master Server (default) # binary logging is required for replication log-bin=mysql-bin diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh index 99b6e823f39..c3135ea2c2b 100644 --- a/support-files/my-medium.cnf.sh +++ b/support-files/my-medium.cnf.sh @@ -44,6 +44,9 @@ myisam_sort_buffer_size = 8M # #skip-networking +# Disable Federated by default +skip-federated + # Replication Master Server (default) # binary logging is required for replication log-bin=mysql-bin diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh index 288df893b4c..cf2ebed463c 100644 --- a/support-files/my-small.cnf.sh +++ b/support-files/my-small.cnf.sh @@ -48,6 +48,9 @@ server-id = 1 # Uncomment the following if you want to log updates #log-bin=mysql-bin +# Disable Federated by default +skip-federated + # Uncomment the following if you are NOT using BDB tables #skip-bdb From 11ad668b05a746b5155e5503f34b300e70ecf9b0 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 12 Jun 2008 13:56:13 +0200 Subject: [PATCH 011/352] Created the 5.1 Storage Engine API tree Changed the tree default configuration --- .bzr-mysql/default.conf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index f044f8e62da..9386d8a5ac7 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,7 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.1" +tree_name = "mysql-5.1-sea" +tree_location = bzr+ssh://bk-internal.mysql.com/bzrroot/mysql-5.1-sea +post_commit_url = bzr+ssh://bk-internal.mysql.com/bzrroot/mysql-5.1-sea +project_name = "MySQL Storage Engine API team tree" From 013d746de8e7bac655ce7f6d68742d2392f60116 Mon Sep 17 00:00:00 2001 From: "joerg@trift-lap.fambruehe" <> Date: Fri, 13 Jun 2008 14:47:24 +0200 Subject: [PATCH 012/352] No change - hack to force BZR conversion From 46d4fc23a9eb1911fefe8938d0dfa8db932f42fe Mon Sep 17 00:00:00 2001 From: Hakan Kuecuekyilmaz Date: Mon, 16 Jun 2008 10:04:00 +0200 Subject: [PATCH 013/352] Fix for Bug#16902. --- mysys/errors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/errors.c b/mysys/errors.c index 889cf6d7fe3..537a75c6ef3 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -75,7 +75,7 @@ void init_glob_errs() EE(EE_STAT) = "Can't get stat of '%s' (Errcode: %d)"; EE(EE_CANT_CHSIZE) = "Can't change size of file (Errcode: %d)"; EE(EE_CANT_OPEN_STREAM)= "Can't open stream from handle (Errcode: %d)"; - EE(EE_GETWD) = "Can't get working dirctory (Errcode: %d)"; + EE(EE_GETWD) = "Can't get working directory (Errcode: %d)"; EE(EE_SETWD) = "Can't change dir to '%s' (Errcode: %d)"; EE(EE_LINK_WARNING) = "Warning: '%s' had %d links"; EE(EE_OPEN_WARNING) = "Warning: %d files and %d streams is left open\n"; From d6700c7e5ac95b809f3eaac7b33178864db11c97 Mon Sep 17 00:00:00 2001 From: Hakan Kuecuekyilmaz Date: Mon, 16 Jun 2008 10:05:00 +0200 Subject: [PATCH 014/352] Fix for Bug#16902. --- mysys/errors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/errors.c b/mysys/errors.c index 857de1325d4..1c13255a616 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -74,7 +74,7 @@ void init_glob_errs() EE(EE_STAT) = "Can't get stat of '%s' (Errcode: %d)"; EE(EE_CANT_CHSIZE) = "Can't change size of file (Errcode: %d)"; EE(EE_CANT_OPEN_STREAM)= "Can't open stream from handle (Errcode: %d)"; - EE(EE_GETWD) = "Can't get working dirctory (Errcode: %d)"; + EE(EE_GETWD) = "Can't get working directory (Errcode: %d)"; EE(EE_SETWD) = "Can't change dir to '%s' (Errcode: %d)"; EE(EE_LINK_WARNING) = "Warning: '%s' had %d links"; EE(EE_OPEN_WARNING) = "%d files and %d streams is left open\n"; From 00c19cd837f06bae84b7dfc6aac8b775ce0eb4ef Mon Sep 17 00:00:00 2001 From: "Matthias Leich mleich@mysql.com" <> Date: Mon, 16 Jun 2008 20:39:58 +0200 Subject: [PATCH 015/352] Fix for Bug#37167 funcs_1: Many tests fail if the embedded server is used. Bug#37164 funcs_1: Some tests fail if an optional character set is missing. + some cleanup within the testsuite related to the fixes above + some adjustments to open bugs on Mac OS X Details: - Remove the initial loading of data from tests if these data are not somewhere retrieved - Remove any use of columns with attribute unicode (-> UCS2 is no more needed) from tests where unicode properties are not checked or somehow required - Create a separate branch of the Character maximum length test (CML). If UCS2 is available than this test gets applied to every available type of string column with attribute unicode This prevents any loss of coverage by the points above. - Disable the execution of is_tables_ndb which gives wrong results because of a bug. Correct the exepected results of this test. - In case of tests failing when applied to the embedded server 1) Create a variant of this test for the embedded server or 2) Skip the test in case of embedded server depending on purpose and complexity of test. - Skip the tests which could suffer from Bug 28309 First insert violates unique constraint - was "memory" table empty ? Bug 37380 Test funcs_1.is_columns_myisam_embedded fails on OS X (both bugs Mac OS X, embedded server, MySQL 5.0 only) - Minor improvements like remove typos --- mysql-test/suite/funcs_1/datadict/columns.inc | 1 - .../funcs_1/datadict/is_key_column_usage.inc | 344 +++++ .../suite/funcs_1/datadict/is_routines.inc | 472 +++++++ .../suite/funcs_1/datadict/is_schemata.inc | 247 ++++ .../suite/funcs_1/datadict/is_tables.inc | 475 +++++++ .../suite/funcs_1/datadict/is_triggers.inc | 254 ++++ .../suite/funcs_1/datadict/is_views.inc | 306 +++++ mysql-test/suite/funcs_1/datadict/tables.inc | 55 + mysql-test/suite/funcs_1/datadict/tables1.inc | 15 +- mysql-test/suite/funcs_1/datadict/tables2.inc | 3 +- .../suite/funcs_1/include/bug28309_skip.inc | 13 + .../suite/funcs_1/include/innodb_tb1.inc | 2 +- .../suite/funcs_1/include/innodb_tb3.inc | 2 +- .../suite/funcs_1/include/innodb_tb4.inc | 6 +- .../suite/funcs_1/include/memory_tb4.inc | 6 +- .../suite/funcs_1/include/myisam_tb1.inc | 2 +- .../suite/funcs_1/include/myisam_tb3.inc | 2 +- .../suite/funcs_1/include/myisam_tb4.inc | 6 +- .../suite/funcs_1/r/innodb_trig_frkey.result | 152 +-- .../suite/funcs_1/r/is_cml_innodb.result | 97 ++ .../suite/funcs_1/r/is_cml_memory.result | 82 ++ .../suite/funcs_1/r/is_cml_myisam.result | 98 ++ mysql-test/suite/funcs_1/r/is_cml_ndb.result | 97 ++ .../suite/funcs_1/r/is_columns_innodb.result | 36 +- .../funcs_1/r/is_columns_is_embedded.result | 380 ++++++ .../suite/funcs_1/r/is_columns_memory.result | 21 +- .../suite/funcs_1/r/is_columns_myisam.result | 35 +- .../r/is_columns_myisam_embedded.result | 1214 +++++++++++++++++ .../r/is_columns_mysql_embedded.result | 361 +++++ .../r/is_key_column_usage_embedded.result | 372 +++++ .../funcs_1/r/is_routines_embedded.result | 620 +++++++++ .../funcs_1/r/is_schemata_embedded.result | 187 +++ .../r/is_statistics_mysql_embedded.result | 103 ++ ...is_table_constraints_mysql_embedded.result | 57 + .../suite/funcs_1/r/is_tables_embedded.result | 427 ++++++ .../suite/funcs_1/r/is_tables_innodb.result | 1032 +------------- .../suite/funcs_1/r/is_tables_is.result | 8 +- .../suite/funcs_1/r/is_tables_memory.result | 1020 +------------- .../suite/funcs_1/r/is_tables_myisam.result | 990 +------------- .../r/is_tables_myisam_embedded.result | 192 +++ .../suite/funcs_1/r/is_tables_mysql.result | 8 +- .../funcs_1/r/is_tables_mysql_embedded.result | 815 +++++++++++ .../suite/funcs_1/r/is_tables_ndb.result | 460 +------ .../funcs_1/r/is_triggers_embedded.result | 208 +++ .../suite/funcs_1/r/is_views_embedded.result | 241 ++++ .../funcs_1/storedproc/storedproc_06.inc | 6 +- .../funcs_1/storedproc/storedproc_10.inc | 6 +- mysql-test/suite/funcs_1/t/disabled.def | 1 + .../suite/funcs_1/t/innodb_trig_frkey.test | 6 - .../suite/funcs_1/t/is_basics_mixed.test | 13 + mysql-test/suite/funcs_1/t/is_cml_innodb.test | 41 + mysql-test/suite/funcs_1/t/is_cml_memory.test | 37 + mysql-test/suite/funcs_1/t/is_cml_myisam.test | 41 + mysql-test/suite/funcs_1/t/is_cml_ndb.test | 41 + .../suite/funcs_1/t/is_column_privileges.test | 4 +- .../t/is_column_privileges_is_mysql_test.test | 5 +- mysql-test/suite/funcs_1/t/is_columns.test | 4 +- .../suite/funcs_1/t/is_columns_innodb.test | 4 + mysql-test/suite/funcs_1/t/is_columns_is.test | 7 +- .../funcs_1/t/is_columns_is_embedded.test | 23 + .../suite/funcs_1/t/is_columns_memory.test | 4 + .../suite/funcs_1/t/is_columns_myisam.test | 5 +- .../funcs_1/t/is_columns_myisam_embedded.test | 30 + .../suite/funcs_1/t/is_columns_mysql.test | 5 + .../funcs_1/t/is_columns_mysql_embedded.test | 19 + .../suite/funcs_1/t/is_columns_ndb.test | 4 + .../suite/funcs_1/t/is_key_column_usage.test | 339 +---- .../t/is_key_column_usage_embedded.test | 20 + mysql-test/suite/funcs_1/t/is_routines.test | 466 +------ .../suite/funcs_1/t/is_routines_embedded.test | 20 + .../suite/funcs_1/t/is_schema_privileges.test | 4 +- .../t/is_schema_privileges_is_mysql_test.test | 5 +- mysql-test/suite/funcs_1/t/is_schemata.test | 241 +--- .../suite/funcs_1/t/is_schemata_embedded.test | 20 + .../funcs_1/t/is_schemata_is_mysql_test.test | 5 +- mysql-test/suite/funcs_1/t/is_statistics.test | 4 +- .../suite/funcs_1/t/is_statistics_mysql.test | 5 +- .../t/is_statistics_mysql_embedded.test | 19 + .../suite/funcs_1/t/is_table_constraints.test | 4 +- .../funcs_1/t/is_table_constraints_mysql.test | 5 +- .../is_table_constraints_mysql_embedded.test | 18 + .../suite/funcs_1/t/is_table_privileges.test | 4 +- mysql-test/suite/funcs_1/t/is_tables.test | 469 +------ .../suite/funcs_1/t/is_tables_embedded.test | 20 + .../suite/funcs_1/t/is_tables_innodb.test | 12 +- .../suite/funcs_1/t/is_tables_memory.test | 12 +- .../suite/funcs_1/t/is_tables_myisam.test | 13 +- .../funcs_1/t/is_tables_myisam_embedded.test | 22 + .../suite/funcs_1/t/is_tables_mysql.test | 5 +- .../funcs_1/t/is_tables_mysql_embedded.test | 18 + mysql-test/suite/funcs_1/t/is_tables_ndb.test | 24 +- mysql-test/suite/funcs_1/t/is_triggers.test | 248 +--- .../suite/funcs_1/t/is_triggers_embedded.test | 20 + .../suite/funcs_1/t/is_user_privileges.test | 4 +- mysql-test/suite/funcs_1/t/is_views.test | 300 +--- .../suite/funcs_1/t/is_views_embedded.test | 20 + .../suite/funcs_1/t/memory_trig_0102.test | 1 + .../suite/funcs_1/t/memory_trig_0407.test | 1 + .../suite/funcs_1/t/memory_trig_1011ext.test | 1 + mysql-test/suite/funcs_1/t/memory_views.test | 1 + .../suite/funcs_1/triggers/trig_frkey.inc | 127 +- .../suite/funcs_1/triggers/triggers_03.inc | 4 + mysql-test/suite/funcs_1/views/func_view.inc | 21 +- .../suite/funcs_1/views/views_master.inc | 2 +- 104 files changed, 8697 insertions(+), 5657 deletions(-) create mode 100644 mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc create mode 100644 mysql-test/suite/funcs_1/datadict/is_routines.inc create mode 100644 mysql-test/suite/funcs_1/datadict/is_schemata.inc create mode 100644 mysql-test/suite/funcs_1/datadict/is_tables.inc create mode 100644 mysql-test/suite/funcs_1/datadict/is_triggers.inc create mode 100644 mysql-test/suite/funcs_1/datadict/is_views.inc create mode 100644 mysql-test/suite/funcs_1/datadict/tables.inc create mode 100644 mysql-test/suite/funcs_1/include/bug28309_skip.inc create mode 100644 mysql-test/suite/funcs_1/r/is_cml_innodb.result create mode 100644 mysql-test/suite/funcs_1/r/is_cml_memory.result create mode 100644 mysql-test/suite/funcs_1/r/is_cml_myisam.result create mode 100644 mysql-test/suite/funcs_1/r/is_cml_ndb.result create mode 100644 mysql-test/suite/funcs_1/r/is_columns_is_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_routines_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_schemata_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_tables_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_triggers_embedded.result create mode 100644 mysql-test/suite/funcs_1/r/is_views_embedded.result create mode 100644 mysql-test/suite/funcs_1/t/is_cml_innodb.test create mode 100644 mysql-test/suite/funcs_1/t/is_cml_memory.test create mode 100644 mysql-test/suite/funcs_1/t/is_cml_myisam.test create mode 100644 mysql-test/suite/funcs_1/t/is_cml_ndb.test create mode 100644 mysql-test/suite/funcs_1/t/is_columns_is_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_columns_mysql_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_key_column_usage_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_routines_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_schemata_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_statistics_mysql_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_table_constraints_mysql_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_tables_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_tables_myisam_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_tables_mysql_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_triggers_embedded.test create mode 100644 mysql-test/suite/funcs_1/t/is_views_embedded.test diff --git a/mysql-test/suite/funcs_1/datadict/columns.inc b/mysql-test/suite/funcs_1/datadict/columns.inc index 86f8afeff73..64318492b00 100644 --- a/mysql-test/suite/funcs_1/datadict/columns.inc +++ b/mysql-test/suite/funcs_1/datadict/columns.inc @@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, FROM information_schema.columns $my_where ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; - diff --git a/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc new file mode 100644 index 00000000000..46d828b2e72 --- /dev/null +++ b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc @@ -0,0 +1,344 @@ +# suite/funcs_1/datadict/is_key_column_usage.inc +# +# Check the layout of information_schema.key_column_usage and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA/COLUMN ... on it. +# +# Note: +# This test is not intended +# - to show information about the all time existing tables +# within the databases information_schema and mysql +# - for checking storage engine properties +# Therefore please do not alter $engine_type. +# +# Author: +# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of +# testsuite funcs_1 +# Create this script based on older scripts and new code. +# Last Change: +# 2008-06-11 mleich Move t/is_key_column_usage.test to this file and +# create variants for embedded/non embedded server. +# + +let $engine_type = MEMORY; + +let $is_table = KEY_COLUMN_USAGE; + +# The table INFORMATION_SCHEMA.KEY_COLUMN_USAGE must exist +eval SHOW TABLES FROM information_schema LIKE '$is_table'; + +--echo ####################################################################### +--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +--echo ####################################################################### +# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT +# statement, just as if it were an ordinary user-defined table. +# +--source suite/funcs_1/datadict/is_table_query.inc + + +--echo ######################################################################### +--echo # Testcase 3.2.7.1: INFORMATION_SCHEMA.KEY_COLUMN_USAGE layout +--echo ######################################################################### +# Ensure that the INFORMATION_SCHEMA.KEY_COLUMN_USAGE table has the following +# columns, in the following order: +# +# CONSTRAINT_CATALOG (always shows NULL), +# CONSTRAINT_SCHEMA (shows the database, or schema, in which an accessible +# constraint, or index, resides), +# CONSTRAINT_NAME (shows the name of the accessible constraint), +# TABLE_CATALOG (always shows NULL), +# TABLE_SCHEMA (shows the database, or schema, in which the table constrained +# by that constraint resides), +# TABLE_NAME (shows the name of the table constrained by the constraint), +# COLUMN_NAME (shows the name of a column that is the index key, or part of +# the index key), +# ORDINAL_POSITION (shows the ordinal position of the column within the +# constraint index), +# POSITION_IN_UNIQUE_CONSTRAINT (shows, for a foreign key column, the ordinal +# position of the referenced column within the referenced unique index; +# otherwise NULL). +# added with 5.0.6: +# REFERENCED_TABLE_SCHEMA, +# REFERENCED_TABLE_NAME, +# REFERENCED_COLUMN_NAME +# +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval DESCRIBE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW CREATE TABLE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW COLUMNS FROM information_schema.$is_table; + +# Note: Retrieval of information within information_schema.columns about +# information_schema.key_column_usage is in is_columns_is.test. + +# Show that CONSTRAINT_CATALOG and TABLE_CATALOG are always NULL. +SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog, + table_schema, table_name, column_name +FROM information_schema.key_column_usage +WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL; + + +--echo ######################################################################################## +--echo # Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information +--echo ######################################################################################## +# 3.2.7.2: Ensure that the table shows the relevant information on every column, defined to +# be part of an index key, which is accessible to the current user or to PUBLIC. +# 3.2.7.3: Ensure that the table does not show any information on any indexed column that is +# not accessible to the current user or PUBLIC. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; + +--error 0,ER_CANNOT_USER +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; + +USE db_datadict; + +--replace_result $engine_type +eval +CREATE TABLE t1_1 + (f1 INT NOT NULL, PRIMARY KEY(f1), + f2 INT, INDEX f2_ind(f2)) +ENGINE = $engine_type; +GRANT SELECT ON t1_1 to 'testuser1'@'localhost'; + +--replace_result $engine_type +eval +CREATE TABLE t1_2 + (f1 INT NOT NULL, PRIMARY KEY(f1), + f2 INT, INDEX f2_ind(f2)) +ENGINE = $engine_type; +GRANT SELECT ON t1_2 to 'testuser2'@'localhost'; +#FIXME: add foreign keys + +let $select= SELECT * FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_%' +ORDER BY constraint_catalog, constraint_schema, constraint_name, + table_catalog, table_schema, table_name, ordinal_position; + +# show view of user root +eval $select; + +--echo # Establish connection testuser1 (user=testuser1) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser1, localhost, testuser1, , db_datadict); +eval $select; + +--echo # Establish connection testuser2 (user=testuser2) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser2, localhost, testuser2, , db_datadict); +eval $select; + +# Cleanup +--echo # Switch to connection default and close connections testuser1, testuser2 +connection default; +disconnect testuser1; +disconnect testuser2; +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP TABLE t1_1; +DROP TABLE t1_2; +DROP DATABASE IF EXISTS db_datadict; + + +--echo ######################################################################################## +--echo # Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.KEY_COLUMN_USAGE modifications +--echo ######################################################################################## +# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or +# column) automatically inserts all relevant information on that +# object into every appropriate INFORMATION_SCHEMA table. +# 3.2.1.14: Ensure that the alteration of any existing database object +# automatically updates all relevant information on that object in +# every appropriate INFORMATION_SCHEMA table. +# 3.2.1.15: Ensure that the dropping of any existing database object +# automatically deletes all relevant information on that object from +# every appropriate INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +DROP TABLE IF EXISTS test.t1_my_table; +--enable_warnings +CREATE DATABASE db_datadict; + +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_my_table%'; +--replace_result $engine_type +eval +CREATE TABLE test.t1_my_table + (f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1,f2)) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci +ENGINE = $engine_type; +# Settings used in CREATE TABLE must be visible +# in information_schema.key_column_usage. +--vertical_results +SELECT * FROM information_schema.key_column_usage +WHERE table_name = 't1_my_table'; +--horizontal_results +# +# Check modification of TABLE_NAME +SELECT DISTINCT table_name FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_my_table%'; +RENAME TABLE test.t1_my_table TO test.t1_my_tablex; +SELECT DISTINCT table_name FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_my_table%'; +# +# Check modification of TABLE_SCHEMA +SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex; +SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +# +# Check modification of COLUMN_NAME +SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY table_name, column_name; +ALTER TABLE db_datadict.t1_my_tablex CHANGE COLUMN f1 first_col CHAR(12); +SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY table_name, column_name; +# +# Note: The size of the column list and the not very selective qualification +# is intended. I want to see that the schema names are equal and +# all records about 't1_my_tablex'. +let $my_select = SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, + table_name, ordinal_position; +# +# Check ADD INDEX being not UNIQUE (does not show up in key_column_usage) +eval $my_select; +CREATE INDEX f2 ON db_datadict.t1_my_tablex(f2); +eval $my_select; +DROP INDEX f2 ON db_datadict.t1_my_tablex; +# +# Check ADD UNIQUE INDEX without name explicit assigned +eval $my_select; +ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE (f2); +eval $my_select; +DROP INDEX f2 ON db_datadict.t1_my_tablex; +# +# Check ADD UNIQUE INDEX with name explicit assigned +eval $my_select; +ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f2); +eval $my_select; +DROP INDEX my_idx ON db_datadict.t1_my_tablex; +eval $my_select; +ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f4,first_col); +eval $my_select; +# +# Check DROP COLUMN +eval $my_select; +ALTER TABLE db_datadict.t1_my_tablex +DROP COLUMN first_col; +eval $my_select; +# +# Check impact of DROP TABLE +SELECT table_name, column_name +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY table_name, column_name; +DROP TABLE db_datadict.t1_my_tablex; +SELECT table_name, column_name +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +# +# No UNIQUE CONSTRAINT -> no entry in key_column_usage +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +--replace_result $engine_type +eval +CREATE TABLE db_datadict.t1_my_tablex +ENGINE = $engine_type AS +SELECT 1 AS f1; +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +# UNIQUE CONSTRAINT -> entry in key_column_usage +ALTER TABLE db_datadict.t1_my_tablex ADD PRIMARY KEY(f1); +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +# +# Check impact of DROP SCHEMA +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +DROP DATABASE db_datadict; +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +# + + +--echo ######################################################################## +--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +--echo # DDL on INFORMATION_SCHEMA table are not supported +--echo ######################################################################## +# 3.2.1.3: Ensure that no user may execute an INSERT statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.5: Ensure that no user may execute a DELETE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.8: Ensure that no user may create an index on an +# INFORMATION_SCHEMA table. +# 3.2.1.9: Ensure that no user may alter the definition of an +# INFORMATION_SCHEMA table. +# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. +# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any +# other database. +# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data +# in an INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +DROP TABLE IF EXISTS db_datadict.t1; +--enable_warnings +CREATE DATABASE db_datadict; +--replace_result $engine_type +eval +CREATE TABLE db_datadict.t1 (f1 BIGINT) +ENGINE = $engine_type; + +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.key_column_usage + (constraint_schema, constraint_name, table_name) +VALUES ( 'mysql', 'primary', 'db'); +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.key_column_usage +SELECT * FROM information_schema.key_column_usage; + +--error ER_DBACCESS_DENIED_ERROR +UPDATE information_schema.key_column_usage +SET table_name = 'db1' WHERE constraint_name = 'primary'; + +--error ER_DBACCESS_DENIED_ERROR +DELETE FROM information_schema.key_column_usage WHERE table_name = 't1'; +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE information_schema.key_column_usage; + +--error ER_DBACCESS_DENIED_ERROR +CREATE INDEX i3 ON information_schema.key_column_usage(table_name); + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.key_column_usage ADD f1 INT; + +--error ER_DBACCESS_DENIED_ERROR +DROP TABLE information_schema.key_column_usage; + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.key_column_usage +RENAME db_datadict.key_column_usage; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.key_column_usage +RENAME information_schema.xkey_column_usage; + +# Cleanup +DROP TABLE db_datadict.t1; +DROP DATABASE db_datadict; + diff --git a/mysql-test/suite/funcs_1/datadict/is_routines.inc b/mysql-test/suite/funcs_1/datadict/is_routines.inc new file mode 100644 index 00000000000..3e9aa874a66 --- /dev/null +++ b/mysql-test/suite/funcs_1/datadict/is_routines.inc @@ -0,0 +1,472 @@ +# suite/funcs_1/datadict/is_routines.inc +# +# Check the layout of information_schema.routines and the impact of +# CREATE/ALTER/DROP PROCEDURE/FUNCTION ... on it. +# +# Note: +# This test is not intended +# - to show information about the all time existing routines (there are no +# in the moment) within the databases information_schema and mysql +# - for checking storage engine properties +# Therefore please do not alter $engine_type and $other_engine_type. +# +# Author: +# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of +# testsuite funcs_1 +# Create this script based on older scripts and new code. +# Last Change: +# 2008-06-11 mleich Move t/is_routines.test to this file and +# create variants for embedded/non embedded server. +# + +let $engine_type = MEMORY; +let $other_engine_type = MyISAM; + +let $is_table = ROUTINES; + +# The table INFORMATION_SCHEMA.TABLES must exist +eval SHOW TABLES FROM information_schema LIKE '$is_table'; + +--echo ####################################################################### +--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +--echo ####################################################################### +# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT +# statement, just as if it were an ordinary user-defined table. +# +--source suite/funcs_1/datadict/is_table_query.inc + + +--echo ######################################################################### +--echo # Testcase 3.2.8.1: INFORMATION_SCHEMA.ROUTINES layout +--echo ######################################################################### +# Ensure that the INFORMATION_SCHEMA.ROUTINES table has the following columns, +# in the following order: +# +# SPECIFIC_NAME (shows the name of an accessible stored procedure, or routine), +# ROUTINE_CATALOG (always shows NULL), +# ROUTINE_SCHEMA (shows the database, or schema, in which the routine resides), +# ROUTINE_NAME (shows the same stored procedure name), +# ROUTINE_TYPE (shows whether the stored procedure is a procedure or a function), +# DTD_IDENTIFIER (shows, for a function, the complete data type definition of +# the value the function will return; otherwise NULL), +# ROUTINE_BODY (shows the language in which the stored procedure is written; +# currently always SQL), +# ROUTINE_DEFINITION (shows as much of the routine body as is possible in the +# allotted space), +# EXTERNAL_NAME (always shows NULL), +# EXTERNAL_LANGUAGE (always shows NULL), +# PARAMETER_STYLE (shows the routine's parameter style; always SQL), +# IS_DETERMINISTIC (shows whether the routine is deterministic), +# SQL_DATA_ACCESS (shows the routine's defined sql-data-access clause value), +# SQL_PATH (always shows NULL), +# SECURITY_TYPE (shows whether the routine's defined security_type is 'definer' +# or 'invoker'), +# CREATED (shows the timestamp of the time the routine was created), +# LAST_ALTERED (shows the timestamp of the time the routine was last altered), +# SQL_MODE (shows the sql_mode setting at the time the routine was created), +# ROUTINE_COMMENT (shows the comment, if any, defined for the routine; +# otherwise NULL), +# DEFINER (shows the user who created the routine). +# +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval DESCRIBE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW CREATE TABLE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW COLUMNS FROM information_schema.$is_table; + +USE test; +--disable_warnings +DROP PROCEDURE IF EXISTS sp_for_routines; +DROP FUNCTION IF EXISTS function_for_routines; +--enable_warnings +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; + +# Show that the column values of +# ROUTINE_CATALOG, EXTERNAL_NAME, EXTERNAL_LANGUAGE, SQL_PATH are always NULL +# and +# ROUTINE_BODY, PARAMETER_STYLE are 'SQL' +# and +# SPECIFIC_NAME = ROUTINE_NAME. +SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type, + routine_body,external_name,external_language,parameter_style,sql_path +FROM information_schema.routines +WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL + OR external_language IS NOT NULL OR sql_path IS NOT NULL + OR routine_body <> 'SQL' OR parameter_style <> 'SQL' + OR specific_name <> routine_name; + +DROP PROCEDURE sp_for_routines; +DROP FUNCTION function_for_routines; + + +--echo ################################################################################ +--echo # Testcase 3.2.8.2 + 3.2.8.3: INFORMATION_SCHEMA.ROUTINES accessible information +--echo ################################################################################ +# 3.2.8.2: Ensure that the table shows the relevant information on every SQL-invoked +# routine (i.e. stored procedure) which is accessible to the current user +# or to PUBLIC. +# 3.2.8.3: Ensure that the table does not show any information on any stored procedure +# that is not accessible to the current user or PUBLIC. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +DROP DATABASE IF EXISTS db_datadict_2; +--enable_warnings + +CREATE DATABASE db_datadict; +USE db_datadict; +--replace_result $other_engine_type +eval +CREATE TABLE res_6_408002_1(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT) +ENGINE = $other_engine_type; +INSERT INTO res_6_408002_1(f1, f2, f3, f4) +VALUES('abc', 'xyz', '1989-11-09', 0815); +--disable_warnings +DROP PROCEDURE IF EXISTS sp_6_408002_1; +--enable_warnings +delimiter //; +CREATE PROCEDURE sp_6_408002_1() +BEGIN + SELECT * FROM db_datadict.res_6_408002_1; +END// +delimiter ;// + +CREATE DATABASE db_datadict_2; +USE db_datadict_2; +--replace_result $other_engine_type +eval +CREATE TABLE res_6_408002_2(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT) +ENGINE = $other_engine_type; +INSERT INTO res_6_408002_2(f1, f2, f3, f4) +VALUES('abc', 'xyz', '1990-10-03', 4711); +--disable_warnings +DROP PROCEDURE IF EXISTS sp_6_408002_2; +--enable_warnings +delimiter //; +CREATE PROCEDURE sp_6_408002_2() +BEGIN + SELECT * FROM db_datadict_2.res_6_408002_2; +END// +delimiter ;// + +--error 0,ER_CANNOT_USER +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; + + +GRANT SELECT ON db_datadict_2.* TO 'testuser1'@'localhost'; +GRANT EXECUTE ON db_datadict_2.* TO 'testuser1'@'localhost'; + +GRANT EXECUTE ON db_datadict.* TO 'testuser1'@'localhost'; +GRANT SELECT ON db_datadict.* TO 'testuser2'@'localhost'; + +GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2 +TO 'testuser2'@'localhost'; +GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost'; +FLUSH PRIVILEGES; + +--echo # Establish connection testuser1 (user=testuser1) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser1, localhost, testuser1, , db_datadict); +--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" +SELECT * FROM information_schema.routines; + +--echo # Establish connection testuser2 (user=testuser2) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser2, localhost, testuser2, , db_datadict); +--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" +SELECT * FROM information_schema.routines; + +--echo # Establish connection testuser3 (user=testuser3) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser3, localhost, testuser3, , test); +--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" +SELECT * FROM information_schema.routines; + +# Cleanup +--echo # Switch to connection default and close connections testuser1,testuser2,testuser3 +connection default; +disconnect testuser1; +disconnect testuser2; +disconnect testuser3; + +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; + +USE test; +DROP DATABASE db_datadict; +DROP DATABASE db_datadict_2; + + +--echo ######################################################################### +--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.ROUTINES modifications +--echo ######################################################################### +# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or +# column) automatically inserts all relevant information on that +# object into every appropriate INFORMATION_SCHEMA table. +# 3.2.1.14: Ensure that the alteration of any existing database object +# automatically updates all relevant information on that object in +# every appropriate INFORMATION_SCHEMA table. +# 3.2.1.15: Ensure that the dropping of any existing database object +# automatically deletes all relevant information on that object from +# every appropriate INFORMATION_SCHEMA table. +# +# Some more tests are in t/information_schema_routines.test which exists +# in MySQL 5.1 and up only. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; + +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; +USE db_datadict; +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; +--vertical_results +--replace_column 16 17 +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' +ORDER BY routine_name; +--horizontal_results + +ALTER PROCEDURE sp_for_routines SQL SECURITY INVOKER; +ALTER FUNCTION function_for_routines COMMENT 'updated comments'; +--vertical_results +--replace_column 16 17 +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' +ORDER BY routine_name; +--horizontal_results + +DROP PROCEDURE sp_for_routines; +DROP FUNCTION function_for_routines; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; + +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; +--vertical_results +--replace_column 16 17 +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' +ORDER BY routine_name; +--horizontal_results +use test; +DROP DATABASE db_datadict; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; + + +--echo ######################################################################### +--echo # 3.2.8.4: INFORMATION_SCHEMA.ROUTINES routine body too big for +--echo # ROUTINE_DEFINITION column +--echo ######################################################################### +# Ensure that a stored procedure with a routine body that is too large to fit +# into the INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION column correctly shows +# as much of the information as is possible within the allotted size. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; +USE db_datadict; +# +--replace_result $other_engine_type +eval +CREATE TABLE db_datadict.res_6_408004_1 + (f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR) +ENGINE = $other_engine_type; +INSERT INTO db_datadict.res_6_408004_1 +VALUES ('abc', 98765 , 99999999 , 98765, 10); +# +--replace_result $other_engine_type +eval +CREATE TABLE db_datadict.res_6_408004_2 + (f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR) +ENGINE = $other_engine_type; +INSERT INTO db_datadict.res_6_408004_2 +VALUES ('abc', 98765 , 99999999 , 98765, 10); + +--echo # Checking the max. possible length of (currently) 4 GByte is not +--echo # in this environment here. + +delimiter //; +CREATE PROCEDURE sp_6_408004 () +BEGIN + DECLARE done INTEGER DEFAULt 0; + DECLARE variable_number_1 LONGTEXT; + DECLARE variable_number_2 MEDIUMINT; + DECLARE variable_number_3 LONGBLOB; + DECLARE variable_number_4 REAL; + DECLARE variable_number_5 YEAR; + DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; + DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; + DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; + DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; + DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; + DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; + BEGIN + OPEN cursor_number_1; + WHILE done <> 1 DO + FETCH cursor_number_1 + INTO variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5; + IF done <> 0 THEN + INSERT INTO res_6_408004_2 + VALUES (variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5); + END IF; + END WHILE; + BEGIN + BEGIN + SET done = 0; + OPEN cursor_number_2; + WHILE done <> 1 DO + FETCH cursor_number_2 + INTO variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5; + IF done <> 0 THEN + INSERT INTO res_6_408004_2 + VALUES(variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5); + END IF; + END WHILE; + END; + SET done = 0; + OPEN cursor_number_3; + WHILE done <> 1 DO + FETCH cursor_number_3 + INTO variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5; + IF done <> 0 THEN + INSERT INTO res_6_408004_2 + VALUES(variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5); + END IF; + END WHILE; + END; + END; + BEGIN + SET done = 0; + OPEN cursor_number_4; + WHILE done <> 1 DO + FETCH cursor_number_4 + INTO variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5; + IF done <> 0 THEN + INSERT INTO res_6_408004_2 + VALUES (variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5); + END IF; + END WHILE; + END; + BEGIN + SET @a='test row'; + SELECT @a; + SELECT @a; + SELECT @a; + END; + BEGIN + SET done = 0; + OPEN cursor_number_5; + WHILE done <> 1 DO + FETCH cursor_number_5 + INTO variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5; + IF done <> 0 THEN + INSERT INTO res_6_408004_2 + VALUES (variable_number_1, variable_number_2, variable_number_3, + variable_number_4, variable_number_5); + END IF; + END WHILE; + END; + BEGIN + SET @a='test row'; + SELECT @a; + SELECT @a; + SELECT @a; + END; +END// +delimiter ;// + +CALL db_datadict.sp_6_408004 (); +SELECT * FROM db_datadict.res_6_408004_2; + +--vertical_results +--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" +SELECT *, LENGTH(routine_definition) FROM information_schema.routines +WHERE routine_schema = 'db_datadict'; +--horizontal_results + +# Cleanup +DROP DATABASE db_datadict; +# ---------------------------------------------------------------------------------------------- + + +--echo ######################################################################## +--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +--echo # DDL on INFORMATION_SCHEMA table are not supported +--echo ######################################################################## +# 3.2.1.3: Ensure that no user may execute an INSERT statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.5: Ensure that no user may execute a DELETE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.8: Ensure that no user may create an index on an INFORMATION_SCHEMA table. +# 3.2.1.9: Ensure that no user may alter the definition of an +# INFORMATION_SCHEMA table. +# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. +# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any +# other database. +# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data +# in an INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; +USE db_datadict; +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +USE test; + +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.routines (routine_name, routine_type ) +VALUES ('p2', 'procedure'); + +--error ER_DBACCESS_DENIED_ERROR +UPDATE information_schema.routines SET routine_name = 'p2' +WHERE routine_body = 'sql'; + +--error ER_DBACCESS_DENIED_ERROR +DELETE FROM information_schema.routines ; +# +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE information_schema.routines ; + +--error ER_DBACCESS_DENIED_ERROR +CREATE INDEX i7 ON information_schema.routines (routine_name); + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.routines ADD f1 INT; +# +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.routines DISCARD TABLESPACE; + +--error ER_DBACCESS_DENIED_ERROR +DROP TABLE information_schema.routines ; + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.routines RENAME db_datadict.routines; +# +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.routines RENAME information_schema.xroutines; + +# Cleanup +DROP DATABASE db_datadict; + diff --git a/mysql-test/suite/funcs_1/datadict/is_schemata.inc b/mysql-test/suite/funcs_1/datadict/is_schemata.inc new file mode 100644 index 00000000000..b2a6139b839 --- /dev/null +++ b/mysql-test/suite/funcs_1/datadict/is_schemata.inc @@ -0,0 +1,247 @@ +# suite/funcs_1/datadict/is_schemata.inc +# +# Check the layout of information_schema.schemata, permissions and the impact of +# CREATE/ALTER/DROP SCHEMA on it. +# +# Note: +# This test is not intended +# - to show information about the all time existing databases +# information_schema and mysql +# - for checking storage engine properties +# +# Author: +# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of +# testsuite funcs_1 +# Create this script based on older scripts and new code. +# Last Change: +# 2008-06-11 mleich Move t/is_schemata.test to this file and +# create variants for embedded/non embedded server. +# + +let $is_table = SCHEMATA; + +# The table INFORMATION_SCHEMA.SCHEMATA must exist +eval SHOW TABLES FROM information_schema LIKE '$is_table'; + +--echo ####################################################################### +--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +--echo ####################################################################### +# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT +# statement, just as if it were an ordinary user-defined table. +# +--source suite/funcs_1/datadict/is_table_query.inc + + +--echo ######################################################################### +--echo # Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout; +--echo ######################################################################### +# Ensure that the INFORMATION_SCHEMA.SCHEMATA table has the following columns, +# in the following order: +# +# CATALOG_NAME (always shows NULL), +# SCHEMA_NAME (shows the name of a database, or schema, on which the current +# user or PUBLIC has privileges), +# DEFAULT_CHARACTER_SET_NAME (shows the name of that database's default +# character set), +# DEFAULT_COLLATION_NAME (shows the database defaul collation) +# SQL_PATH (always shows NULL). +# +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval DESCRIBE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW CREATE TABLE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW COLUMNS FROM information_schema.$is_table; + +# Note: Retrieval of information within information_schema.columns about +# information_schema.schemata is in is_columns_is.test. + +# Show that CATALOG_NAME and SQL_PATH are always NULL. +SELECT catalog_name, schema_name, sql_path +FROM information_schema.schemata +WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL; + + +--echo ############################################################################### +--echo # Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information +--echo ############################################################################### +# 3.2.9.2 Ensure that the table shows the relevant information for every +# database on which the current user or PUBLIC have privileges. +# 3.2.9.3 Ensure that the table does not show any information on any databases +# on which the current user and PUBLIC have no privileges. +# +# Note: Check of content within information_schema.schemata about the databases +# information_schema and mysql is in +# suite/funcs_1/t/is_schemata_is_mysql.test. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict_1; +DROP DATABASE IF EXISTS db_datadict_2; +--enable_warnings +CREATE DATABASE db_datadict_1; +CREATE DATABASE db_datadict_2; + +--error 0,ER_CANNOT_USER +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; + +GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost'; +GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost'; +GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost'; + +let $my_select = SELECT * FROM information_schema.schemata +WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name; +let $my_show = SHOW DATABASES LIKE 'db_datadict_%'; + +eval $my_select; +--sorted_result +eval $my_show; + +--echo # Establish connection testuser1 (user=testuser1) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser1, localhost, testuser1, , db_datadict_1); +# Shows db_datadict_1 +eval $my_select; +--sorted_result +eval $my_show; + +--echo # Establish connection testuser2 (user=testuser2) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser2, localhost, testuser2, , db_datadict_2); +# Shows db_datadict_1 and db_datadict_2 +eval $my_select; +--sorted_result +eval $my_show; + +--echo # Establish connection testuser3 (user=testuser3) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser3, localhost, testuser3, , test); +# Shows neither db_datadict_1 nor db_datadict_2 +eval $my_select; +--sorted_result +eval $my_show; + +# Cleanup +--echo # Switch to connection default and close connections testuser1,testuser2,testuser3 +connection default; +disconnect testuser1; +disconnect testuser2; +disconnect testuser3; +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +DROP DATABASE db_datadict_1; +DROP DATABASE db_datadict_2; + + +--echo ################################################################################# +--echo # Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications +--echo ################################################################################# +# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or +# column) automatically inserts all relevant information on that +# object into every appropriate INFORMATION_SCHEMA table. +# 3.2.1.14: Ensure that the alteration of any existing database object +# automatically updates all relevant information on that object in +# every appropriate INFORMATION_SCHEMA table. +# 3.2.1.15: Ensure that the dropping of any existing database object +# automatically deletes all relevant information on that object from +# every appropriate INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings + +SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci'; +SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict'; + +# Check modify default CHARACTER SET +SELECT schema_name, default_character_set_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +ALTER SCHEMA db_datadict CHARACTER SET 'utf8'; +SELECT schema_name, default_character_set_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +ALTER SCHEMA db_datadict CHARACTER SET 'latin1'; + +# Check modify default COLLATION +SELECT schema_name, default_collation_name FROM information_schema.schemata +WHERE schema_name = 'db_datadict'; +ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs'; +SELECT schema_name, default_collation_name FROM information_schema.schemata +WHERE schema_name = 'db_datadict'; + +# Check DROP DATABASE +SELECT schema_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +DROP DATABASE db_datadict; +SELECT schema_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; + + +--echo ######################################################################## +--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +--echo # DDL on INFORMATION_SCHEMA tables are not supported +--echo ######################################################################## +# 3.2.1.3: Ensure that no user may execute an INSERT statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.5: Ensure that no user may execute a DELETE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.8: Ensure that no user may create an index on an INFORMATION_SCHEMA table. +# 3.2.1.9: Ensure that no user may alter the definition of an +# INFORMATION_SCHEMA table. +# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. +# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any +# other database. +# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data +# in an INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci'; + +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.schemata + (catalog_name, schema_name, default_character_set_name, sql_path) +VALUES (NULL, 'db1', 'latin1', NULL); +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.schemata +SELECT * FROM information_schema.schemata; + +--error ER_DBACCESS_DENIED_ERROR +UPDATE information_schema.schemata +SET default_character_set_name = 'utf8' +WHERE schema_name = 'db_datadict'; +--error ER_DBACCESS_DENIED_ERROR +UPDATE information_schema.schemata SET catalog_name = 't_4711'; + +--error ER_DBACCESS_DENIED_ERROR +DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE information_schema.schemata; + +--error ER_DBACCESS_DENIED_ERROR +CREATE INDEX i1 ON information_schema.schemata(schema_name); + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.schemata ADD f1 INT; + +--error ER_DBACCESS_DENIED_ERROR +DROP TABLE information_schema.schemata; + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.schemata RENAME db_datadict.schemata; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.schemata RENAME information_schema.xschemata; + +# Cleanup +DROP DATABASE db_datadict; + diff --git a/mysql-test/suite/funcs_1/datadict/is_tables.inc b/mysql-test/suite/funcs_1/datadict/is_tables.inc new file mode 100644 index 00000000000..6d47c33e715 --- /dev/null +++ b/mysql-test/suite/funcs_1/datadict/is_tables.inc @@ -0,0 +1,475 @@ +# suite/funcs_1/datadict/is_tables.inc +# +# Check the layout of information_schema.tables and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# +# Note: +# This test is not intended +# - to show information about the all time existing tables +# within the databases information_schema and mysql +# - for checking storage engine properties +# Therefore please do not alter $engine_type and $other_engine_type. +# Some results of the subtests depend on the storage engines assigned. +# +# Author: +# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of +# testsuite funcs_1 +# Create this script based on older scripts and new code. +# Last Change: +# 2008-06-11 mleich Move t/is_tables.test to this file and +# create variants for embedded/non embedded server. +# + +let $engine_type = MEMORY; +let $other_engine_type = MyISAM; + +let $is_table = TABLES; + +# The table INFORMATION_SCHEMA.TABLES must exist +eval SHOW TABLES FROM information_schema LIKE '$is_table'; + +--echo ####################################################################### +--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +--echo ####################################################################### +# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT +# statement, just as if it were an ordinary user-defined table. +# +--source suite/funcs_1/datadict/is_table_query.inc + + +--echo ######################################################################### +--echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.TABLES layout +--echo ######################################################################### +# Ensure that the INFORMATION_SCHEMA.TABLES table has the following columns, +# in the following order: +# +# TABLE_CATALOG (always shows NULL), +# TABLE_SCHEMA (shows the name of the database, or schema, in which an +# accessible table resides), +# TABLE_NAME (shows the name of a table which the current user may access), +# TABLE_TYPE (shows whether the table is a BASE TABLE, a TEMPORARY table, +# or a VIEW), +# ENGINE (shows the storage engine used for the table), +# VERSION (shows the version number of the table's .frm file), +# ROW_FORMAT (shows the table's row storage format; either FIXED, DYNAMIC +# or COMPRESSED), +# TABLE_ROWS (shows the number of rows in the table), +# AVG_ROW_LENGTH (shows the average length of the table's rows), +# DATA_LENGTH (shows the length of the table's data file), +# MAX_DATA_LENGTH (shows the maximum length of the table's data file), +# INDEX_LENGTH (shows the length of the index file associated with the table), +# DATA_FREE (shows the number of allocated, unused bytes), +# AUTO_INCREMENT (shows the next AUTO_INCREMENT value, where applicable), +# CREATE_TIME (shows the timestamp of the time the table was created), +# UPDATE_TIME (shows the timestamp of the time the table's data file was +# last updated), +# CHECK_TIME (shows the timestamp of the time the table was last checked), +# TABLE_COLLATION (shows the table's default collation), +# CHECKSUM (shows the live checksum value for the table, if any; otherwise NULL), +# CREATE_OPTIONS (shows any additional options used in the table's definition; +# otherwise NULL), +# TABLE_COMMENT (shows the comment added to the table's definition; +# otherwise NULL). +# +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval DESCRIBE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW CREATE TABLE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW COLUMNS FROM information_schema.$is_table; + +# Note: Retrieval of information within information_schema.columns about +# information_schema.tables is in is_columns_is.test. + +# Show that TABLE_CATALOG is always NULL. +SELECT table_catalog, table_schema, table_name +FROM information_schema.tables WHERE table_catalog IS NOT NULL; + + +--echo ################################################################################ +--echo # Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information +--echo ################################################################################ +# 3.2.12.2: Ensure that the table shows the relevant information on every base table +# and view on which the current user or PUBLIC has privileges. +# 3.2.12.3: Ensure that the table does not show any information on any tables +# on which the current user and public have no privileges. +# +# Note: Check of content within information_schema.tables about tables within +# database is in +# mysql is_tables_mysql.test +# information_schema is_tables_is.test +# test% is_tables_.test +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; + +--error 0,ER_CANNOT_USER +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +GRANT CREATE, CREATE VIEW, INSERT, SELECT ON db_datadict.* + TO 'testuser1'@'localhost' WITH GRANT OPTION; +--error 0,ER_CANNOT_USER +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; + +--replace_result $engine_type +eval +CREATE TABLE db_datadict.tb1 (f1 INT, f2 INT, f3 INT) +ENGINE = $engine_type; + +GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost'; +GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION; + +let $my_select = SELECT * FROM information_schema.tables +WHERE table_schema = 'db_datadict' ORDER BY table_name; +let $my_show = SHOW TABLES FROM db_datadict; + +--echo # Establish connection testuser1 (user=testuser1) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser1, localhost, testuser1, , db_datadict); +# tb2 is not granted to anyone +--replace_result $engine_type +eval +CREATE TABLE tb2 (f1 DECIMAL) +ENGINE = $engine_type; +--replace_result $engine_type +eval +CREATE TABLE tb3 (f1 VARCHAR(200)) +ENGINE = $engine_type; +GRANT SELECT ON db_datadict.tb3 to 'testuser3'@'localhost'; +GRANT INSERT ON db_datadict.tb3 to 'testuser2'@'localhost'; +CREATE VIEW v3 AS SELECT * FROM tb3; +GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost'; + +if ($have_bug_32285) +{ +--disable_ps_protocol +} +# We do not want to check here values affected by +# - the storage engine used +# - Operating system / Filesystem +# - start time of test +# 1 TABLE_CATALOG +# 2 TABLE_SCHEMA +# 3 TABLE_NAME +# 4 TABLE_TYPE +# 5 ENGINE affected by storage engine used +# 6 VERSION +# 7 ROW_FORMAT affected by storage engine used +# 8 TABLE_ROWS +# 9 AVG_ROW_LENGTH affected by storage engine used +# 10 DATA_LENGTH affected by storage engine used and maybe OS +# 11 MAX_DATA_LENGTH affected by storage engine used and maybe OS +# 12 INDEX_LENGTH affected by storage engine used and maybe OS +# 13 DATA_FREE affected by storage engine used and maybe OS +# 14 AUTO_INCREMENT +# 15 CREATE_TIME depends roughly on start time of test (*) +# 16 UPDATE_TIME depends roughly on start time of test (*) +# 17 CHECK_TIME depends roughly on start time of test and storage engine (*) +# 18 TABLE_COLLATION +# 19 CHECKSUM affected by storage engine used +# 20 CREATE_OPTIONS +# 21 TABLE_COMMENT affected by some storage engines +# (*) In case of view or temporary table NULL. +--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" +eval $my_select; +--enable_ps_protocol +--sorted_result +eval $my_show; + +--echo # Establish connection testuser2 (user=testuser2) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser2, localhost, testuser2, , db_datadict); +if ($have_bug_32285) +{ +--disable_ps_protocol +} +--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" +eval $my_select; +--enable_ps_protocol +--sorted_result +eval $my_show; + +--echo # Establish connection testuser3 (user=testuser3) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser3, localhost, testuser3, , db_datadict); +if ($have_bug_32285) +{ +--disable_ps_protocol +} +--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" +eval $my_select; +--enable_ps_protocol +--sorted_result +eval $my_show; + +--echo # Switch to connection default (user=root) +connection default; +# we see only 'public' tables +if ($have_bug_32285) +{ +--disable_ps_protocol +} +--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" +eval $my_select; +--enable_ps_protocol +--sorted_result +eval $my_show; + +# Cleanup +--echo # Close connection testuser1, testuser2, testuser3 +disconnect testuser1; +disconnect testuser2; +disconnect testuser3; +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +DROP DATABASE db_datadict; + + +--echo ######################################################################### +--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLES modifications +--echo ######################################################################### +# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or +# column) automatically inserts all relevant information on that +# object into every appropriate INFORMATION_SCHEMA table. +# 3.2.1.14: Ensure that the alteration of any existing database object +# automatically updates all relevant information on that object in +# every appropriate INFORMATION_SCHEMA table. +# 3.2.1.15: Ensure that the dropping of any existing database object +# automatically deletes all relevant information on that object from +# every appropriate INFORMATION_SCHEMA table. +# +--disable_warnings +DROP TABLE IF EXISTS test.t1_my_table; +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; + +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +--replace_result $engine_type +eval +CREATE TABLE test.t1_my_table (f1 BIGINT) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci +COMMENT = 'Initial Comment' ENGINE = $engine_type; +# Settings used in CREATE TABLE must be visible in information_schema.tables. +--vertical_results +--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" +SELECT * FROM information_schema.tables +WHERE table_name = 't1_my_table'; +--horizontal_results +# +# Check modification of TABLE_NAME +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +RENAME TABLE test.t1_my_table TO test.t1_my_tablex; +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +# +# Check modification of TABLE_SCHEMA +SELECT table_schema,table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex; +SELECT table_schema,table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check modification of ENGINE +--replace_result $engine_type +SELECT table_name, engine FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +--replace_result $other_engine_type +eval +ALTER TABLE db_datadict.t1_my_tablex +ENGINE = $other_engine_type; +--replace_result $other_engine_type +SELECT table_name, engine FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check modification of TABLE_ROWS +SELECT table_name, table_rows FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +INSERT INTO db_datadict.t1_my_tablex VALUES(1),(2); +SELECT table_name, table_rows FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check indirect modification of TABLE_COLLATION +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +ALTER TABLE db_datadict.t1_my_tablex DEFAULT CHARACTER SET utf8; +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# Check direct modification of TABLE_COLLATION +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +ALTER TABLE db_datadict.t1_my_tablex +DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci; +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check modification of TABLE_COMMENT +SELECT table_name, TABLE_COMMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +ALTER TABLE db_datadict.t1_my_tablex COMMENT 'Changed Comment'; +SELECT table_name, TABLE_COMMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check modification of AUTO_INCREMENT +SELECT table_name, AUTO_INCREMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +ALTER TABLE db_datadict.t1_my_tablex +ADD f2 BIGINT AUTO_INCREMENT, ADD PRIMARY KEY (f2); +SELECT table_name, AUTO_INCREMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check modification of ROW_FORMAT +SELECT table_name, ROW_FORMAT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +ALTER TABLE db_datadict.t1_my_tablex ROW_FORMAT = dynamic; +SELECT table_name, ROW_FORMAT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check "growth" of UPDATE_TIME and modification of CHECKSUM +SELECT table_name, checksum FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +ALTER TABLE db_datadict.t1_my_tablex CHECKSUM = 1; +SELECT table_name, checksum IS NOT NULL FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# Enforce a time difference bigger than the smallest unit (1 second). +--real_sleep 1.1 +INSERT INTO db_datadict.t1_my_tablex SET f1 = 3; +SELECT UPDATE_TIME > @UPDATE_TIME + AS "Is current UPDATE_TIME bigger than before last INSERT?" +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +SELECT checksum <> @checksum + AS "Is current CHECKSUM different than before last INSERT?" +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Information is used later +SELECT CREATE_TIME INTO @CREATE_TIME FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check impact of DROP TABLE +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +DROP TABLE db_datadict.t1_my_tablex; +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +# +# Check "growth" of CREATE_TIME +--replace_result $other_engine_type +eval +CREATE TABLE test.t1_my_tablex (f1 BIGINT) +ENGINE = $other_engine_type; +SELECT CREATE_TIME > @CREATE_TIME + AS "Is current CREATE_TIME bigger than for the old dropped table?" +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +DROP TABLE test.t1_my_tablex; +# +# Check a VIEW +CREATE VIEW test.t1_my_tablex AS SELECT 1; +--vertical_results +SELECT * FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +--horizontal_results +DROP VIEW test.t1_my_tablex; +SELECT table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +# +# Check a temporary table +--replace_result $other_engine_type +eval +CREATE TEMPORARY TABLE test.t1_my_tablex +ENGINE = $other_engine_type + AS SELECT 1; +--vertical_results +SELECT table_name, table_type FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +--horizontal_results +DROP TEMPORARY TABLE test.t1_my_tablex; +# +# Check impact of DROP SCHEMA +--replace_result $engine_type +eval +CREATE TABLE db_datadict.t1_my_tablex +ENGINE = $engine_type AS +SELECT 1; +SELECT table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +DROP DATABASE db_datadict; +SELECT table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; + + +--echo ######################################################################## +--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +--echo # DDL on INFORMATION_SCHEMA tables are not supported +--echo ######################################################################## +# 3.2.1.3: Ensure that no user may execute an INSERT statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.5: Ensure that no user may execute a DELETE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.8: Ensure that no user may create an index on an +# INFORMATION_SCHEMA table. +# 3.2.1.9: Ensure that no user may alter the definition of an +# INFORMATION_SCHEMA table. +# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. +# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any +# other database. +# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data +# in an INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; +--replace_result $engine_type +eval +CREATE TABLE db_datadict.t1 (f1 BIGINT) +ENGINE = $engine_type; + +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.tables +SELECT * FROM information_schema.tables; + +--error ER_DBACCESS_DENIED_ERROR +UPDATE information_schema.tables SET table_schema = 'test' +WHERE table_name = 't1'; + +--error ER_DBACCESS_DENIED_ERROR +DELETE FROM information_schema.tables WHERE table_name = 't1'; +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE information_schema.tables; + +--error ER_DBACCESS_DENIED_ERROR +CREATE INDEX my_idx_on_tables ON information_schema.tables(table_schema); + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.tables DROP PRIMARY KEY; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.tables ADD f1 INT; + +--error ER_DBACCESS_DENIED_ERROR +DROP TABLE information_schema.tables; + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.tables RENAME db_datadict.tables; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.tables RENAME information_schema.xtables; + +# Cleanup +DROP DATABASE db_datadict; + diff --git a/mysql-test/suite/funcs_1/datadict/is_triggers.inc b/mysql-test/suite/funcs_1/datadict/is_triggers.inc new file mode 100644 index 00000000000..1e659f00485 --- /dev/null +++ b/mysql-test/suite/funcs_1/datadict/is_triggers.inc @@ -0,0 +1,254 @@ +# suite/funcs_1/datadict/is_triggers.inc +# +# Check the layout of information_schema.triggers and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# +# Note: +# This test is not intended +# - to show information about the all time existing triggers +# (there are no in the moment) within the databases information_schema +# and mysql +# - for checking storage engine properties +# Therefore please do not alter $engine_type and $other_engine_type. +# +# Author: +# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of +# testsuite funcs_1 +# Create this script based on older scripts and new code. +# Last Change: +# 2008-06-11 mleich Move t/is_triggers.test to this file and +# create variants for embedded/non embedded server. +# + +let $engine_type = MEMORY; +let $other_engine_type = MyISAM; + +let $is_table = TRIGGERS; + +# The table INFORMATION_SCHEMA.TRIGGERS must exist +eval SHOW TABLES FROM information_schema LIKE '$is_table'; + +--echo ####################################################################### +--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +--echo ####################################################################### +# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT +# statement, just as if it were an ordinary user-defined table. +# +--source suite/funcs_1/datadict/is_table_query.inc + + +--echo ######################################################################### +--echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.TRIGGERS layout +--echo ######################################################################### +# Ensure that the INFORMATION_SCHEMA.TRIGGERS table has the following columns, +# in the following order: +# +# TRIGGER_CATALOG NULL +# TRIGGER_SCHEMA name of the database in which the trigger occurs +# TRIGGER_NAME +# EVENT_MANIPULATION event associated with the trigger +# ('INSERT', 'DELETE', or 'UPDATE') +# EVENT_OBJECT_CATALOG NULL +# EVENT_OBJECT_SCHEMA database in which the table associated with the +# trigger occurs +# EVENT_OBJECT_TABLE name of the table associated with the trigger +# ACTION_ORDER 0 +# ACTION_CONDITION NULL +# ACTION_STATEMENT +# ACTION_ORIENTATION ROW +# ACTION_TIMING 'BEFORE' or 'AFTER' +# ACTION_REFERENCE_OLD_TABLE NULL +# ACTION_REFERENCE_NEW_TABLE NULL +# ACTION_REFERENCE_OLD_ROW OLD +# ACTION_REFERENCE_NEW_ROW NEW +# CREATED NULL (0) +# SQL_MODE server SQL mode that was in effect at the time +# when the trigger was created +# (also used during trigger execution) +# DEFINER who defined the trigger +# +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval DESCRIBE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW CREATE TABLE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW COLUMNS FROM information_schema.$is_table; + + +# Note: Retrieval of information within information_schema.columns about +# information_schema.tables is in is_columns_is.test. + +# Show that several columns are always 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 + OR action_reference_new_table IS NOT NULL; + + +--echo ################################################################################## +--echo # Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information +--echo ################################################################################## +# 3.2.18.2: Ensure that the table shows the relevant information on every +# trigger on which the current user or PUBLIC has privileges. +# 3.2.18.3: Ensure that the table does not show any information on any trigger +# on which the current user and public have no privileges. +# The SUPER privilege is required for +# - creation of triggers +# - retrieval in INFORMATION_SCHEMA.TRIGGERS (affects size of result set) +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; +--error 0,ER_CANNOT_USER +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser4'@'localhost'; +CREATE USER 'testuser4'@'localhost'; + +GRANT SUPER ON *.* TO 'testuser1'@'localhost'; +GRANT SUPER ON *.* TO 'testuser3'@'localhost'; +GRANT SUPER ON *.* TO 'testuser4'@'localhost'; +GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; + +let $my_select = SELECT * FROM information_schema.triggers +WHERE trigger_name = 'trg1'; +let $my_show = SHOW TRIGGERS FROM db_datadict; +--echo # Establish connection testuser1 (user=testuser1) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser1, localhost, testuser1, , db_datadict); +--replace_result $engine_type +eval +CREATE TABLE db_datadict.t1 (f1 INT, f2 INT, f3 INT) +ENGINE = $engine_type; +CREATE TRIGGER trg1 BEFORE INSERT +ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before; +GRANT ALL ON db_datadict.t1 TO 'testuser2'@'localhost'; +GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost'; +eval $my_select; +eval $my_show; + +--echo # Establish connection testuser2 (user=testuser2) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser2, localhost, testuser2, , db_datadict); +SHOW GRANTS FOR 'testuser2'@'localhost'; +--echo # No SUPER Privilege --> no result for query +eval $my_select; +eval $my_show; + +--echo # Establish connection testuser3 (user=testuser3) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser3, localhost, testuser3, , test); +SHOW GRANTS FOR 'testuser3'@'localhost'; +--echo # SUPER Privilege + SELECT Privilege on t1 --> result for query +eval $my_select; +eval $my_show; + +--echo # Establish connection testuser4 (user=testuser4) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser4, localhost, testuser4, , test); +SHOW GRANTS FOR 'testuser4'@'localhost'; +--echo # SUPER Privilege + no SELECT Privilege on t1 --> no result for query +eval $my_select; +eval $my_show; + +--echo # Switch to connection default and close connections testuser1 - testuser4 +connection default; +disconnect testuser1; +disconnect testuser2; +disconnect testuser3; +disconnect testuser4; +eval $my_select; +eval $my_show; +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +DROP USER 'testuser4'@'localhost'; +DROP DATABASE db_datadict; + + +--echo ######################################################################### +--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TRIGGERS modifications +--echo ######################################################################### +# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or +# column) automatically inserts all relevant information on that +# object into every appropriate INFORMATION_SCHEMA table. +# 3.2.1.14: Ensure that the alteration of any existing database object +# automatically updates all relevant information on that object in +# every appropriate INFORMATION_SCHEMA table. +# 3.2.1.15: Ensure that the dropping of any existing database object +# automatically deletes all relevant information on that object from +# every appropriate INFORMATION_SCHEMA table. +# FIXME: To be implemented + + +--echo ######################################################################## +--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +--echo # DDL on INFORMATION_SCHEMA tables are not supported +--echo ######################################################################## +# 3.2.1.3: Ensure that no user may execute an INSERT statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.5: Ensure that no user may execute a DELETE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.8: Ensure that no user may create an index on an +# INFORMATION_SCHEMA table. +# 3.2.1.9: Ensure that no user may alter the definition of an +# INFORMATION_SCHEMA table. +# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. +# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any +# other database. +# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data +# in an INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; +--replace_result $engine_type +eval +CREATE TABLE db_datadict.t1 (f1 BIGINT) +ENGINE = $engine_type; +CREATE TRIGGER db_datadict.trg1 BEFORE INSERT +ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before; + +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.triggers +SELECT * FROM information_schema.triggers; + +--error ER_DBACCESS_DENIED_ERROR +UPDATE information_schema.triggers SET trigger_schema = 'test' +WHERE table_name = 't1'; + +--error ER_DBACCESS_DENIED_ERROR +DELETE FROM information_schema.triggers WHERE trigger_name = 't1'; +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE information_schema.triggers; + +--error ER_DBACCESS_DENIED_ERROR +CREATE INDEX my_idx_on_triggers ON information_schema.triggers(trigger_schema); + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.triggers DROP PRIMARY KEY; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.triggers ADD f1 INT; + +--error ER_DBACCESS_DENIED_ERROR +DROP TABLE information_schema.triggers; + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.triggers RENAME db_datadict.triggers; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers; + +# Cleanup +DROP DATABASE db_datadict; + diff --git a/mysql-test/suite/funcs_1/datadict/is_views.inc b/mysql-test/suite/funcs_1/datadict/is_views.inc new file mode 100644 index 00000000000..32e66e4f684 --- /dev/null +++ b/mysql-test/suite/funcs_1/datadict/is_views.inc @@ -0,0 +1,306 @@ +# suite/funcs_1/datadict/is_views.inc +# +# Check the layout of information_schema.views and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# +# Note: +# - This test should not check storage engine properties. +# - Please do not change the storage engines used within this test +# except you know that the impact is acceptable. +# Some storage engines might not support the modification of +# properties like in the following tests. +# +# Author: +# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of +# testsuite funcs_1 +# Create this script based on older scripts and new code. +# Last Change: +# 2008-06-11 mleich Move t/is_views.test to this file and +# create variants for embedded/non embedded server. +# + +let $engine_type = MEMORY; +let $other_engine_type = MyISAM; + +let $is_table = VIEWS; + +# The table INFORMATION_SCHEMA.VIEWS must exist +eval SHOW TABLES FROM information_schema LIKE '$is_table'; + +--echo ####################################################################### +--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +--echo ####################################################################### +# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT +# statement, just as if it were an ordinary user-defined table. +# +--source suite/funcs_1/datadict/is_table_query.inc + + +--echo ######################################################################### +--echo # Testcase 3.2.13.1: INFORMATION_SCHEMA.VIEWS layout +--echo ######################################################################### +# Ensure that the INFORMATION_SCHEMA.VIEWS table has the following columns, +# in the following order: +# +# TABLE_CATALOG (always shows NULL), +# TABLE_SCHEMA (shows the database, or schema, in which an accessible +# view resides), +# TABLE_NAME (shows the name of a view accessible to the current user), +# VIEW_DEFINITION (shows the SELECT statement that makes up the +# view's definition), +# CHECK_OPTION (shows the value of the WITH CHECK OPTION clause used to define +# the view, either NONE, LOCAL or CASCADED), +# IS_UPDATABLE (shows whether the view is an updatable view), +# DEFINER (added with 5.0.14), +# SECURITY_TYPE (added with 5.0.14). +# +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval DESCRIBE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW CREATE TABLE information_schema.$is_table; +--source suite/funcs_1/datadict/datadict_bug_12777.inc +eval SHOW COLUMNS FROM information_schema.$is_table; + +# Note: Retrieval of information within information_schema.columns about +# information_schema.views is in is_columns_is.test. + +# Show that TABLE_CATALOG is always NULL. +SELECT table_catalog, table_schema, table_name +FROM information_schema.views WHERE table_catalog IS NOT NULL; + + +--echo ################################################################################ +--echo # Testcase 3.2.13.2 + 3.2.13.3: INFORMATION_SCHEMA.VIEWS accessible information +--echo ################################################################################ +# 3.2.13.2: Ensure that the table shows the relevant information on every view for +# which the current user or PUBLIC has the SHOW CREATE VIEW privilege. +# 3.2.13.3: Ensure that the table does not show any information on any views for which +# the current user and PUBLIC have no SHOW CREATE VIEW privilege. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; + +--error 0,ER_CANNOT_USER +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +--error 0,ER_CANNOT_USER +DROP USER 'test_no_views'@'localhost'; +CREATE USER 'test_no_views'@'localhost'; + +--replace_result $engine_type +eval +CREATE TABLE db_datadict.t1(f1 INT, f2 INT, f3 INT) +ENGINE = $engine_type; +CREATE VIEW db_datadict.v_granted_to_1 AS SELECT * FROM db_datadict.t1; +CREATE VIEW db_datadict.v_granted_glob AS SELECT f2, f3 FROM db_datadict.t1; + +GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost'; +GRANT SELECT ON db_datadict.v_granted_to_1 TO 'testuser1'@'localhost'; +GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost'; + +let $select = SELECT * FROM information_schema.views +WHERE table_schema = 'db_datadict' ORDER BY table_name; +eval $select; + +--echo # Establish connection testuser1 (user=testuser1) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser1, localhost, testuser1, , test); +eval $select; + +--echo # Establish connection testuser2 (user=testuser2) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser2, localhost, testuser2, , test); +eval $select; + +--echo # Establish connection test_no_views (user=test_no_views) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (test_no_views, localhost, test_no_views, , test); +eval $select; + +# Cleanup +--echo # Switch to connection default and close all other connections +connection default; +disconnect testuser1; +disconnect testuser2; +disconnect test_no_views; +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'test_no_views'@'localhost'; +DROP DATABASE db_datadict; + +--echo ######################################################################### +--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.VIEWS modifications +--echo ######################################################################### +# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or +# column) automatically inserts all relevant information on that +# object into every appropriate INFORMATION_SCHEMA table. +# 3.2.1.14: Ensure that the alteration of any existing database object +# automatically updates all relevant information on that object in +# every appropriate INFORMATION_SCHEMA table. +# 3.2.1.15: Ensure that the dropping of any existing database object +# automatically deletes all relevant information on that object from +# every appropriate INFORMATION_SCHEMA table. +# +--disable_warnings +DROP TABLE IF EXISTS test.t1_my_table; +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; +--replace_result $engine_type +eval +CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10)) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci +ENGINE = $engine_type; +--error 0,ER_CANNOT_USER +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; + +# Check just created VIEW +SELECT * FROM information_schema.views +WHERE table_name LIKE 't1_%'; +CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table; +SELECT * FROM information_schema.views +WHERE table_name LIKE 't1_%'; +# +# Check modification of DEFINER, SECURITY_TYPE, IS_UPDATABLE, VIEW_DEFINITION, +# CHECK_OPTION +SELECT table_name,definer FROM information_schema.views +WHERE table_name = 't1_view'; +ALTER DEFINER = 'testuser1'@'localhost' VIEW test.t1_view AS +SELECT DISTINCT f1 FROM test.t1_table; +# The next result set could suffer from +# Bug#22763 Disrepancy between SHOW CREATE VIEW and I_S.VIEWS +# because the VIEW definition is missing. +# Therefore we exclude the problematic columns from the result set. +SELECT table_name,definer,security_type FROM information_schema.views +WHERE table_name LIKE 't1_%'; +ALTER DEFINER = 'root'@'localhost' SQL SECURITY INVOKER VIEW test.t1_view AS +SELECT f1 FROM test.t1_table WITH LOCAL CHECK OPTION; +SELECT table_name,definer,security_type FROM information_schema.views +WHERE table_name LIKE 't1_%'; +# +# Check modification of TABLE_SCHEMA +SELECT table_schema,table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_schema,table_name; +--error ER_FORBID_SCHEMA_CHANGE +RENAME TABLE test.t1_view TO db_datadict.t1_view; +# Workaround for missing move to another database +DROP VIEW test.t1_view; +CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table; +SELECT table_schema,table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_schema,table_name; +# +# Check modification of TABLE_NAME +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +RENAME TABLE db_datadict.t1_view TO db_datadict.t1_viewx; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +# +# Check impact of DROP VIEW +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +DROP VIEW db_datadict.t1_viewx; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table; +# +# Check impact of DROP base TABLE of VIEW +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +DROP TABLE test.t1_table; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +--replace_result $engine_type +eval +CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10)) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci COMMENT = 'Initial Comment' +ENGINE = $engine_type; +# +# Check impact of DROP SCHEMA +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +DROP DATABASE db_datadict; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; + +# Cleanup +DROP USER 'testuser1'@'localhost'; +DROP TABLE test.t1_table; + +--echo ######################################################################## +--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +--echo # DDL on INFORMATION_SCHEMA table are not supported +--echo ######################################################################## +# 3.2.1.3: Ensure that no user may execute an INSERT statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.5: Ensure that no user may execute a DELETE statement on any +# INFORMATION_SCHEMA table. +# 3.2.1.8: Ensure that no user may create an index on an +# INFORMATION_SCHEMA table. +# 3.2.1.9: Ensure that no user may alter the definition of an +# INFORMATION_SCHEMA table. +# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. +# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any +# other database. +# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data +# in an INFORMATION_SCHEMA table. +# +--disable_warnings +DROP DATABASE IF EXISTS db_datadict; +--enable_warnings +CREATE DATABASE db_datadict; +CREATE VIEW db_datadict.v1 AS SELECT 1; + +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.views +SELECT * FROM information_schema.views; +--error ER_DBACCESS_DENIED_ERROR +INSERT INTO information_schema.views(table_schema, table_name) +VALUES ('db2', 'v2'); + +--error ER_DBACCESS_DENIED_ERROR +UPDATE information_schema.views SET table_schema = 'test' +WHERE table_name = 't1'; + +--error ER_DBACCESS_DENIED_ERROR +DELETE FROM information_schema.views WHERE table_name = 't1'; +--error ER_DBACCESS_DENIED_ERROR +TRUNCATE information_schema.views; + +--error ER_DBACCESS_DENIED_ERROR +CREATE INDEX my_idx_on_views ON information_schema.views(table_schema); + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.views DROP PRIMARY KEY; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.views ADD f1 INT; + +--error ER_DBACCESS_DENIED_ERROR +DROP TABLE information_schema.views; + +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.views RENAME db_datadict.views; +--error ER_DBACCESS_DENIED_ERROR +ALTER TABLE information_schema.views RENAME information_schema.xviews; + +# Cleanup +DROP DATABASE db_datadict; + diff --git a/mysql-test/suite/funcs_1/datadict/tables.inc b/mysql-test/suite/funcs_1/datadict/tables.inc new file mode 100644 index 00000000000..5aa072d184c --- /dev/null +++ b/mysql-test/suite/funcs_1/datadict/tables.inc @@ -0,0 +1,55 @@ +# suite/funcs_1/datadict/tables.inc +# +# Auxiliary script to be sourced by +# is_tables_.test +# +# The variable $engine_type has to be assigned before sourcing ths script. +# +# Author: +# 2008-06-04 mleich Create this script based on older scripts and new code. +# + +# Just have some tables within different databases. +--disable_warnings +DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; +--enable_warnings +CREATE DATABASE test1; +CREATE DATABASE test2; + +--replace_result $engine_type +eval CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = $engine_type; +--replace_result $engine_type +eval CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = $engine_type; +--replace_result $engine_type +eval CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = $engine_type; + +--source suite/funcs_1/datadict/tables2.inc +SHOW TABLES FROM test1; +SHOW TABLES FROM test2; + +# Create a low privileged user. +# Note: The database db_datadict is just a "home" for the low privileged user +# and not in the focus of testing. +--error 0,ER_CANNOT_USER +DROP USER testuser1@localhost; +CREATE USER testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; + +--echo # Establish connection testuser1 (user=testuser1) +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK +connect (testuser1,localhost,testuser1,,test1); +--source suite/funcs_1/datadict/tables2.inc +SHOW TABLES FROM test1; +# The lowprivileged user testuser1 will get here an error. +--disable_abort_on_error +SHOW TABLES FROM test2; +--enable_abort_on_error + +--echo # Switch to connection default and close connection testuser1 +connection default; +disconnect testuser1; +DROP USER testuser1@localhost; + +DROP DATABASE test1; +DROP DATABASE test2; diff --git a/mysql-test/suite/funcs_1/datadict/tables1.inc b/mysql-test/suite/funcs_1/datadict/tables1.inc index a03304028f6..2e054a9dcfb 100644 --- a/mysql-test/suite/funcs_1/datadict/tables1.inc +++ b/mysql-test/suite/funcs_1/datadict/tables1.inc @@ -2,8 +2,8 @@ # # Auxiliary script to be sourced by # is_tables_mysql.test +# is_tables_mysql_embedded.test # is_tables_is.test -# is_tables_.test # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -12,28 +12,27 @@ # --disable_warnings -DROP DATABASE IF EXISTS db_datadict; +DROP DATABASE IF EXISTS test1; --enable_warnings -CREATE DATABASE db_datadict; +CREATE DATABASE test1; --source suite/funcs_1/datadict/tables2.inc # Create a low privileged user. -# Note: The database db_datadict is just a "home" for the low privileged user +# Note: The database test1 is just a "home" for the low privileged user # and not in the focus of testing. --error 0,ER_CANNOT_USER DROP USER testuser1@localhost; CREATE USER testuser1@localhost; -GRANT SELECT ON db_datadict.* TO testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; --echo # Establish connection testuser1 (user=testuser1) --replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser1,localhost,testuser1,,db_datadict); +connect (testuser1,localhost,testuser1,,test1); --source suite/funcs_1/datadict/tables2.inc --echo # Switch to connection default and close connection testuser1 connection default; disconnect testuser1; DROP USER testuser1@localhost; -DROP DATABASE db_datadict; - +DROP DATABASE test1; diff --git a/mysql-test/suite/funcs_1/datadict/tables2.inc b/mysql-test/suite/funcs_1/datadict/tables2.inc index 1066e52f8f0..6442aab493c 100644 --- a/mysql-test/suite/funcs_1/datadict/tables2.inc +++ b/mysql-test/suite/funcs_1/datadict/tables2.inc @@ -29,6 +29,8 @@ let $innodb_pattern = 'InnoDB free'; let $ndb_pattern = 'number_of_replicas'; --vertical_results +# We do not unify the engine name here, because the rowformat is +# specific to the engine. --replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#" eval SELECT *, @@ -44,4 +46,3 @@ FROM information_schema.tables $my_where ORDER BY table_schema,table_name; --horizontal_results - diff --git a/mysql-test/suite/funcs_1/include/bug28309_skip.inc b/mysql-test/suite/funcs_1/include/bug28309_skip.inc new file mode 100644 index 00000000000..18ba6641fad --- /dev/null +++ b/mysql-test/suite/funcs_1/include/bug28309_skip.inc @@ -0,0 +1,13 @@ +# Skip tests which suffer from +# Bug#28309 First insert violates unique constraint +# - was "memory" table empty? +# if the folowing conditions are fulfilled: +# - MySQL Version is 5.0 (Bug is fixed in 5.1 and up) +# - use of embedded server +# - run on a case insensitive filesystem +# +let $value= query_get_value(SHOW VARIABLES LIKE 'lower_case_file_system', Value, 1); +if (`SELECT '$value' = 'ON' AND VERSION() LIKE '5.0%embedded%'`) +{ + skip # Test requires backport of fix for Bug#28309 First insert violates unique constraint - was "memory" table empty ?; +} diff --git a/mysql-test/suite/funcs_1/include/innodb_tb1.inc b/mysql-test/suite/funcs_1/include/innodb_tb1.inc index 4fede496478..c6b6395d91f 100644 --- a/mysql-test/suite/funcs_1/include/innodb_tb1.inc +++ b/mysql-test/suite/funcs_1/include/innodb_tb1.inc @@ -7,7 +7,7 @@ create table tb1 ( f1 char(0), f2 char(0) binary, f3 char(0) ascii, -f4 tinytext unicode, +f4 tinytext, f5 text, f6 mediumtext, f7 longtext, diff --git a/mysql-test/suite/funcs_1/include/innodb_tb3.inc b/mysql-test/suite/funcs_1/include/innodb_tb3.inc index b8562d7acf2..ffdb20b7eef 100644 --- a/mysql-test/suite/funcs_1/include/innodb_tb3.inc +++ b/mysql-test/suite/funcs_1/include/innodb_tb3.inc @@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101', f121 tinytext, f122 text, f123 mediumtext, -f124 longtext unicode, +f124 longtext, f125 tinyblob, f126 blob, f127 mediumblob, diff --git a/mysql-test/suite/funcs_1/include/innodb_tb4.inc b/mysql-test/suite/funcs_1/include/innodb_tb4.inc index ef8fc240eca..c7c919c829d 100644 --- a/mysql-test/suite/funcs_1/include/innodb_tb4.inc +++ b/mysql-test/suite/funcs_1/include/innodb_tb4.inc @@ -55,13 +55,13 @@ f223 year(3), f224 year(4), f225 enum("1enum","2enum"), f226 set("1set","2set"), -f235 char(0) unicode, +f235 char(0), f236 char(90), f237 char(255) ascii, f238 varchar(0), f239 varchar(20000) binary, -f240 varchar(2000) unicode, -f241 char(100) unicode +f240 varchar(2000), +f241 char(100) ) engine = innodb; --replace_result $MYSQLTEST_VARDIR diff --git a/mysql-test/suite/funcs_1/include/memory_tb4.inc b/mysql-test/suite/funcs_1/include/memory_tb4.inc index f9cc1d53c52..0cf17127d32 100644 --- a/mysql-test/suite/funcs_1/include/memory_tb4.inc +++ b/mysql-test/suite/funcs_1/include/memory_tb4.inc @@ -55,12 +55,12 @@ f223 year(3), f224 year(4), f225 enum("1enum","2enum"), f226 set("1set","2set"), -f236 char(95) unicode, -f241 char(255) unicode, +f236 char(95), +f241 char(255), f237 char(130) binary, f238 varchar(25000) binary, f239 varbinary(0), -f240 varchar(1200) unicode +f240 varchar(1200) ) engine = memory; --replace_result $MYSQLTEST_VARDIR diff --git a/mysql-test/suite/funcs_1/include/myisam_tb1.inc b/mysql-test/suite/funcs_1/include/myisam_tb1.inc index da740cffaf3..1c95c6c53c0 100644 --- a/mysql-test/suite/funcs_1/include/myisam_tb1.inc +++ b/mysql-test/suite/funcs_1/include/myisam_tb1.inc @@ -7,7 +7,7 @@ create table tb1 ( f1 char, f2 char binary, f3 char ascii, -f4 tinytext unicode, +f4 tinytext, f5 text, f6 mediumtext, f7 longtext, diff --git a/mysql-test/suite/funcs_1/include/myisam_tb3.inc b/mysql-test/suite/funcs_1/include/myisam_tb3.inc index 4ee6388f3bc..209c2e13fbf 100644 --- a/mysql-test/suite/funcs_1/include/myisam_tb3.inc +++ b/mysql-test/suite/funcs_1/include/myisam_tb3.inc @@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101', f121 tinytext, f122 text, f123 mediumtext, -f124 longtext unicode, +f124 longtext, f125 tinyblob, f126 blob, f127 mediumblob, diff --git a/mysql-test/suite/funcs_1/include/myisam_tb4.inc b/mysql-test/suite/funcs_1/include/myisam_tb4.inc index 1f7d19fd061..d7e3a966579 100644 --- a/mysql-test/suite/funcs_1/include/myisam_tb4.inc +++ b/mysql-test/suite/funcs_1/include/myisam_tb4.inc @@ -63,13 +63,13 @@ f231 VARBINARY(192), f232 VARBINARY(27), f233 VARBINARY(64), f234 VARBINARY(192), -f235 char(255) unicode, +f235 char(255), f236 char(60) ascii, f237 char(255) binary, f238 varchar(0) binary, f239 varbinary(1000), -f240 varchar(120) unicode, -f241 char(100) unicode, +f240 varchar(120), +f241 char(100), f242 bit(30) ) engine = myisam; diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_frkey.result b/mysql-test/suite/funcs_1/r/innodb_trig_frkey.result index fe341762047..019a76b951c 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_frkey.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_frkey.result @@ -1,141 +1,73 @@ -USE test; -drop table if exists tb3 ; -create table tb3 ( -f118 char not null DEFAULT 'a', -f119 char binary not null DEFAULT b'101', -f120 char ascii not null DEFAULT b'101', -f121 tinytext, -f122 text, -f123 mediumtext, -f124 longtext unicode, -f125 tinyblob, -f126 blob, -f127 mediumblob, -f128 longblob, -f129 binary not null DEFAULT b'101', -f130 tinyint not null DEFAULT 99, -f131 tinyint unsigned not null DEFAULT 99, -f132 tinyint zerofill not null DEFAULT 99, -f133 tinyint unsigned zerofill not null DEFAULT 99, -f134 smallint not null DEFAULT 999, -f135 smallint unsigned not null DEFAULT 999, -f136 smallint zerofill not null DEFAULT 999, -f137 smallint unsigned zerofill not null DEFAULT 999, -f138 mediumint not null DEFAULT 9999, -f139 mediumint unsigned not null DEFAULT 9999, -f140 mediumint zerofill not null DEFAULT 9999, -f141 mediumint unsigned zerofill not null DEFAULT 9999, -f142 int not null DEFAULT 99999, -f143 int unsigned not null DEFAULT 99999, -f144 int zerofill not null DEFAULT 99999, -f145 int unsigned zerofill not null DEFAULT 99999, -f146 bigint not null DEFAULT 999999, -f147 bigint unsigned not null DEFAULT 999999, -f148 bigint zerofill not null DEFAULT 999999, -f149 bigint unsigned zerofill not null DEFAULT 999999, -f150 decimal not null DEFAULT 999.999, -f151 decimal unsigned not null DEFAULT 999.17, -f152 decimal zerofill not null DEFAULT 999.999, -f153 decimal unsigned zerofill, -f154 decimal (0), -f155 decimal (64), -f156 decimal (0) unsigned, -f157 decimal (64) unsigned, -f158 decimal (0) zerofill, -f159 decimal (64) zerofill, -f160 decimal (0) unsigned zerofill, -f161 decimal (64) unsigned zerofill, -f162 decimal (0,0), -f163 decimal (63,30), -f164 decimal (0,0) unsigned, -f165 decimal (63,30) unsigned, -f166 decimal (0,0) zerofill, -f167 decimal (63,30) zerofill, -f168 decimal (0,0) unsigned zerofill, -f169 decimal (63,30) unsigned zerofill, -f170 numeric, -f171 numeric unsigned, -f172 numeric zerofill, -f173 numeric unsigned zerofill, -f174 numeric (0), -f175 numeric (64) -) engine = innodb; -Warnings: -Note 1265 Data truncated for column 'f150' at row 1 -Note 1265 Data truncated for column 'f151' at row 1 -Note 1265 Data truncated for column 'f152' at row 1 -load data infile '/std_data_ln/funcs_1/innodb_tb3.txt' -into table tb3; Testcase x.x.x.1: ----------------- DROP TABLE IF EXISTS t0, t1, t2; -CREATE TABLE t0 (col1 char(50)) ENGINE=innodb; -CREATE TABLE t1 (id INT NOT NULL, col1 char(50), -PRIMARY KEY (id)) ENGINE=innodb; +CREATE TABLE t0 (col1 CHAR(50)) +ENGINE = ; +CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id)) +ENGINE = ; CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT, -INDEX par_ind (f_id), col1 char(50), -FOREIGN KEY (f_id) REFERENCES t1(id) -ON DELETE SET NULL) ENGINE=innodb; -insert into t1 values (1,'Department A'); -insert into t1 values (2,'Department B'); -insert into t1 values (3,'Department C'); -insert into t2 values (1,2,'Emp 1'); -insert into t2 values (2,2,'Emp 2'); -insert into t2 values (3,2,'Emp 3'); -create trigger trig after insert on t0 for each row -delete from t1 where col1=new.col1; -select * from t2; +INDEX par_ind (f_id), col1 CHAR(50), +FOREIGN KEY (f_id) REFERENCES t1(id) ON DELETE SET NULL) +ENGINE = ; +INSERT INTO t1 VALUES (1,'Department A'); +INSERT INTO t1 VALUES (2,'Department B'); +INSERT INTO t1 VALUES (3,'Department C'); +INSERT INTO t2 VALUES (1,2,'Emp 1'); +INSERT INTO t2 VALUES (2,2,'Emp 2'); +INSERT INTO t2 VALUES (3,2,'Emp 3'); +CREATE TRIGGER trig AFTER INSERT ON t0 FOR EACH ROW +DELETE FROM t1 WHERE col1 = new.col1; +SELECT * FROM t2; id f_id col1 1 2 Emp 1 2 2 Emp 2 3 2 Emp 3 -lock tables t0 write, t1 write; -insert into t0 values ('Department B'); -unlock tables; -select * from t2; +LOCK TABLES t0 WRITE, t1 WRITE; +INSERT INTO t0 VALUES ('Department B'); +UNLOCK TABLES; +SELECT * FROM t2; id f_id col1 1 NULL Emp 1 2 NULL Emp 2 3 NULL Emp 3 -drop trigger trig; -drop table t2, t1; +DROP TRIGGER trig; +DROP TABLE t2, t1; Testcase x.x.x.2: ----------------- DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 (id INT NOT NULL, col1 char(50), -PRIMARY KEY (id)) ENGINE=innodb; +CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id)) +ENGINE = ; CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT, -INDEX par_ind (f_id), col1 char(50), -FOREIGN KEY (f_id) REFERENCES t1(id) -ON UPDATE CASCADE) ENGINE=innodb; -insert into t1 values (1,'Department A'); -insert into t1 values (2,'Department B'); -insert into t1 values (3,'Department C'); -insert into t2 values (1,2,'Emp 1'); -insert into t2 values (2,3,'Emp 2'); -insert into t2 values (3,4,'Emp 3'); +INDEX par_ind (f_id), col1 CHAR(50), +FOREIGN KEY (f_id) REFERENCES t1(id) ON UPDATE CASCADE) +ENGINE = ; +INSERT INTO t1 VALUES (1,'Department A'); +INSERT INTO t1 VALUES (2,'Department B'); +INSERT INTO t1 VALUES (3,'Department C'); +INSERT INTO t2 VALUES (1,2,'Emp 1'); +INSERT INTO t2 VALUES (2,3,'Emp 2'); +insert into t2 VALUES (3,4,'Emp 3'); ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE) -create trigger tr_t2 before insert on t2 for each row -insert into t1 values(new.f_id, concat('New Department ', new.f_id)); -lock tables t1 write, t2 write; -insert into t2 values (3,4,'Emp 3'); -unlock tables; -select * from t1; +CREATE TRIGGER tr_t2 BEFORE INSERT ON t2 FOR EACH ROW +INSERT INTO t1 VALUES(new.f_id, CONCAT('New Department ', new.f_id)); +LOCK TABLES t1 WRITE, t2 WRITE; +INSERT INTO t2 VALUES (3,4,'Emp 3'); +UNLOCK TABLES; +SELECT * FROM t1; id col1 1 Department A 2 Department B 3 Department C 4 New Department 4 -select * from t2; +SELECT * FROM t2; id f_id col1 1 2 Emp 1 2 3 Emp 2 3 4 Emp 3 -drop trigger tr_t2; -drop table t2, t1, t0; +DROP TRIGGER tr_t2; +DROP TABLE t2, t1, t0; Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test) ------------------------------------------------------------------- -DROP TABLE test.tb3; diff --git a/mysql-test/suite/funcs_1/r/is_cml_innodb.result b/mysql-test/suite/funcs_1/r/is_cml_innodb.result new file mode 100644 index 00000000000..7c214cb770f --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_cml_innodb.result @@ -0,0 +1,97 @@ +USE test; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 +( +f1 CHAR UNICODE, +f2 CHAR(0) UNICODE, +f3 CHAR(10) UNICODE, +f5 VARCHAR(0) UNICODE, +f6 VARCHAR(255) UNICODE, +f7 VARCHAR(260) UNICODE, +f8 TEXT UNICODE, +f9 TINYTEXT UNICODE, +f10 MEDIUMTEXT UNICODE, +f11 LONGTEXT UNICODE +) ENGINE = InnoDB; +SELECT * FROM information_schema.columns +WHERE table_schema LIKE 'test%' +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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references +NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references +NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references +NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references +NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references +NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references +NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references +NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references +NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references +NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references +########################################################################## +# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH +########################################################################## +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +2.0000 char ucs2 ucs2_general_ci +2.0000 longtext ucs2 ucs2_general_ci +2.0000 mediumtext ucs2 ucs2_general_ci +2.0000 text ucs2 ucs2_general_ci +2.0000 varchar ucs2 ucs2_general_ci +2.0079 tinytext ucs2 ucs2_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +NULL char ucs2 ucs2_general_ci +NULL varchar ucs2 ucs2_general_ci +--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values +--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL +SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +TABLE_SCHEMA, +TABLE_NAME, +COLUMN_NAME, +DATA_TYPE, +CHARACTER_MAXIMUM_LENGTH, +CHARACTER_OCTET_LENGTH, +CHARACTER_SET_NAME, +COLLATION_NAME, +COLUMN_TYPE +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; +COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1) +NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0) +2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10) +NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0) +2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255) +2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260) +2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text +2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext +2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext +2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/r/is_cml_memory.result b/mysql-test/suite/funcs_1/r/is_cml_memory.result new file mode 100644 index 00000000000..fe4b018cec3 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_cml_memory.result @@ -0,0 +1,82 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +USE test; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 +( +f1 CHAR UNICODE, +f2 CHAR(0) UNICODE, +f3 CHAR(10) UNICODE, +f5 VARCHAR(0) UNICODE, +f6 VARCHAR(255) UNICODE, +f7 VARCHAR(260) UNICODE +) ENGINE = MEMORY; +SELECT * FROM information_schema.columns +WHERE table_schema LIKE 'test%' +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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references +NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references +NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references +NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references +NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references +NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references +########################################################################## +# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH +########################################################################## +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +2.0000 char ucs2 ucs2_general_ci +2.0000 varchar ucs2 ucs2_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +NULL char ucs2 ucs2_general_ci +NULL varchar ucs2 ucs2_general_ci +--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values +--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL +SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +TABLE_SCHEMA, +TABLE_NAME, +COLUMN_NAME, +DATA_TYPE, +CHARACTER_MAXIMUM_LENGTH, +CHARACTER_OCTET_LENGTH, +CHARACTER_SET_NAME, +COLLATION_NAME, +COLUMN_TYPE +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; +COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1) +NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0) +2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10) +NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0) +2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255) +2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260) +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/r/is_cml_myisam.result b/mysql-test/suite/funcs_1/r/is_cml_myisam.result new file mode 100644 index 00000000000..9808b1c1793 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_cml_myisam.result @@ -0,0 +1,98 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +USE test; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 +( +f1 CHAR UNICODE, +f2 CHAR(0) UNICODE, +f3 CHAR(10) UNICODE, +f5 VARCHAR(0) UNICODE, +f6 VARCHAR(255) UNICODE, +f7 VARCHAR(260) UNICODE, +f8 TEXT UNICODE, +f9 TINYTEXT UNICODE, +f10 MEDIUMTEXT UNICODE, +f11 LONGTEXT UNICODE +) ENGINE = MyISAM; +SELECT * FROM information_schema.columns +WHERE table_schema LIKE 'test%' +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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references +NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references +NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references +NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references +NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references +NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references +NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references +NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references +NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references +NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references +########################################################################## +# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH +########################################################################## +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +2.0000 char ucs2 ucs2_general_ci +2.0000 longtext ucs2 ucs2_general_ci +2.0000 mediumtext ucs2 ucs2_general_ci +2.0000 text ucs2 ucs2_general_ci +2.0000 varchar ucs2 ucs2_general_ci +2.0079 tinytext ucs2 ucs2_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +NULL char ucs2 ucs2_general_ci +NULL varchar ucs2 ucs2_general_ci +--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values +--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL +SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +TABLE_SCHEMA, +TABLE_NAME, +COLUMN_NAME, +DATA_TYPE, +CHARACTER_MAXIMUM_LENGTH, +CHARACTER_OCTET_LENGTH, +CHARACTER_SET_NAME, +COLLATION_NAME, +COLUMN_TYPE +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; +COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1) +NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0) +2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10) +NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0) +2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255) +2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260) +2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text +2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext +2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext +2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/r/is_cml_ndb.result b/mysql-test/suite/funcs_1/r/is_cml_ndb.result new file mode 100644 index 00000000000..ba6a0589ae0 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_cml_ndb.result @@ -0,0 +1,97 @@ +USE test; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 +( +f1 CHAR UNICODE, +f2 CHAR(0) UNICODE, +f3 CHAR(10) UNICODE, +f5 VARCHAR(0) UNICODE, +f6 VARCHAR(255) UNICODE, +f7 VARCHAR(260) UNICODE, +f8 TEXT UNICODE, +f9 TINYTEXT UNICODE, +f10 MEDIUMTEXT UNICODE, +f11 LONGTEXT UNICODE +) ENGINE = NDB; +SELECT * FROM information_schema.columns +WHERE table_schema LIKE 'test%' +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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references +NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references +NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references +NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references +NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references +NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references +NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references +NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references +NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references +NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references +########################################################################## +# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH +########################################################################## +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +2.0000 char ucs2 ucs2_general_ci +2.0000 longtext ucs2 ucs2_general_ci +2.0000 mediumtext ucs2 ucs2_general_ci +2.0000 text ucs2 ucs2_general_ci +2.0000 varchar ucs2 ucs2_general_ci +2.0079 tinytext ucs2 ucs2_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +NULL char ucs2 ucs2_general_ci +NULL varchar ucs2 ucs2_general_ci +--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values +--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL +SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +TABLE_SCHEMA, +TABLE_NAME, +COLUMN_NAME, +DATA_TYPE, +CHARACTER_MAXIMUM_LENGTH, +CHARACTER_OCTET_LENGTH, +CHARACTER_SET_NAME, +COLLATION_NAME, +COLUMN_TYPE +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; +COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1) +NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0) +2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10) +NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0) +2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255) +2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260) +2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text +2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext +2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext +2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result index d80ab62a987..aaeb58a3475 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result +++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result @@ -6,7 +6,7 @@ create table tb1 ( f1 char(0), f2 char(0) binary, f3 char(0) ascii, -f4 tinytext unicode, +f4 tinytext, f5 text, f6 mediumtext, f7 longtext, @@ -142,7 +142,7 @@ f120 char ascii not null DEFAULT b'101', f121 tinytext, f122 text, f123 mediumtext, -f124 longtext unicode, +f124 longtext, f125 tinyblob, f126 blob, f127 mediumblob, @@ -254,13 +254,13 @@ f223 year(3), f224 year(4), f225 enum("1enum","2enum"), f226 set("1set","2set"), -f235 char(0) unicode, +f235 char(0), f236 char(90), f237 char(255) ascii, f238 varchar(0), f239 varchar(20000) binary, -f240 varchar(2000) unicode, -f241 char(100) unicode +f240 varchar(2000), +f241 char(100) ) engine = innodb; load data infile '/std_data_ln/funcs_1/innodb_tb4.txt' into table tb4; @@ -460,7 +460,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0 NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references -NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references +NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references @@ -542,7 +542,7 @@ NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references -NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references +NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references @@ -645,13 +645,13 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references -NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references +NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NULL test tb4 f236 53 NULL YES char 90 90 NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references NULL test tb4 f237 54 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NULL test tb4 f238 55 NULL YES varchar 0 0 NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references NULL test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references -NULL test tb4 f240 57 NULL YES varchar 2000 4000 NULL NULL ucs2 ucs2_general_ci varchar(2000) select,insert,update,references -NULL test tb4 f241 58 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references +NULL test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references +NULL test tb4 f241 58 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references @@ -736,6 +736,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 1.0000 set latin1 latin1_swedish_ci 1.0000 text latin1 latin1_swedish_ci 1.0000 tinytext latin1 latin1_swedish_ci +1.0000 varchar latin1 latin1_swedish_ci SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -746,10 +747,6 @@ WHERE table_schema LIKE 'test%' AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME -2.0000 char ucs2 ucs2_general_ci -2.0000 longtext ucs2 ucs2_general_ci -2.0000 varchar ucs2 ucs2_general_ci -2.0079 tinytext ucs2 ucs2_general_ci SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -780,7 +777,6 @@ NULL year NULL NULL NULL char latin1 latin1_bin NULL char latin1 latin1_swedish_ci NULL varchar latin1 latin1_swedish_ci -NULL char ucs2 ucs2_general_ci --> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, @@ -844,7 +840,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11) NULL test tb1 f1 char 0 0 latin1 latin1_swedish_ci char(0) NULL test tb1 f2 char 0 0 latin1 latin1_bin char(0) NULL test tb1 f3 char 0 0 latin1 latin1_swedish_ci char(0) -2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext +1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext 1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text 1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext 1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext @@ -956,7 +952,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4) 1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext 1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text 1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext -2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext +1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext 1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob 1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob 1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob @@ -1059,13 +1055,13 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4) NULL test tb4 f224 year NULL NULL NULL NULL year(4) 1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set') -NULL test tb4 f235 char 0 0 ucs2 ucs2_general_ci char(0) +NULL test tb4 f235 char 0 0 latin1 latin1_swedish_ci char(0) 1.0000 test tb4 f236 char 90 90 latin1 latin1_swedish_ci char(90) 1.0000 test tb4 f237 char 255 255 latin1 latin1_swedish_ci char(255) NULL test tb4 f238 varchar 0 0 latin1 latin1_swedish_ci varchar(0) 1.0000 test tb4 f239 varchar 20000 20000 latin1 latin1_bin varchar(20000) -2.0000 test tb4 f240 varchar 2000 4000 ucs2 ucs2_general_ci varchar(2000) -2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100) +1.0000 test tb4 f240 varchar 2000 2000 latin1 latin1_swedish_ci varchar(2000) +1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100) NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill 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 new file mode 100644 index 00000000000..6ad08c11c19 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -0,0 +1,380 @@ +SELECT * FROM information_schema.columns +WHERE table_schema = 'information_schema' +AND table_name <> 'profiling' +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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60) +NULL information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) +NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) +NULL information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) +NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) +NULL information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) +NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) +NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) +NULL information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) +NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10) +NULL information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime +NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) +NULL information_schema ROUTINES DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES EXTERNAL_NAME 9 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime +NULL information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) +NULL information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) +NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) +NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) +NULL information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) +NULL information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1) +NULL information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) +NULL information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) +NULL information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) +NULL information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) +NULL information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2) +NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3) +NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime +NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) +NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime +NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) +NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) +NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime +NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) +NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) +NULL information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) +NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) +NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) +NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime +NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) +NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) +NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) +NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) +NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) +NULL information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) +NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) +NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) +NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext +########################################################################## +# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH +########################################################################## +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema = 'information_schema' +AND table_name <> 'profiling' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +1.0000 longtext utf8 utf8_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema = 'information_schema' +AND table_name <> 'profiling' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +3.0000 varchar utf8 utf8_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema = 'information_schema' +AND table_name <> 'profiling' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +NULL bigint NULL NULL +NULL datetime NULL NULL +--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values +--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL +SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +TABLE_SCHEMA, +TABLE_NAME, +COLUMN_NAME, +DATA_TYPE, +CHARACTER_MAXIMUM_LENGTH, +CHARACTER_OCTET_LENGTH, +CHARACTER_SET_NAME, +COLLATION_NAME, +COLUMN_TYPE +FROM information_schema.columns +WHERE table_schema = 'information_schema' +AND table_name <> 'profiling' +ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; +COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60) +NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(3) +3.0000 information_schema COLLATIONS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11) +3.0000 information_schema COLLATIONS IS_DEFAULT varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema COLLATIONS IS_COMPILED varchar 3 9 utf8 utf8_general_ci varchar(3) +NULL information_schema COLLATIONS SORTLEN bigint NULL NULL NULL NULL bigint(3) +3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMNS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema COLUMNS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMNS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMNS COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(21) +1.0000 information_schema COLUMNS COLUMN_DEFAULT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema COLUMNS IS_NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema COLUMNS DATA_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH bigint NULL NULL NULL NULL bigint(21) +NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH bigint NULL NULL NULL NULL bigint(21) +NULL information_schema COLUMNS NUMERIC_PRECISION bigint NULL NULL NULL NULL bigint(21) +NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(21) +3.0000 information_schema COLUMNS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMNS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +1.0000 information_schema COLUMNS COLUMN_TYPE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema COLUMNS EXTRA varchar 20 60 utf8 utf8_general_ci varchar(20) +3.0000 information_schema COLUMNS PRIVILEGES varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 255 765 utf8 utf8_general_ci varchar(255) +3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81) +3.0000 information_schema COLUMN_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema COLUMN_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMN_PRIVILEGES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMN_PRIVILEGES COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema COLUMN_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema KEY_COLUMN_USAGE TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema KEY_COLUMN_USAGE TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema KEY_COLUMN_USAGE TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema KEY_COLUMN_USAGE COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(10) +NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT bigint NULL NULL NULL NULL bigint(10) +3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES SPECIFIC_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES ROUTINE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema ROUTINES ROUTINE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES ROUTINE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES ROUTINE_TYPE varchar 9 27 utf8 utf8_general_ci varchar(9) +3.0000 information_schema ROUTINES DTD_IDENTIFIER varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES ROUTINE_BODY varchar 8 24 utf8 utf8_general_ci varchar(8) +1.0000 information_schema ROUTINES ROUTINE_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema ROUTINES EXTERNAL_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES EXTERNAL_LANGUAGE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES PARAMETER_STYLE varchar 8 24 utf8 utf8_general_ci varchar(8) +3.0000 information_schema ROUTINES IS_DETERMINISTIC varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema ROUTINES SQL_DATA_ACCESS varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES SQL_PATH varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7) +NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime +NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime +1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema SCHEMATA CATALOG_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema SCHEMATA SQL_PATH varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema SCHEMA_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81) +3.0000 information_schema SCHEMA_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema STATISTICS NON_UNIQUE bigint NULL NULL NULL NULL bigint(1) +3.0000 information_schema STATISTICS INDEX_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema STATISTICS INDEX_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema STATISTICS SEQ_IN_INDEX bigint NULL NULL NULL NULL bigint(2) +3.0000 information_schema STATISTICS COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema STATISTICS COLLATION varchar 1 3 utf8 utf8_general_ci varchar(1) +NULL information_schema STATISTICS CARDINALITY bigint NULL NULL NULL NULL bigint(21) +NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3) +3.0000 information_schema STATISTICS PACKED varchar 10 30 utf8 utf8_general_ci varchar(10) +3.0000 information_schema STATISTICS NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16) +3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16) +3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLES TABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES VERSION bigint NULL NULL NULL NULL bigint(21) +3.0000 information_schema TABLES ROW_FORMAT varchar 10 30 utf8 utf8_general_ci varchar(10) +NULL information_schema TABLES TABLE_ROWS bigint NULL NULL NULL NULL bigint(21) +NULL information_schema TABLES AVG_ROW_LENGTH bigint NULL NULL NULL NULL bigint(21) +NULL information_schema TABLES DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) +NULL information_schema TABLES MAX_DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) +NULL information_schema TABLES INDEX_LENGTH bigint NULL NULL NULL NULL bigint(21) +NULL information_schema TABLES DATA_FREE bigint NULL NULL NULL NULL bigint(21) +NULL information_schema TABLES AUTO_INCREMENT bigint NULL NULL NULL NULL bigint(21) +NULL information_schema TABLES CREATE_TIME datetime NULL NULL NULL NULL datetime +NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime +NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime +3.0000 information_schema TABLES TABLE_COLLATION varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) +3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255) +3.0000 information_schema TABLES TABLE_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_CONSTRAINTS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81) +3.0000 information_schema TABLE_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema TABLE_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_PRIVILEGES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TABLE_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema TRIGGERS TRIGGER_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema TRIGGERS TRIGGER_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TRIGGERS TRIGGER_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TRIGGERS EVENT_MANIPULATION varchar 6 18 utf8 utf8_general_ci varchar(6) +3.0000 information_schema TRIGGERS EVENT_OBJECT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema TRIGGERS EVENT_OBJECT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TRIGGERS EVENT_OBJECT_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64) +NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(4) +1.0000 information_schema TRIGGERS ACTION_CONDITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +1.0000 information_schema TRIGGERS ACTION_STATEMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema TRIGGERS ACTION_ORIENTATION varchar 9 27 utf8 utf8_general_ci varchar(9) +3.0000 information_schema TRIGGERS ACTION_TIMING varchar 6 18 utf8 utf8_general_ci varchar(6) +3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) +NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime +1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema USER_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81) +3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema USER_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema VIEWS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema VIEWS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema VIEWS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8) +3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3) +3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77) +3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7) diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result index ae7c5919447..2a715439e54 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_memory.result +++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result @@ -244,12 +244,12 @@ f223 year(3), f224 year(4), f225 enum("1enum","2enum"), f226 set("1set","2set"), -f236 char(95) unicode, -f241 char(255) unicode, +f236 char(95), +f241 char(255), f237 char(130) binary, f238 varchar(25000) binary, f239 varbinary(0), -f240 varchar(1200) unicode +f240 varchar(1200) ) engine = memory; load data infile '/std_data_ln/funcs_1/memory_tb4.txt' into table tb4; @@ -620,12 +620,12 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references -NULL test tb4 f236 52 NULL YES char 95 190 NULL NULL ucs2 ucs2_general_ci char(95) select,insert,update,references +NULL test tb4 f236 52 NULL YES char 95 95 NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references NULL test tb4 f237 54 NULL YES char 130 130 NULL NULL latin1 latin1_bin char(130) select,insert,update,references NULL test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references NULL test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL varbinary(0) select,insert,update,references -NULL test tb4 f240 57 NULL YES varchar 1200 2400 NULL NULL ucs2 ucs2_general_ci varchar(1200) select,insert,update,references -NULL test tb4 f241 53 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references +NULL test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references +NULL test tb4 f241 53 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references @@ -702,6 +702,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 1.0000 char latin1 latin1_swedish_ci 1.0000 enum latin1 latin1_swedish_ci 1.0000 set latin1 latin1_swedish_ci +1.0000 varchar latin1 latin1_swedish_ci SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -712,8 +713,6 @@ WHERE table_schema LIKE 'test%' AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME -2.0000 char ucs2 ucs2_general_ci -2.0000 varchar ucs2 ucs2_general_ci SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -1006,12 +1005,12 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4) NULL test tb4 f224 year NULL NULL NULL NULL year(4) 1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') 1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set') -2.0000 test tb4 f236 char 95 190 ucs2 ucs2_general_ci char(95) -2.0000 test tb4 f241 char 255 510 ucs2 ucs2_general_ci char(255) +1.0000 test tb4 f236 char 95 95 latin1 latin1_swedish_ci char(95) +1.0000 test tb4 f241 char 255 255 latin1 latin1_swedish_ci char(255) 1.0000 test tb4 f237 char 130 130 latin1 latin1_bin char(130) 1.0000 test tb4 f238 varchar 25000 25000 latin1 latin1_bin varchar(25000) NULL test tb4 f239 varbinary 0 0 NULL NULL varbinary(0) -2.0000 test tb4 f240 varchar 1200 2400 ucs2 ucs2_general_ci varchar(1200) +1.0000 test tb4 f240 varchar 1200 1200 latin1 latin1_swedish_ci varchar(1200) NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result index 94574c33d74..9393d1638bd 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result @@ -7,7 +7,7 @@ create table tb1 ( f1 char, f2 char binary, f3 char ascii, -f4 tinytext unicode, +f4 tinytext, f5 text, f6 mediumtext, f7 longtext, @@ -154,7 +154,7 @@ f120 char ascii not null DEFAULT b'101', f121 tinytext, f122 text, f123 mediumtext, -f124 longtext unicode, +f124 longtext, f125 tinyblob, f126 blob, f127 mediumblob, @@ -274,13 +274,13 @@ f231 VARBINARY(192), f232 VARBINARY(27), f233 VARBINARY(64), f234 VARBINARY(192), -f235 char(255) unicode, +f235 char(255), f236 char(60) ascii, f237 char(255) binary, f238 varchar(0) binary, f239 varbinary(1000), -f240 varchar(120) unicode, -f241 char(100) unicode, +f240 varchar(120), +f241 char(100), f242 bit(30) ) engine = myisam; load data infile '/std_data_ln/funcs_1/myisam_tb4.txt' @@ -489,7 +489,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0 NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references -NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references +NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references @@ -579,7 +579,7 @@ NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references -NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references +NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references @@ -690,13 +690,13 @@ NULL test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(1 NULL test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references NULL test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references NULL test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references -NULL test tb4 f235 60 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references +NULL test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NULL test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references NULL test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255) select,insert,update,references NULL test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references NULL test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000) select,insert,update,references -NULL test tb4 f240 65 NULL YES varchar 120 240 NULL NULL ucs2 ucs2_general_ci varchar(120) select,insert,update,references -NULL test tb4 f241 66 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references +NULL test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references +NULL test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references NULL test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30) select,insert,update,references NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references @@ -790,6 +790,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 1.0000 set latin1 latin1_swedish_ci 1.0000 text latin1 latin1_swedish_ci 1.0000 tinytext latin1 latin1_swedish_ci +1.0000 varchar latin1 latin1_swedish_ci SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -800,10 +801,6 @@ WHERE table_schema LIKE 'test%' AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME -2.0000 char ucs2 ucs2_general_ci -2.0000 longtext ucs2 ucs2_general_ci -2.0000 varchar ucs2 ucs2_general_ci -2.0079 tinytext ucs2 ucs2_general_ci SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -896,7 +893,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11) 1.0000 test tb1 f1 char 1 1 latin1 latin1_swedish_ci char(1) 1.0000 test tb1 f2 char 1 1 latin1 latin1_bin char(1) 1.0000 test tb1 f3 char 1 1 latin1 latin1_swedish_ci char(1) -2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext +1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext 1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text 1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext 1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext @@ -1016,7 +1013,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4) 1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext 1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text 1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext -2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext +1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext 1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob 1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob 1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob @@ -1127,13 +1124,13 @@ NULL test tb4 f224 year NULL NULL NULL NULL year(4) 1.0000 test tb4 f232 varbinary 27 27 NULL NULL varbinary(27) 1.0000 test tb4 f233 varbinary 64 64 NULL NULL varbinary(64) 1.0000 test tb4 f234 varbinary 192 192 NULL NULL varbinary(192) -2.0000 test tb4 f235 char 255 510 ucs2 ucs2_general_ci char(255) +1.0000 test tb4 f235 char 255 255 latin1 latin1_swedish_ci char(255) 1.0000 test tb4 f236 char 60 60 latin1 latin1_swedish_ci char(60) 1.0000 test tb4 f237 char 255 255 latin1 latin1_bin char(255) NULL test tb4 f238 varchar 0 0 latin1 latin1_bin varchar(0) 1.0000 test tb4 f239 varbinary 1000 1000 NULL NULL varbinary(1000) -2.0000 test tb4 f240 varchar 120 240 ucs2 ucs2_general_ci varchar(120) -2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100) +1.0000 test tb4 f240 varchar 120 120 latin1 latin1_swedish_ci varchar(120) +1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100) NULL test tb4 f242 bit NULL NULL NULL NULL bit(30) NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result new file mode 100644 index 00000000000..ffc6683b099 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result @@ -0,0 +1,1214 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +DROP DATABASE IF EXISTS test1; +CREATE DATABASE test1; +USE test; +drop table if exists tb1 ; +create table tb1 ( +f1 char, +f2 char binary, +f3 char ascii, +f4 tinytext, +f5 text, +f6 mediumtext, +f7 longtext, +f8 tinyblob, +f9 blob, +f10 mediumblob, +f11 longblob, +f12 binary, +f13 tinyint, +f14 tinyint unsigned, +f15 tinyint zerofill, +f16 tinyint unsigned zerofill, +f17 smallint, +f18 smallint unsigned, +f19 smallint zerofill, +f20 smallint unsigned zerofill, +f21 mediumint, +f22 mediumint unsigned, +f23 mediumint zerofill, +f24 mediumint unsigned zerofill, +f25 int, +f26 int unsigned, +f27 int zerofill, +f28 int unsigned zerofill, +f29 bigint, +f30 bigint unsigned, +f31 bigint zerofill, +f32 bigint unsigned zerofill, +f33 decimal not null DEFAULT 9.9, +f34 decimal unsigned not null DEFAULT 9.9, +f35 decimal zerofill not null DEFAULT 9.9, +f36 decimal unsigned zerofill not null DEFAULT 9.9, +f37 decimal (0) not null DEFAULT 9.9, +f38 decimal (64) not null DEFAULT 9.9, +f39 decimal (0) unsigned not null DEFAULT 9.9, +f40 decimal (64) unsigned not null DEFAULT 9.9, +f41 decimal (0) zerofill not null DEFAULT 9.9, +f42 decimal (64) zerofill not null DEFAULT 9.9, +f43 decimal (0) unsigned zerofill not null DEFAULT 9.9, +f44 decimal (64) unsigned zerofill not null DEFAULT 9.9, +f45 decimal (0,0) not null DEFAULT 9.9, +f46 decimal (63,30) not null DEFAULT 9.9, +f47 decimal (0,0) unsigned not null DEFAULT 9.9, +f48 decimal (63,30) unsigned not null DEFAULT 9.9, +f49 decimal (0,0) zerofill not null DEFAULT 9.9, +f50 decimal (63,30) zerofill not null DEFAULT 9.9, +f51 decimal (0,0) unsigned zerofill not null DEFAULT 9.9, +f52 decimal (63,30) unsigned zerofill not null DEFAULT 9.9, +f53 numeric not null DEFAULT 99, +f54 numeric unsigned not null DEFAULT 99, +f55 numeric zerofill not null DEFAULT 99, +f56 numeric unsigned zerofill not null DEFAULT 99, +f57 numeric (0) not null DEFAULT 99, +f58 numeric (64) not null DEFAULT 99 +) engine = myisam; +Warnings: +Note 1265 Data truncated for column 'f33' at row 1 +Note 1265 Data truncated for column 'f34' at row 1 +Note 1265 Data truncated for column 'f35' at row 1 +Note 1265 Data truncated for column 'f36' at row 1 +Note 1265 Data truncated for column 'f37' at row 1 +Note 1265 Data truncated for column 'f38' at row 1 +Note 1265 Data truncated for column 'f39' at row 1 +Note 1265 Data truncated for column 'f40' at row 1 +Note 1265 Data truncated for column 'f41' at row 1 +Note 1265 Data truncated for column 'f42' at row 1 +Note 1265 Data truncated for column 'f43' at row 1 +Note 1265 Data truncated for column 'f44' at row 1 +Note 1265 Data truncated for column 'f45' at row 1 +Note 1265 Data truncated for column 'f47' at row 1 +Note 1265 Data truncated for column 'f49' at row 1 +Note 1265 Data truncated for column 'f51' at row 1 +load data infile '/std_data_ln/funcs_1/myisam_tb1.txt' +into table tb1; +drop table if exists tb2 ; +create table tb2 ( +f59 numeric (0) unsigned, +f60 numeric (64) unsigned, +f61 numeric (0) zerofill, +f62 numeric (64) zerofill, +f63 numeric (0) unsigned zerofill, +f64 numeric (64) unsigned zerofill, +f65 numeric (0,0), +f66 numeric (63,30), +f67 numeric (0,0) unsigned, +f68 numeric (63,30) unsigned, +f69 numeric (0,0) zerofill, +f70 numeric (63,30) zerofill, +f71 numeric (0,0) unsigned zerofill, +f72 numeric (63,30) unsigned zerofill, +f73 real, +f74 real unsigned, +f75 real zerofill, +f76 real unsigned zerofill, +f77 double default 7.7, +f78 double unsigned default 7.7, +f79 double zerofill default 7.7, +f80 double unsigned zerofill default 8.8, +f81 float not null default 8.8, +f82 float unsigned not null default 8.8, +f83 float zerofill not null default 8.8, +f84 float unsigned zerofill not null default 8.8, +f85 float(0) not null default 8.8, +f86 float(23) not null default 8.8, +f87 float(0) unsigned not null default 8.8, +f88 float(23) unsigned not null default 8.8, +f89 float(0) zerofill not null default 8.8, +f90 float(23) zerofill not null default 8.8, +f91 float(0) unsigned zerofill not null default 8.8, +f92 float(23) unsigned zerofill not null default 8.8, +f93 float(24) not null default 8.8, +f94 float(53) not null default 8.8, +f95 float(24) unsigned not null default 8.8, +f96 float(53) unsigned not null default 8.8, +f97 float(24) zerofill not null default 8.8, +f98 float(53) zerofill not null default 8.8, +f99 float(24) unsigned zerofill not null default 8.8, +f100 float(53) unsigned zerofill not null default 8.8, +f101 date not null default '2000-01-01', +f102 time not null default 20, +f103 datetime not null default '2/2/2', +f104 timestamp not null default 20001231235959, +f105 year not null default 2000, +f106 year(3) not null default 2000, +f107 year(4) not null default 2000, +f108 enum("1enum","2enum") not null default "1enum", +f109 set("1set","2set") not null default "1set", +f110 VARBINARY(64) null, +f111 VARBINARY(27) null , +f112 VARBINARY(64) null , +f113 VARBINARY(192) null , +f114 VARBINARY(192) , +f115 VARBINARY(27) null , +f116 VARBINARY(64) null, +f117 VARBINARY(192) null +) engine = myisam; +load data infile '/std_data_ln/funcs_1/myisam_tb2.txt' +into table tb2; +drop table if exists tb3 ; +create table tb3 ( +f118 char not null DEFAULT 'a', +f119 char binary not null DEFAULT b'101', +f120 char ascii not null DEFAULT b'101', +f121 tinytext, +f122 text, +f123 mediumtext, +f124 longtext, +f125 tinyblob, +f126 blob, +f127 mediumblob, +f128 longblob, +f129 binary not null DEFAULT b'101', +f130 tinyint not null DEFAULT 99, +f131 tinyint unsigned not null DEFAULT 99, +f132 tinyint zerofill not null DEFAULT 99, +f133 tinyint unsigned zerofill not null DEFAULT 99, +f134 smallint not null DEFAULT 999, +f135 smallint unsigned not null DEFAULT 999, +f136 smallint zerofill not null DEFAULT 999, +f137 smallint unsigned zerofill not null DEFAULT 999, +f138 mediumint not null DEFAULT 9999, +f139 mediumint unsigned not null DEFAULT 9999, +f140 mediumint zerofill not null DEFAULT 9999, +f141 mediumint unsigned zerofill not null DEFAULT 9999, +f142 int not null DEFAULT 99999, +f143 int unsigned not null DEFAULT 99999, +f144 int zerofill not null DEFAULT 99999, +f145 int unsigned zerofill not null DEFAULT 99999, +f146 bigint not null DEFAULT 999999, +f147 bigint unsigned not null DEFAULT 999999, +f148 bigint zerofill not null DEFAULT 999999, +f149 bigint unsigned zerofill not null DEFAULT 999999, +f150 decimal not null DEFAULT 999.999, +f151 decimal unsigned not null DEFAULT 999.17, +f152 decimal zerofill not null DEFAULT 999.999, +f153 decimal unsigned zerofill, +f154 decimal (0), +f155 decimal (64), +f156 decimal (0) unsigned, +f157 decimal (64) unsigned, +f158 decimal (0) zerofill, +f159 decimal (64) zerofill, +f160 decimal (0) unsigned zerofill, +f161 decimal (64) unsigned zerofill, +f162 decimal (0,0), +f163 decimal (63,30), +f164 decimal (0,0) unsigned, +f165 decimal (63,30) unsigned, +f166 decimal (0,0) zerofill, +f167 decimal (63,30) zerofill, +f168 decimal (0,0) unsigned zerofill, +f169 decimal (63,30) unsigned zerofill, +f170 numeric, +f171 numeric unsigned, +f172 numeric zerofill, +f173 numeric unsigned zerofill, +f174 numeric (0), +f175 numeric (64) +) Engine = myisam; +Warnings: +Note 1265 Data truncated for column 'f150' at row 1 +Note 1265 Data truncated for column 'f151' at row 1 +Note 1265 Data truncated for column 'f152' at row 1 +load data infile '/std_data_ln/funcs_1/myisam_tb3.txt' +into table tb3; +drop table if exists tb4 ; +create table tb4 ( +f176 numeric (0) unsigned not null DEFAULT 9, +f177 numeric (64) unsigned not null DEFAULT 9, +f178 numeric (0) zerofill not null DEFAULT 9, +f179 numeric (64) zerofill not null DEFAULT 9, +f180 numeric (0) unsigned zerofill not null DEFAULT 9, +f181 numeric (64) unsigned zerofill not null DEFAULT 9, +f182 numeric (0,0) not null DEFAULT 9, +f183 numeric (63,30) not null DEFAULT 9, +f184 numeric (0,0) unsigned not null DEFAULT 9, +f185 numeric (63,30) unsigned not null DEFAULT 9, +f186 numeric (0,0) zerofill not null DEFAULT 9, +f187 numeric (63,30) zerofill not null DEFAULT 9, +f188 numeric (0,0) unsigned zerofill not null DEFAULT 9, +f189 numeric (63,30) unsigned zerofill not null DEFAULT 9, +f190 real not null DEFAULT 88.8, +f191 real unsigned not null DEFAULT 88.8, +f192 real zerofill not null DEFAULT 88.8, +f193 real unsigned zerofill not null DEFAULT 88.8, +f194 double not null DEFAULT 55.5, +f195 double unsigned not null DEFAULT 55.5, +f196 double zerofill not null DEFAULT 55.5, +f197 double unsigned zerofill not null DEFAULT 55.5, +f198 float, +f199 float unsigned, +f200 float zerofill, +f201 float unsigned zerofill, +f202 float(0), +f203 float(23), +f204 float(0) unsigned, +f205 float(23) unsigned, +f206 float(0) zerofill, +f207 float(23) zerofill, +f208 float(0) unsigned zerofill, +f209 float(23) unsigned zerofill, +f210 float(24), +f211 float(53), +f212 float(24) unsigned, +f213 float(53) unsigned, +f214 float(24) zerofill, +f215 float(53) zerofill, +f216 float(24) unsigned zerofill, +f217 float(53) unsigned zerofill, +f218 date, +f219 time, +f220 datetime, +f221 timestamp, +f222 year, +f223 year(3), +f224 year(4), +f225 enum("1enum","2enum"), +f226 set("1set","2set"), +f227 VARBINARY(64), +f228 VARBINARY(27), +f229 VARBINARY(64), +f230 VARBINARY(192), +f231 VARBINARY(192), +f232 VARBINARY(27), +f233 VARBINARY(64), +f234 VARBINARY(192), +f235 char(255), +f236 char(60) ascii, +f237 char(255) binary, +f238 varchar(0) binary, +f239 varbinary(1000), +f240 varchar(120), +f241 char(100), +f242 bit(30) +) engine = myisam; +load data infile '/std_data_ln/funcs_1/myisam_tb4.txt' +into table tb4; +USE test1; +drop table if exists tb2 ; +create table tb2 ( +f59 numeric (0) unsigned, +f60 numeric (64) unsigned, +f61 numeric (0) zerofill, +f62 numeric (64) zerofill, +f63 numeric (0) unsigned zerofill, +f64 numeric (64) unsigned zerofill, +f65 numeric (0,0), +f66 numeric (63,30), +f67 numeric (0,0) unsigned, +f68 numeric (63,30) unsigned, +f69 numeric (0,0) zerofill, +f70 numeric (63,30) zerofill, +f71 numeric (0,0) unsigned zerofill, +f72 numeric (63,30) unsigned zerofill, +f73 real, +f74 real unsigned, +f75 real zerofill, +f76 real unsigned zerofill, +f77 double default 7.7, +f78 double unsigned default 7.7, +f79 double zerofill default 7.7, +f80 double unsigned zerofill default 8.8, +f81 float not null default 8.8, +f82 float unsigned not null default 8.8, +f83 float zerofill not null default 8.8, +f84 float unsigned zerofill not null default 8.8, +f85 float(0) not null default 8.8, +f86 float(23) not null default 8.8, +f87 float(0) unsigned not null default 8.8, +f88 float(23) unsigned not null default 8.8, +f89 float(0) zerofill not null default 8.8, +f90 float(23) zerofill not null default 8.8, +f91 float(0) unsigned zerofill not null default 8.8, +f92 float(23) unsigned zerofill not null default 8.8, +f93 float(24) not null default 8.8, +f94 float(53) not null default 8.8, +f95 float(24) unsigned not null default 8.8, +f96 float(53) unsigned not null default 8.8, +f97 float(24) zerofill not null default 8.8, +f98 float(53) zerofill not null default 8.8, +f99 float(24) unsigned zerofill not null default 8.8, +f100 float(53) unsigned zerofill not null default 8.8, +f101 date not null default '2000-01-01', +f102 time not null default 20, +f103 datetime not null default '2/2/2', +f104 timestamp not null default 20001231235959, +f105 year not null default 2000, +f106 year(3) not null default 2000, +f107 year(4) not null default 2000, +f108 enum("1enum","2enum") not null default "1enum", +f109 set("1set","2set") not null default "1set", +f110 VARBINARY(64) null, +f111 VARBINARY(27) null , +f112 VARBINARY(64) null , +f113 VARBINARY(192) null , +f114 VARBINARY(192) , +f115 VARBINARY(27) null , +f116 VARBINARY(64) null, +f117 VARBINARY(192) null +) engine = myisam; +load data infile '/std_data_ln/funcs_1/myisam_tb2.txt' +into table tb2; +USE test; +USE test; +DROP TABLE IF EXISTS t1, t2, t4, t10, t11; +CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) +ENGINE = MyISAM; +CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) +ENGINE = MyISAM; +CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) +ENGINE = MyISAM; +CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) +ENGINE = MyISAM; +CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) +ENGINE = MyISAM; +LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t1; +LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t2; +LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t4; +LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t10; +LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t11; +drop TABLE if exists t3; +CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MyISAM; +LOAD DATA INFILE '/std_data_ln/funcs_1/t3.txt' INTO TABLE t3; +drop database if exists test4; +CREATE database test4; +use test4; +CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) +ENGINE = MyISAM; +LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t6; +use test; +drop TABLE if exists t7, t8; +CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM; +CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM; +LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t7; +Warnings: +Warning 1265 Data truncated for column 'f3' at row 1 +Warning 1265 Data truncated for column 'f3' at row 2 +Warning 1265 Data truncated for column 'f3' at row 3 +Warning 1265 Data truncated for column 'f3' at row 4 +Warning 1265 Data truncated for column 'f3' at row 5 +Warning 1265 Data truncated for column 'f3' at row 6 +Warning 1265 Data truncated for column 'f3' at row 7 +Warning 1265 Data truncated for column 'f3' at row 8 +Warning 1265 Data truncated for column 'f3' at row 9 +Warning 1265 Data truncated for column 'f3' at row 10 +LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t8; +Warnings: +Warning 1265 Data truncated for column 'f3' at row 1 +Warning 1265 Data truncated for column 'f3' at row 2 +Warning 1265 Data truncated for column 'f3' at row 3 +Warning 1265 Data truncated for column 'f3' at row 4 +Warning 1265 Data truncated for column 'f3' at row 5 +Warning 1265 Data truncated for column 'f3' at row 6 +Warning 1265 Data truncated for column 'f3' at row 7 +Warning 1265 Data truncated for column 'f3' at row 8 +Warning 1265 Data truncated for column 'f3' at row 9 +Warning 1265 Data truncated for column 'f3' at row 10 +drop TABLE if exists t9; +CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MyISAM; +LOAD DATA INFILE '/std_data_ln/funcs_1/t9.txt' INTO TABLE t9; +SELECT * FROM information_schema.columns +WHERE table_schema LIKE 'test%' +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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +NULL test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test tb1 f1 1 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) +NULL test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob +NULL test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob +NULL test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL binary(1) +NULL test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(4) +NULL test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned +NULL test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill +NULL test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill +NULL test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(6) +NULL test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned +NULL test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill +NULL test tb1 f2 2 NULL YES char 1 1 NULL NULL latin1 latin1_bin char(1) +NULL test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill +NULL test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(9) +NULL test tb1 f22 22 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned +NULL test tb1 f23 23 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill +NULL test tb1 f24 24 NULL YES mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill +NULL test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned +NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill +NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill +NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) +NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) +NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned +NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) +NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext +NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned +NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) +NULL test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned +NULL test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f5 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text +NULL test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) +NULL test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext +NULL test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext +NULL test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob +NULL test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob +NULL test tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date +NULL test tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time +NULL test tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime +NULL test tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) +NULL test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) +NULL test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) +NULL test tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') +NULL test tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') +NULL test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) +NULL test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) +NULL test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned +NULL test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) +NULL test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned +NULL test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double +NULL test tb2 f74 16 NULL YES double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test tb2 f75 17 NULL YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb2 f76 18 NULL YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double +NULL test tb2 f78 20 7.7 YES double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test tb2 f79 21 00000000000000000007.7 YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb2 f80 22 00000000000000000008.8 YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test tb2 f82 24 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb2 f83 25 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb2 f84 26 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test tb2 f87 29 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb2 f88 30 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb2 f89 31 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb2 f90 32 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb2 f91 33 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb2 f92 34 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double +NULL test tb2 f95 37 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb2 f96 38 8.8 NO double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test tb2 f97 39 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb2 f98 40 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb2 f99 41 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb3 f118 1 a NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) +NULL test tb3 f119 2  NO char 1 1 NULL NULL latin1 latin1_bin char(1) +NULL test tb3 f120 3  NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) +NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext +NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text +NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext +NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext +NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob +NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob +NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob +NULL test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob +NULL test tb3 f129 12  NO binary 1 1 NULL NULL NULL NULL binary(1) +NULL test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(4) +NULL test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned +NULL test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill +NULL test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned zerofill +NULL test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL smallint(6) +NULL test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned +NULL test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill +NULL test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned zerofill +NULL test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(9) +NULL test tb3 f139 22 9999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned +NULL test tb3 f140 23 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill +NULL test tb3 f141 24 00009999 NO mediumint NULL NULL 7 0 NULL NULL mediumint(8) unsigned zerofill +NULL test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL int(11) +NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned +NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill +NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill +NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) +NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned +NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) +NULL test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned +NULL test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) +NULL test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned +NULL test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) +NULL test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned +NULL test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) +NULL test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned +NULL test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL double +NULL test tb4 f191 16 88.8 NO double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test tb4 f192 17 00000000000000000088.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb4 f193 18 00000000000000000088.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL double +NULL test tb4 f195 20 55.5 NO double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test tb4 f196 21 00000000000000000055.5 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb4 f197 22 00000000000000000055.5 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL float +NULL test tb4 f199 24 NULL YES float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb4 f200 25 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f201 26 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL float +NULL test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL float +NULL test tb4 f204 29 NULL YES float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb4 f205 30 NULL YES float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb4 f206 31 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f207 32 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f208 33 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f209 34 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL float +NULL test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL double +NULL test tb4 f212 37 NULL YES float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test tb4 f213 38 NULL YES double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test tb4 f214 39 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f215 40 NULL YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb4 f216 41 NULL YES float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test tb4 f217 42 NULL YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test tb4 f219 44 NULL YES time NULL NULL NULL NULL NULL NULL time +NULL test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime +NULL test tb4 f221 46 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL year(4) +NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) +NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) +NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') +NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') +NULL test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) +NULL test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) +NULL test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) +NULL test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) +NULL test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255) +NULL test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0) +NULL test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000) +NULL test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120) +NULL test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) +NULL test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30) +NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date +NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time +NULL test1 tb2 f103 45 0002-02-02 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime +NULL test1 tb2 f104 46 2000-12-31 23:59:59 NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL year(4) +NULL test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL year(4) +NULL test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL year(4) +NULL test1 tb2 f108 50 1enum NO enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') +NULL test1 tb2 f109 51 1set NO set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') +NULL test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) +NULL test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) +NULL test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) +NULL test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) +NULL test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned +NULL test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill +NULL test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) +NULL test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) +NULL test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned +NULL test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned +NULL test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL decimal(63,30) unsigned zerofill +NULL test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL double +NULL test1 tb2 f74 16 NULL YES double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test1 tb2 f75 17 NULL YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f76 18 NULL YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL double +NULL test1 tb2 f78 20 7.7 YES double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test1 tb2 f79 21 00000000000000000007.7 YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f80 22 00000000000000000008.8 YES double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test1 tb2 f82 24 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test1 tb2 f83 25 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f84 26 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test1 tb2 f87 29 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test1 tb2 f88 30 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test1 tb2 f89 31 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f90 32 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f91 33 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f92 34 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL float +NULL test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL double +NULL test1 tb2 f95 37 8.8 NO float unsigned NULL NULL 12 NULL NULL NULL float unsigned +NULL test1 tb2 f96 38 8.8 NO double unsigned NULL NULL 22 NULL NULL NULL double unsigned +NULL test1 tb2 f97 39 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f98 40 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f99 41 0000000008.8 NO float unsigned zerofill NULL NULL 12 NULL NULL NULL float unsigned zerofill +NULL test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) +NULL test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date +NULL test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) +NULL test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) +NULL test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) +########################################################################## +# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH +########################################################################## +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +1.0000 binary NULL NULL +1.0000 blob NULL NULL +1.0000 longblob NULL NULL +1.0000 mediumblob NULL NULL +1.0000 tinyblob NULL NULL +1.0000 varbinary NULL NULL +1.0000 char latin1 latin1_bin +1.0000 char latin1 latin1_swedish_ci +1.0000 enum latin1 latin1_swedish_ci +1.0000 longtext latin1 latin1_swedish_ci +1.0000 mediumtext latin1 latin1_swedish_ci +1.0000 set latin1 latin1_swedish_ci +1.0000 text latin1 latin1_swedish_ci +1.0000 tinytext latin1 latin1_swedish_ci +1.0000 varchar latin1 latin1_swedish_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +NULL bigint NULL NULL +NULL bit NULL NULL +NULL date NULL NULL +NULL datetime NULL NULL +NULL decimal NULL NULL +NULL double NULL NULL +NULL double unsigned NULL NULL +NULL double unsigned zerofill NULL NULL +NULL float NULL NULL +NULL float unsigned NULL NULL +NULL float unsigned zerofill NULL NULL +NULL int NULL NULL +NULL mediumint NULL NULL +NULL smallint NULL NULL +NULL time NULL NULL +NULL timestamp NULL NULL +NULL tinyint NULL NULL +NULL year NULL NULL +NULL varchar latin1 latin1_bin +--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values +--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL +SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +TABLE_SCHEMA, +TABLE_NAME, +COLUMN_NAME, +DATA_TYPE, +CHARACTER_MAXIMUM_LENGTH, +CHARACTER_OCTET_LENGTH, +CHARACTER_SET_NAME, +COLLATION_NAME, +COLUMN_TYPE +FROM information_schema.columns +WHERE table_schema LIKE 'test%' +ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; +COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +1.0000 test t1 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t1 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t1 f3 date NULL NULL NULL NULL date +NULL test t1 f4 int NULL NULL NULL NULL int(11) +1.0000 test t1 f5 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t1 f6 int NULL NULL NULL NULL int(11) +1.0000 test t10 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t10 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t10 f3 date NULL NULL NULL NULL date +NULL test t10 f4 int NULL NULL NULL NULL int(11) +1.0000 test t10 f5 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t10 f6 int NULL NULL NULL NULL int(11) +1.0000 test t11 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t11 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t11 f3 date NULL NULL NULL NULL date +NULL test t11 f4 int NULL NULL NULL NULL int(11) +1.0000 test t11 f5 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t11 f6 int NULL NULL NULL NULL int(11) +1.0000 test t2 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t2 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t2 f3 date NULL NULL NULL NULL date +NULL test t2 f4 int NULL NULL NULL NULL int(11) +1.0000 test t2 f5 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t2 f6 int NULL NULL NULL NULL int(11) +1.0000 test t3 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t3 f2 char 20 20 latin1 latin1_swedish_ci char(20) +NULL test t3 f3 int NULL NULL NULL NULL int(11) +1.0000 test t4 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t4 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t4 f3 date NULL NULL NULL NULL date +NULL test t4 f4 int NULL NULL NULL NULL int(11) +1.0000 test t4 f5 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t4 f6 int NULL NULL NULL NULL int(11) +1.0000 test t7 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t7 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t7 f3 date NULL NULL NULL NULL date +NULL test t7 f4 int NULL NULL NULL NULL int(11) +1.0000 test t8 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test t8 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t8 f3 date NULL NULL NULL NULL date +NULL test t8 f4 int NULL NULL NULL NULL int(11) +NULL test t9 f1 int NULL NULL NULL NULL int(11) +1.0000 test t9 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test t9 f3 int NULL NULL NULL NULL int(11) +1.0000 test tb1 f1 char 1 1 latin1 latin1_swedish_ci char(1) +1.0000 test tb1 f2 char 1 1 latin1 latin1_bin char(1) +1.0000 test tb1 f3 char 1 1 latin1 latin1_swedish_ci char(1) +1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext +1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text +1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext +1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext +1.0000 test tb1 f8 tinyblob 255 255 NULL NULL tinyblob +1.0000 test tb1 f9 blob 65535 65535 NULL NULL blob +1.0000 test tb1 f10 mediumblob 16777215 16777215 NULL NULL mediumblob +1.0000 test tb1 f11 longblob 4294967295 4294967295 NULL NULL longblob +1.0000 test tb1 f12 binary 1 1 NULL NULL binary(1) +NULL test tb1 f13 tinyint NULL NULL NULL NULL tinyint(4) +NULL test tb1 f14 tinyint NULL NULL NULL NULL tinyint(3) unsigned +NULL test tb1 f15 tinyint NULL NULL NULL NULL tinyint(3) unsigned zerofill +NULL test tb1 f16 tinyint NULL NULL NULL NULL tinyint(3) unsigned zerofill +NULL test tb1 f17 smallint NULL NULL NULL NULL smallint(6) +NULL test tb1 f18 smallint NULL NULL NULL NULL smallint(5) unsigned +NULL test tb1 f19 smallint NULL NULL NULL NULL smallint(5) unsigned zerofill +NULL test tb1 f20 smallint NULL NULL NULL NULL smallint(5) unsigned zerofill +NULL test tb1 f21 mediumint NULL NULL NULL NULL mediumint(9) +NULL test tb1 f22 mediumint NULL NULL NULL NULL mediumint(8) unsigned +NULL test tb1 f23 mediumint NULL NULL NULL NULL mediumint(8) unsigned zerofill +NULL test tb1 f24 mediumint NULL NULL NULL NULL mediumint(8) unsigned zerofill +NULL test tb1 f25 int NULL NULL NULL NULL int(11) +NULL test tb1 f26 int NULL NULL NULL NULL int(10) unsigned +NULL test tb1 f27 int NULL NULL NULL NULL int(10) unsigned zerofill +NULL test tb1 f28 int NULL NULL NULL NULL int(10) unsigned zerofill +NULL test tb1 f29 bigint NULL NULL NULL NULL bigint(20) +NULL test tb1 f30 bigint NULL NULL NULL NULL bigint(20) unsigned +NULL test tb1 f31 bigint NULL NULL NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f32 bigint NULL NULL NULL NULL bigint(20) unsigned zerofill +NULL test tb1 f33 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb1 f34 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb1 f35 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f36 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f37 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb1 f38 decimal NULL NULL NULL NULL decimal(64,0) +NULL test tb1 f39 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb1 f40 decimal NULL NULL NULL NULL decimal(64,0) unsigned +NULL test tb1 f41 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f42 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb1 f43 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f44 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb1 f45 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb1 f46 decimal NULL NULL NULL NULL decimal(63,30) +NULL test tb1 f47 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb1 f48 decimal NULL NULL NULL NULL decimal(63,30) unsigned +NULL test tb1 f49 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f50 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb1 f51 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f52 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb1 f53 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb1 f54 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb1 f55 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f56 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb1 f57 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb1 f58 decimal NULL NULL NULL NULL decimal(64,0) +NULL test tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned +NULL test tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f62 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb2 f63 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f64 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb2 f65 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb2 f66 decimal NULL NULL NULL NULL decimal(63,30) +NULL test tb2 f67 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb2 f68 decimal NULL NULL NULL NULL decimal(63,30) unsigned +NULL test tb2 f69 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f70 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb2 f71 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb2 f72 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb2 f73 double NULL NULL NULL NULL double +NULL test tb2 f74 double unsigned NULL NULL NULL NULL double unsigned +NULL test tb2 f75 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb2 f76 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb2 f77 double NULL NULL NULL NULL double +NULL test tb2 f78 double unsigned NULL NULL NULL NULL double unsigned +NULL test tb2 f79 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb2 f80 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb2 f81 float NULL NULL NULL NULL float +NULL test tb2 f82 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb2 f83 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f84 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f85 float NULL NULL NULL NULL float +NULL test tb2 f86 float NULL NULL NULL NULL float +NULL test tb2 f87 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb2 f88 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb2 f89 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f90 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f91 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f92 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f93 float NULL NULL NULL NULL float +NULL test tb2 f94 double NULL NULL NULL NULL double +NULL test tb2 f95 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb2 f96 double unsigned NULL NULL NULL NULL double unsigned +NULL test tb2 f97 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f98 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb2 f99 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb2 f100 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb2 f101 date NULL NULL NULL NULL date +NULL test tb2 f102 time NULL NULL NULL NULL time +NULL test tb2 f103 datetime NULL NULL NULL NULL datetime +NULL test tb2 f104 timestamp NULL NULL NULL NULL timestamp +NULL test tb2 f105 year NULL NULL NULL NULL year(4) +NULL test tb2 f106 year NULL NULL NULL NULL year(4) +NULL test tb2 f107 year NULL NULL NULL NULL year(4) +1.0000 test tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') +1.0000 test tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') +1.0000 test tb2 f110 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test tb2 f111 varbinary 27 27 NULL NULL varbinary(27) +1.0000 test tb2 f112 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test tb2 f113 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test tb2 f114 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test tb2 f115 varbinary 27 27 NULL NULL varbinary(27) +1.0000 test tb2 f116 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test tb2 f117 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test tb3 f118 char 1 1 latin1 latin1_swedish_ci char(1) +1.0000 test tb3 f119 char 1 1 latin1 latin1_bin char(1) +1.0000 test tb3 f120 char 1 1 latin1 latin1_swedish_ci char(1) +1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext +1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text +1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext +1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext +1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob +1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob +1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob +1.0000 test tb3 f128 longblob 4294967295 4294967295 NULL NULL longblob +1.0000 test tb3 f129 binary 1 1 NULL NULL binary(1) +NULL test tb3 f130 tinyint NULL NULL NULL NULL tinyint(4) +NULL test tb3 f131 tinyint NULL NULL NULL NULL tinyint(3) unsigned +NULL test tb3 f132 tinyint NULL NULL NULL NULL tinyint(3) unsigned zerofill +NULL test tb3 f133 tinyint NULL NULL NULL NULL tinyint(3) unsigned zerofill +NULL test tb3 f134 smallint NULL NULL NULL NULL smallint(6) +NULL test tb3 f135 smallint NULL NULL NULL NULL smallint(5) unsigned +NULL test tb3 f136 smallint NULL NULL NULL NULL smallint(5) unsigned zerofill +NULL test tb3 f137 smallint NULL NULL NULL NULL smallint(5) unsigned zerofill +NULL test tb3 f138 mediumint NULL NULL NULL NULL mediumint(9) +NULL test tb3 f139 mediumint NULL NULL NULL NULL mediumint(8) unsigned +NULL test tb3 f140 mediumint NULL NULL NULL NULL mediumint(8) unsigned zerofill +NULL test tb3 f141 mediumint NULL NULL NULL NULL mediumint(8) unsigned zerofill +NULL test tb3 f142 int NULL NULL NULL NULL int(11) +NULL test tb3 f143 int NULL NULL NULL NULL int(10) unsigned +NULL test tb3 f144 int NULL NULL NULL NULL int(10) unsigned zerofill +NULL test tb3 f145 int NULL NULL NULL NULL int(10) unsigned zerofill +NULL test tb3 f146 bigint NULL NULL NULL NULL bigint(20) +NULL test tb3 f147 bigint NULL NULL NULL NULL bigint(20) unsigned +NULL test tb3 f148 bigint NULL NULL NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f149 bigint NULL NULL NULL NULL bigint(20) unsigned zerofill +NULL test tb3 f150 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb3 f151 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb3 f152 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f153 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f154 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb3 f155 decimal NULL NULL NULL NULL decimal(64,0) +NULL test tb3 f156 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb3 f157 decimal NULL NULL NULL NULL decimal(64,0) unsigned +NULL test tb3 f158 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f159 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb3 f160 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f161 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb3 f162 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb3 f163 decimal NULL NULL NULL NULL decimal(63,30) +NULL test tb3 f164 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb3 f165 decimal NULL NULL NULL NULL decimal(63,30) unsigned +NULL test tb3 f166 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f167 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb3 f168 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f169 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb3 f170 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb3 f171 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb3 f172 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f173 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb3 f174 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb3 f175 decimal NULL NULL NULL NULL decimal(64,0) +NULL test tb4 f176 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb4 f177 decimal NULL NULL NULL NULL decimal(64,0) unsigned +NULL test tb4 f178 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f179 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb4 f180 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f181 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test tb4 f182 decimal NULL NULL NULL NULL decimal(10,0) +NULL test tb4 f183 decimal NULL NULL NULL NULL decimal(63,30) +NULL test tb4 f184 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test tb4 f185 decimal NULL NULL NULL NULL decimal(63,30) unsigned +NULL test tb4 f186 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f187 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb4 f188 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test tb4 f189 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test tb4 f190 double NULL NULL NULL NULL double +NULL test tb4 f191 double unsigned NULL NULL NULL NULL double unsigned +NULL test tb4 f192 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb4 f193 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb4 f194 double NULL NULL NULL NULL double +NULL test tb4 f195 double unsigned NULL NULL NULL NULL double unsigned +NULL test tb4 f196 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb4 f197 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb4 f198 float NULL NULL NULL NULL float +NULL test tb4 f199 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb4 f200 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f201 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f202 float NULL NULL NULL NULL float +NULL test tb4 f203 float NULL NULL NULL NULL float +NULL test tb4 f204 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb4 f205 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb4 f206 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f207 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f208 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f209 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f210 float NULL NULL NULL NULL float +NULL test tb4 f211 double NULL NULL NULL NULL double +NULL test tb4 f212 float unsigned NULL NULL NULL NULL float unsigned +NULL test tb4 f213 double unsigned NULL NULL NULL NULL double unsigned +NULL test tb4 f214 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f215 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb4 f216 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test tb4 f217 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test tb4 f218 date NULL NULL NULL NULL date +NULL test tb4 f219 time NULL NULL NULL NULL time +NULL test tb4 f220 datetime NULL NULL NULL NULL datetime +NULL test tb4 f221 timestamp NULL NULL NULL NULL timestamp +NULL test tb4 f222 year NULL NULL NULL NULL year(4) +NULL test tb4 f223 year NULL NULL NULL NULL year(4) +NULL test tb4 f224 year NULL NULL NULL NULL year(4) +1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') +1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set') +1.0000 test tb4 f227 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test tb4 f228 varbinary 27 27 NULL NULL varbinary(27) +1.0000 test tb4 f229 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test tb4 f230 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test tb4 f231 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test tb4 f232 varbinary 27 27 NULL NULL varbinary(27) +1.0000 test tb4 f233 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test tb4 f234 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test tb4 f235 char 255 255 latin1 latin1_swedish_ci char(255) +1.0000 test tb4 f236 char 60 60 latin1 latin1_swedish_ci char(60) +1.0000 test tb4 f237 char 255 255 latin1 latin1_bin char(255) +NULL test tb4 f238 varchar 0 0 latin1 latin1_bin varchar(0) +1.0000 test tb4 f239 varbinary 1000 1000 NULL NULL varbinary(1000) +1.0000 test tb4 f240 varchar 120 120 latin1 latin1_swedish_ci varchar(120) +1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100) +NULL test tb4 f242 bit NULL NULL NULL NULL bit(30) +NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned +NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f62 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test1 tb2 f63 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f64 decimal NULL NULL NULL NULL decimal(64,0) unsigned zerofill +NULL test1 tb2 f65 decimal NULL NULL NULL NULL decimal(10,0) +NULL test1 tb2 f66 decimal NULL NULL NULL NULL decimal(63,30) +NULL test1 tb2 f67 decimal NULL NULL NULL NULL decimal(10,0) unsigned +NULL test1 tb2 f68 decimal NULL NULL NULL NULL decimal(63,30) unsigned +NULL test1 tb2 f69 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f70 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test1 tb2 f71 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill +NULL test1 tb2 f72 decimal NULL NULL NULL NULL decimal(63,30) unsigned zerofill +NULL test1 tb2 f73 double NULL NULL NULL NULL double +NULL test1 tb2 f74 double unsigned NULL NULL NULL NULL double unsigned +NULL test1 tb2 f75 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f76 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f77 double NULL NULL NULL NULL double +NULL test1 tb2 f78 double unsigned NULL NULL NULL NULL double unsigned +NULL test1 tb2 f79 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f80 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f81 float NULL NULL NULL NULL float +NULL test1 tb2 f82 float unsigned NULL NULL NULL NULL float unsigned +NULL test1 tb2 f83 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f84 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f85 float NULL NULL NULL NULL float +NULL test1 tb2 f86 float NULL NULL NULL NULL float +NULL test1 tb2 f87 float unsigned NULL NULL NULL NULL float unsigned +NULL test1 tb2 f88 float unsigned NULL NULL NULL NULL float unsigned +NULL test1 tb2 f89 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f90 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f91 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f92 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f93 float NULL NULL NULL NULL float +NULL test1 tb2 f94 double NULL NULL NULL NULL double +NULL test1 tb2 f95 float unsigned NULL NULL NULL NULL float unsigned +NULL test1 tb2 f96 double unsigned NULL NULL NULL NULL double unsigned +NULL test1 tb2 f97 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f98 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f99 float unsigned zerofill NULL NULL NULL NULL float unsigned zerofill +NULL test1 tb2 f100 double unsigned zerofill NULL NULL NULL NULL double unsigned zerofill +NULL test1 tb2 f101 date NULL NULL NULL NULL date +NULL test1 tb2 f102 time NULL NULL NULL NULL time +NULL test1 tb2 f103 datetime NULL NULL NULL NULL datetime +NULL test1 tb2 f104 timestamp NULL NULL NULL NULL timestamp +NULL test1 tb2 f105 year NULL NULL NULL NULL year(4) +NULL test1 tb2 f106 year NULL NULL NULL NULL year(4) +NULL test1 tb2 f107 year NULL NULL NULL NULL year(4) +1.0000 test1 tb2 f108 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum') +1.0000 test1 tb2 f109 set 9 9 latin1 latin1_swedish_ci set('1set','2set') +1.0000 test1 tb2 f110 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test1 tb2 f111 varbinary 27 27 NULL NULL varbinary(27) +1.0000 test1 tb2 f112 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test1 tb2 f113 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test1 tb2 f114 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test1 tb2 f115 varbinary 27 27 NULL NULL varbinary(27) +1.0000 test1 tb2 f116 varbinary 64 64 NULL NULL varbinary(64) +1.0000 test1 tb2 f117 varbinary 192 192 NULL NULL varbinary(192) +1.0000 test4 t6 f1 char 20 20 latin1 latin1_swedish_ci char(20) +1.0000 test4 t6 f2 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test4 t6 f3 date NULL NULL NULL NULL date +NULL test4 t6 f4 int NULL NULL NULL NULL int(11) +1.0000 test4 t6 f5 char 25 25 latin1 latin1_swedish_ci char(25) +NULL test4 t6 f6 int NULL NULL NULL NULL int(11) +DROP DATABASE test1; +DROP DATABASE test4; +DROP TABLE test.t1; +DROP TABLE test.t2; +DROP TABLE test.t3; +DROP TABLE test.t4; +DROP TABLE test.t7; +DROP TABLE test.t8; +DROP TABLE test.t9; +DROP TABLE test.t10; +DROP TABLE test.t11; +DROP TABLE test.tb1; +DROP TABLE test.tb2; +DROP TABLE test.tb3; +DROP TABLE test.tb4; diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result new file mode 100644 index 00000000000..34a357d5811 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -0,0 +1,361 @@ +SELECT * FROM information_schema.columns +WHERE table_schema = 'mysql' +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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +NULL mysql columns_priv Column_name 5 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') +NULL mysql columns_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql columns_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +NULL mysql columns_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL mysql columns_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +NULL mysql db Alter_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Create_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Create_tmp_table_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Create_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql db Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Execute_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Grant_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +NULL mysql db Index_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Lock_tables_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db References_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Show_view_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql db User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +NULL mysql func dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) +NULL mysql func name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1) +NULL mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('function','aggregate') +NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI +NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI +NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned +NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) +NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI +NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI +NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI +NULL mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI +NULL mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text +NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text +NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned +NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI +NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI +NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) +NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Create_routine_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Create_tmp_table_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Create_view_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql host Delete_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Drop_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Execute_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Grant_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +NULL mysql host Index_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Insert_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Lock_tables_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host References_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob +NULL mysql proc comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) +NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) +NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') +NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('SQL') +NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL mysql proc name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI +NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob +NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) +NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') +NULL mysql proc specific_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) +NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') +NULL mysql proc sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') +NULL mysql proc type 3 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI +NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL +NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') +NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI +NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +NULL mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') +NULL mysql tables_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql tables_priv Grantor 5 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL +NULL mysql tables_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +NULL mysql tables_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI +NULL mysql tables_priv Table_priv 7 NO set 90 270 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') +NULL mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp +NULL mysql tables_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +NULL mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI auto_increment +NULL mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('Y','N') +NULL mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL int(11) +NULL mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI +NULL mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI +NULL mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned +NULL mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI +NULL mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI +NULL mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned +NULL mysql time_zone_transition_type Abbreviation 5 NO char 8 24 NULL NULL utf8 utf8_general_ci char(8) +NULL mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned +NULL mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL int(11) +NULL mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI +NULL mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI +NULL mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Execute_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user File_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Grant_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI +NULL mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user max_connections 36 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned +NULL mysql user max_questions 34 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned +NULL mysql user max_updates 35 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned +NULL mysql user max_user_connections 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned +NULL mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) +NULL mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Repl_client_priv 24 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Repl_slave_priv 23 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user ssl_cipher 31 NULL NO blob 65535 65535 NULL NULL NULL NULL blob +NULL mysql user ssl_type 30 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') +NULL mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') +NULL mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI +NULL mysql user x509_issuer 32 NULL NO blob 65535 65535 NULL NULL NULL NULL blob +NULL mysql user x509_subject 33 NULL NO blob 65535 65535 NULL NULL NULL NULL blob +########################################################################## +# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH +########################################################################## +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema = 'mysql' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +1.0000 blob NULL NULL +1.0000 longblob NULL NULL +1.0000 char latin1 latin1_bin +1.0000 text utf8 utf8_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema = 'mysql' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1 +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +3.0000 char utf8 utf8_bin +3.0000 enum utf8 utf8_bin +3.0000 char utf8 utf8_general_ci +3.0000 enum utf8 utf8_general_ci +3.0000 set utf8 utf8_general_ci +SELECT DISTINCT +CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +DATA_TYPE, +CHARACTER_SET_NAME, +COLLATION_NAME +FROM information_schema.columns +WHERE table_schema = 'mysql' +AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL +ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML; +COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME +NULL bigint NULL NULL +NULL int NULL NULL +NULL smallint NULL NULL +NULL timestamp NULL NULL +NULL tinyint NULL NULL +--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values +--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL +SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, +TABLE_SCHEMA, +TABLE_NAME, +COLUMN_NAME, +DATA_TYPE, +CHARACTER_MAXIMUM_LENGTH, +CHARACTER_OCTET_LENGTH, +CHARACTER_SET_NAME, +COLLATION_NAME, +COLUMN_TYPE +FROM information_schema.columns +WHERE table_schema = 'mysql' +ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; +COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +3.0000 mysql columns_priv Host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql columns_priv Db char 64 192 utf8 utf8_bin char(64) +3.0000 mysql columns_priv User char 16 48 utf8 utf8_bin char(16) +3.0000 mysql columns_priv Table_name char 64 192 utf8 utf8_bin char(64) +3.0000 mysql columns_priv Column_name char 64 192 utf8 utf8_bin char(64) +NULL mysql columns_priv Timestamp timestamp NULL NULL NULL NULL timestamp +3.0000 mysql columns_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References') +3.0000 mysql db Host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql db Db char 64 192 utf8 utf8_bin char(64) +3.0000 mysql db User char 16 48 utf8 utf8_bin char(16) +3.0000 mysql db Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql db Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql func name char 64 192 utf8 utf8_bin char(64) +NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1) +3.0000 mysql func dl char 128 384 utf8 utf8_bin char(128) +3.0000 mysql func type enum 9 27 utf8 utf8_general_ci enum('function','aggregate') +NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned +3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64) +NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned +3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128) +NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned +3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64) +NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned +NULL mysql help_relation help_keyword_id int NULL NULL NULL NULL int(10) unsigned +NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned +3.0000 mysql help_topic name char 64 192 utf8 utf8_general_ci char(64) +NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned +1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text +1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text +3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128) +3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64) +3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql host Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64) +3.0000 mysql proc name char 64 192 utf8 utf8_general_ci char(64) +3.0000 mysql proc type enum 9 27 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') +3.0000 mysql proc specific_name char 64 192 utf8 utf8_general_ci char(64) +3.0000 mysql proc language enum 3 9 utf8 utf8_general_ci enum('SQL') +3.0000 mysql proc sql_data_access enum 17 51 utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') +3.0000 mysql proc is_deterministic enum 3 9 utf8 utf8_general_ci enum('YES','NO') +3.0000 mysql proc security_type enum 7 21 utf8 utf8_general_ci enum('INVOKER','DEFINER') +1.0000 mysql proc param_list blob 65535 65535 NULL NULL blob +3.0000 mysql proc returns char 64 192 utf8 utf8_general_ci char(64) +1.0000 mysql proc body longblob 4294967295 4294967295 NULL NULL longblob +3.0000 mysql proc definer char 77 231 utf8 utf8_bin char(77) +NULL mysql proc created timestamp NULL NULL NULL NULL timestamp +NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp +3.0000 mysql proc sql_mode set 431 1293 utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') +3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64) +3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64) +3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16) +3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_bin char(64) +3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE') +3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77) +3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant') +NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp +3.0000 mysql tables_priv Host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql tables_priv Db char 64 192 utf8 utf8_bin char(64) +3.0000 mysql tables_priv User char 16 48 utf8 utf8_bin char(16) +3.0000 mysql tables_priv Table_name char 64 192 utf8 utf8_bin char(64) +3.0000 mysql tables_priv Grantor char 77 231 utf8 utf8_bin char(77) +NULL mysql tables_priv Timestamp timestamp NULL NULL NULL NULL timestamp +3.0000 mysql tables_priv Table_priv set 90 270 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') +3.0000 mysql tables_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References') +NULL mysql time_zone Time_zone_id int NULL NULL NULL NULL int(10) unsigned +3.0000 mysql time_zone Use_leap_seconds enum 1 3 utf8 utf8_general_ci enum('Y','N') +NULL mysql time_zone_leap_second Transition_time bigint NULL NULL NULL NULL bigint(20) +NULL mysql time_zone_leap_second Correction int NULL NULL NULL NULL int(11) +3.0000 mysql time_zone_name Name char 64 192 utf8 utf8_general_ci char(64) +NULL mysql time_zone_name Time_zone_id int NULL NULL NULL NULL int(10) unsigned +NULL mysql time_zone_transition Time_zone_id int NULL NULL NULL NULL int(10) unsigned +NULL mysql time_zone_transition Transition_time bigint NULL NULL NULL NULL bigint(20) +NULL mysql time_zone_transition Transition_type_id int NULL NULL NULL NULL int(10) unsigned +NULL mysql time_zone_transition_type Time_zone_id int NULL NULL NULL NULL int(10) unsigned +NULL mysql time_zone_transition_type Transition_type_id int NULL NULL NULL NULL int(10) unsigned +NULL mysql time_zone_transition_type Offset int NULL NULL NULL NULL int(11) +NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(3) unsigned +3.0000 mysql time_zone_transition_type Abbreviation char 8 24 utf8 utf8_general_ci char(8) +3.0000 mysql user Host char 60 180 utf8 utf8_bin char(60) +3.0000 mysql user User char 16 48 utf8 utf8_bin char(16) +1.0000 mysql user Password char 41 41 latin1 latin1_bin char(41) +3.0000 mysql user Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Reload_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Shutdown_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Process_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user File_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Show_db_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Super_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Repl_slave_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Repl_client_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user Create_user_priv enum 1 3 utf8 utf8_general_ci enum('N','Y') +3.0000 mysql user ssl_type enum 9 27 utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') +1.0000 mysql user ssl_cipher blob 65535 65535 NULL NULL blob +1.0000 mysql user x509_issuer blob 65535 65535 NULL NULL blob +1.0000 mysql user x509_subject blob 65535 65535 NULL NULL blob +NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned +NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned +NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned +NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned 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 new file mode 100644 index 00000000000..17b5708643b --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result @@ -0,0 +1,372 @@ +SHOW TABLES FROM information_schema LIKE 'KEY_COLUMN_USAGE'; +Tables_in_information_schema (KEY_COLUMN_USAGE) +KEY_COLUMN_USAGE +####################################################################### +# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +####################################################################### +DROP VIEW IF EXISTS test.v1; +DROP PROCEDURE IF EXISTS test.p1; +DROP FUNCTION IF EXISTS test.f1; +CREATE VIEW test.v1 AS SELECT * FROM information_schema.KEY_COLUMN_USAGE; +CREATE PROCEDURE test.p1() SELECT * FROM information_schema.KEY_COLUMN_USAGE; +CREATE FUNCTION test.f1() returns BIGINT +BEGIN +DECLARE counter BIGINT DEFAULT NULL; +SELECT COUNT(*) INTO counter FROM information_schema.KEY_COLUMN_USAGE; +RETURN counter; +END// +# Attention: The printing of the next result sets is disabled. +SELECT * FROM information_schema.KEY_COLUMN_USAGE; +SELECT * FROM test.v1; +CALL test.p1; +SELECT test.f1(); +DROP VIEW test.v1; +DROP PROCEDURE test.p1; +DROP FUNCTION test.f1; +######################################################################### +# Testcase 3.2.7.1: INFORMATION_SCHEMA.KEY_COLUMN_USAGE layout +######################################################################### +DESCRIBE information_schema.KEY_COLUMN_USAGE; +Field Type Null Key Default Extra +CONSTRAINT_CATALOG varchar(512) YES NULL +CONSTRAINT_SCHEMA varchar(64) NO +CONSTRAINT_NAME varchar(64) NO +TABLE_CATALOG varchar(512) YES NULL +TABLE_SCHEMA varchar(64) NO +TABLE_NAME varchar(64) NO +COLUMN_NAME varchar(64) NO +ORDINAL_POSITION bigint(10) NO 0 +POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL +REFERENCED_TABLE_SCHEMA varchar(64) YES NULL +REFERENCED_TABLE_NAME varchar(64) YES NULL +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) default NULL, + `CONSTRAINT_SCHEMA` varchar(64) NOT NULL default '', + `CONSTRAINT_NAME` varchar(64) NOT NULL default '', + `TABLE_CATALOG` varchar(512) default NULL, + `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 +) ENGINE=MEMORY DEFAULT CHARSET=utf8 +SHOW COLUMNS FROM information_schema.KEY_COLUMN_USAGE; +Field Type Null Key Default Extra +CONSTRAINT_CATALOG varchar(512) YES NULL +CONSTRAINT_SCHEMA varchar(64) NO +CONSTRAINT_NAME varchar(64) NO +TABLE_CATALOG varchar(512) YES NULL +TABLE_SCHEMA varchar(64) NO +TABLE_NAME varchar(64) NO +COLUMN_NAME varchar(64) NO +ORDINAL_POSITION bigint(10) NO 0 +POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL +REFERENCED_TABLE_SCHEMA varchar(64) YES NULL +REFERENCED_TABLE_NAME varchar(64) YES NULL +REFERENCED_COLUMN_NAME varchar(64) YES NULL +SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog, +table_schema, table_name, column_name +FROM information_schema.key_column_usage +WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL; +constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name +######################################################################################## +# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information +######################################################################################## +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +USE db_datadict; +CREATE TABLE t1_1 +(f1 INT NOT NULL, PRIMARY KEY(f1), +f2 INT, INDEX f2_ind(f2)) +ENGINE = ; +GRANT SELECT ON t1_1 to 'testuser1'@'localhost'; +CREATE TABLE t1_2 +(f1 INT NOT NULL, PRIMARY KEY(f1), +f2 INT, INDEX f2_ind(f2)) +ENGINE = ; +GRANT SELECT ON t1_2 to 'testuser2'@'localhost'; +SELECT * FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_%' +ORDER BY constraint_catalog, constraint_schema, constraint_name, +table_catalog, table_schema, table_name, ordinal_position; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME +NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL +NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL +# Establish connection testuser1 (user=testuser1) +SELECT * FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_%' +ORDER BY constraint_catalog, constraint_schema, constraint_name, +table_catalog, table_schema, table_name, ordinal_position; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME +NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL +NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL +# Establish connection testuser2 (user=testuser2) +SELECT * FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_%' +ORDER BY constraint_catalog, constraint_schema, constraint_name, +table_catalog, table_schema, table_name, ordinal_position; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME +NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL +NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL +# Switch to connection default and close connections testuser1, testuser2 +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP TABLE t1_1; +DROP TABLE t1_2; +DROP DATABASE IF EXISTS db_datadict; +######################################################################################## +# Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.KEY_COLUMN_USAGE modifications +######################################################################################## +DROP DATABASE IF EXISTS db_datadict; +DROP TABLE IF EXISTS test.t1_my_table; +CREATE DATABASE db_datadict; +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_my_table%'; +table_name +CREATE TABLE test.t1_my_table +(f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1,f2)) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci +ENGINE = ; +SELECT * FROM information_schema.key_column_usage +WHERE table_name = 't1_my_table'; +CONSTRAINT_CATALOG NULL +CONSTRAINT_SCHEMA test +CONSTRAINT_NAME PRIMARY +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t1_my_table +COLUMN_NAME f1 +ORDINAL_POSITION 1 +POSITION_IN_UNIQUE_CONSTRAINT NULL +REFERENCED_TABLE_SCHEMA NULL +REFERENCED_TABLE_NAME NULL +REFERENCED_COLUMN_NAME NULL +CONSTRAINT_CATALOG NULL +CONSTRAINT_SCHEMA test +CONSTRAINT_NAME PRIMARY +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t1_my_table +COLUMN_NAME f2 +ORDINAL_POSITION 2 +POSITION_IN_UNIQUE_CONSTRAINT NULL +REFERENCED_TABLE_SCHEMA NULL +REFERENCED_TABLE_NAME NULL +REFERENCED_COLUMN_NAME NULL +SELECT DISTINCT table_name FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_my_table%'; +table_name +t1_my_table +RENAME TABLE test.t1_my_table TO test.t1_my_tablex; +SELECT DISTINCT table_name FROM information_schema.key_column_usage +WHERE table_name LIKE 't1_my_table%'; +table_name +t1_my_tablex +SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_schema table_name +test t1_my_tablex +RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex; +SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_schema table_name +db_datadict t1_my_tablex +SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY table_name, column_name; +table_name column_name +t1_my_tablex f1 +t1_my_tablex f2 +ALTER TABLE db_datadict.t1_my_tablex CHANGE COLUMN f1 first_col CHAR(12); +SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY table_name, column_name; +table_name column_name +t1_my_tablex f2 +t1_my_tablex first_col +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +CREATE INDEX f2 ON db_datadict.t1_my_tablex(f2); +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +DROP INDEX f2 ON db_datadict.t1_my_tablex; +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE (f2); +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict f2 db_datadict t1_my_tablex f2 1 +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +DROP INDEX f2 ON db_datadict.t1_my_tablex; +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f2); +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict my_idx db_datadict t1_my_tablex f2 1 +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +DROP INDEX my_idx ON db_datadict.t1_my_tablex; +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f4,first_col); +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict my_idx db_datadict t1_my_tablex f4 1 +db_datadict my_idx db_datadict t1_my_tablex first_col 2 +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict my_idx db_datadict t1_my_tablex f4 1 +db_datadict my_idx db_datadict t1_my_tablex first_col 2 +db_datadict PRIMARY db_datadict t1_my_tablex first_col 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 2 +ALTER TABLE db_datadict.t1_my_tablex +DROP COLUMN first_col; +SELECT constraint_schema, constraint_name, table_schema, +table_name, column_name, ordinal_position +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY constraint_schema, constraint_name, table_schema, +table_name, ordinal_position; +constraint_schema constraint_name table_schema table_name column_name ordinal_position +db_datadict my_idx db_datadict t1_my_tablex f4 1 +db_datadict PRIMARY db_datadict t1_my_tablex f2 1 +SELECT table_name, column_name +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex' +ORDER BY table_name, column_name; +table_name column_name +t1_my_tablex f2 +t1_my_tablex f4 +DROP TABLE db_datadict.t1_my_tablex; +SELECT table_name, column_name +FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_name column_name +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_name +CREATE TABLE db_datadict.t1_my_tablex +ENGINE = AS +SELECT 1 AS f1; +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_name +ALTER TABLE db_datadict.t1_my_tablex ADD PRIMARY KEY(f1); +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_name +t1_my_tablex +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_name +t1_my_tablex +DROP DATABASE db_datadict; +SELECT table_name FROM information_schema.key_column_usage +WHERE table_name = 't1_my_tablex'; +table_name +######################################################################## +# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +# DDL on INFORMATION_SCHEMA table are not supported +######################################################################## +DROP DATABASE IF EXISTS db_datadict; +DROP TABLE IF EXISTS db_datadict.t1; +CREATE DATABASE db_datadict; +CREATE TABLE db_datadict.t1 (f1 BIGINT) +ENGINE = ; +INSERT INTO information_schema.key_column_usage +(constraint_schema, constraint_name, table_name) +VALUES ( 'mysql', 'primary', 'db'); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +INSERT INTO information_schema.key_column_usage +SELECT * FROM information_schema.key_column_usage; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +UPDATE information_schema.key_column_usage +SET table_name = 'db1' WHERE constraint_name = 'primary'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DELETE FROM information_schema.key_column_usage WHERE table_name = 't1'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE information_schema.key_column_usage; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +CREATE INDEX i3 ON information_schema.key_column_usage(table_name); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.key_column_usage ADD f1 INT; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP TABLE information_schema.key_column_usage; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.key_column_usage +RENAME db_datadict.key_column_usage; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.key_column_usage +RENAME information_schema.xkey_column_usage; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP TABLE db_datadict.t1; +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_routines_embedded.result b/mysql-test/suite/funcs_1/r/is_routines_embedded.result new file mode 100644 index 00000000000..2e5dbf84402 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_routines_embedded.result @@ -0,0 +1,620 @@ +SHOW TABLES FROM information_schema LIKE 'ROUTINES'; +Tables_in_information_schema (ROUTINES) +ROUTINES +####################################################################### +# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +####################################################################### +DROP VIEW IF EXISTS test.v1; +DROP PROCEDURE IF EXISTS test.p1; +DROP FUNCTION IF EXISTS test.f1; +CREATE VIEW test.v1 AS SELECT * FROM information_schema.ROUTINES; +CREATE PROCEDURE test.p1() SELECT * FROM information_schema.ROUTINES; +CREATE FUNCTION test.f1() returns BIGINT +BEGIN +DECLARE counter BIGINT DEFAULT NULL; +SELECT COUNT(*) INTO counter FROM information_schema.ROUTINES; +RETURN counter; +END// +# Attention: The printing of the next result sets is disabled. +SELECT * FROM information_schema.ROUTINES; +SELECT * FROM test.v1; +CALL test.p1; +SELECT test.f1(); +DROP VIEW test.v1; +DROP PROCEDURE test.p1; +DROP FUNCTION test.f1; +######################################################################### +# Testcase 3.2.8.1: INFORMATION_SCHEMA.ROUTINES layout +######################################################################### +DESCRIBE information_schema.ROUTINES; +Field Type Null Key Default Extra +SPECIFIC_NAME varchar(64) NO +ROUTINE_CATALOG varchar(512) YES NULL +ROUTINE_SCHEMA varchar(64) NO +ROUTINE_NAME varchar(64) NO +ROUTINE_TYPE varchar(9) NO +DTD_IDENTIFIER varchar(64) YES NULL +ROUTINE_BODY varchar(8) NO +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 +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 longtext NO NULL +ROUTINE_COMMENT varchar(64) NO +DEFINER varchar(77) NO +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) default NULL, + `ROUTINE_SCHEMA` varchar(64) NOT NULL default '', + `ROUTINE_NAME` varchar(64) NOT NULL default '', + `ROUTINE_TYPE` varchar(9) NOT NULL default '', + `DTD_IDENTIFIER` varchar(64) default NULL, + `ROUTINE_BODY` varchar(8) NOT NULL default '', + `ROUTINE_DEFINITION` longtext, + `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` longtext NOT NULL, + `ROUTINE_COMMENT` varchar(64) NOT NULL default '', + `DEFINER` varchar(77) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW COLUMNS FROM information_schema.ROUTINES; +Field Type Null Key Default Extra +SPECIFIC_NAME varchar(64) NO +ROUTINE_CATALOG varchar(512) YES NULL +ROUTINE_SCHEMA varchar(64) NO +ROUTINE_NAME varchar(64) NO +ROUTINE_TYPE varchar(9) NO +DTD_IDENTIFIER varchar(64) YES NULL +ROUTINE_BODY varchar(8) NO +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 +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 longtext NO NULL +ROUTINE_COMMENT varchar(64) NO +DEFINER varchar(77) NO +USE test; +DROP PROCEDURE IF EXISTS sp_for_routines; +DROP FUNCTION IF EXISTS function_for_routines; +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; +SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type, +routine_body,external_name,external_language,parameter_style,sql_path +FROM information_schema.routines +WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL +OR external_language IS NOT NULL OR sql_path IS NOT NULL +OR routine_body <> 'SQL' OR parameter_style <> 'SQL' + OR specific_name <> routine_name; +specific_name routine_catalog routine_schema routine_name routine_type routine_body external_name external_language parameter_style sql_path +DROP PROCEDURE sp_for_routines; +DROP FUNCTION function_for_routines; +################################################################################ +# Testcase 3.2.8.2 + 3.2.8.3: INFORMATION_SCHEMA.ROUTINES accessible information +################################################################################ +DROP DATABASE IF EXISTS db_datadict; +DROP DATABASE IF EXISTS db_datadict_2; +CREATE DATABASE db_datadict; +USE db_datadict; +CREATE TABLE res_6_408002_1(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT) +ENGINE = ; +INSERT INTO res_6_408002_1(f1, f2, f3, f4) +VALUES('abc', 'xyz', '1989-11-09', 0815); +DROP PROCEDURE IF EXISTS sp_6_408002_1; +CREATE PROCEDURE sp_6_408002_1() +BEGIN +SELECT * FROM db_datadict.res_6_408002_1; +END// +CREATE DATABASE db_datadict_2; +USE db_datadict_2; +CREATE TABLE res_6_408002_2(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT) +ENGINE = ; +INSERT INTO res_6_408002_2(f1, f2, f3, f4) +VALUES('abc', 'xyz', '1990-10-03', 4711); +DROP PROCEDURE IF EXISTS sp_6_408002_2; +CREATE PROCEDURE sp_6_408002_2() +BEGIN +SELECT * FROM db_datadict_2.res_6_408002_2; +END// +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; +GRANT SELECT ON db_datadict_2.* TO 'testuser1'@'localhost'; +GRANT EXECUTE ON db_datadict_2.* TO 'testuser1'@'localhost'; +GRANT EXECUTE ON db_datadict.* TO 'testuser1'@'localhost'; +GRANT SELECT ON db_datadict.* TO 'testuser2'@'localhost'; +GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2 +TO 'testuser2'@'localhost'; +GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost'; +FLUSH PRIVILEGES; +# Establish connection testuser1 (user=testuser1) +SELECT * FROM information_schema.routines; +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 CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER +sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL BEGIN +SELECT * FROM db_datadict.res_6_408002_1; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost +sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL BEGIN +SELECT * FROM db_datadict_2.res_6_408002_2; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost +# Establish connection testuser2 (user=testuser2) +SELECT * FROM information_schema.routines; +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 CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER +sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL BEGIN +SELECT * FROM db_datadict.res_6_408002_1; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost +sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL BEGIN +SELECT * FROM db_datadict_2.res_6_408002_2; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost +# Establish connection testuser3 (user=testuser3) +SELECT * FROM information_schema.routines; +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 CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER +sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL BEGIN +SELECT * FROM db_datadict.res_6_408002_1; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost +sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL BEGIN +SELECT * FROM db_datadict_2.res_6_408002_2; +END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost +# Switch to connection default and close connections testuser1,testuser2,testuser3 +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +USE test; +DROP DATABASE db_datadict; +DROP DATABASE db_datadict_2; +######################################################################### +# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.ROUTINES modifications +######################################################################### +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; +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 CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER +USE db_datadict; +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' +ORDER BY routine_name; +SPECIFIC_NAME function_for_routines +ROUTINE_CATALOG NULL +ROUTINE_SCHEMA db_datadict +ROUTINE_NAME function_for_routines +ROUTINE_TYPE FUNCTION +DTD_IDENTIFIER int(11) +ROUTINE_BODY SQL +ROUTINE_DEFINITION RETURN 0 +EXTERNAL_NAME NULL +EXTERNAL_LANGUAGE NULL +PARAMETER_STYLE SQL +IS_DETERMINISTIC NO +SQL_DATA_ACCESS CONTAINS SQL +SQL_PATH NULL +SECURITY_TYPE DEFINER +CREATED +LAST_ALTERED +SQL_MODE +ROUTINE_COMMENT +DEFINER root@localhost +SPECIFIC_NAME sp_for_routines +ROUTINE_CATALOG NULL +ROUTINE_SCHEMA db_datadict +ROUTINE_NAME sp_for_routines +ROUTINE_TYPE PROCEDURE +DTD_IDENTIFIER NULL +ROUTINE_BODY SQL +ROUTINE_DEFINITION SELECT 'db_datadict' +EXTERNAL_NAME NULL +EXTERNAL_LANGUAGE NULL +PARAMETER_STYLE SQL +IS_DETERMINISTIC NO +SQL_DATA_ACCESS CONTAINS SQL +SQL_PATH NULL +SECURITY_TYPE DEFINER +CREATED +LAST_ALTERED +SQL_MODE +ROUTINE_COMMENT +DEFINER root@localhost +ALTER PROCEDURE sp_for_routines SQL SECURITY INVOKER; +ALTER FUNCTION function_for_routines COMMENT 'updated comments'; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' +ORDER BY routine_name; +SPECIFIC_NAME function_for_routines +ROUTINE_CATALOG NULL +ROUTINE_SCHEMA db_datadict +ROUTINE_NAME function_for_routines +ROUTINE_TYPE FUNCTION +DTD_IDENTIFIER int(11) +ROUTINE_BODY SQL +ROUTINE_DEFINITION RETURN 0 +EXTERNAL_NAME NULL +EXTERNAL_LANGUAGE NULL +PARAMETER_STYLE SQL +IS_DETERMINISTIC NO +SQL_DATA_ACCESS CONTAINS SQL +SQL_PATH NULL +SECURITY_TYPE DEFINER +CREATED +LAST_ALTERED +SQL_MODE +ROUTINE_COMMENT updated comments +DEFINER root@localhost +SPECIFIC_NAME sp_for_routines +ROUTINE_CATALOG NULL +ROUTINE_SCHEMA db_datadict +ROUTINE_NAME sp_for_routines +ROUTINE_TYPE PROCEDURE +DTD_IDENTIFIER NULL +ROUTINE_BODY SQL +ROUTINE_DEFINITION SELECT 'db_datadict' +EXTERNAL_NAME NULL +EXTERNAL_LANGUAGE NULL +PARAMETER_STYLE SQL +IS_DETERMINISTIC NO +SQL_DATA_ACCESS CONTAINS SQL +SQL_PATH NULL +SECURITY_TYPE INVOKER +CREATED +LAST_ALTERED +SQL_MODE +ROUTINE_COMMENT +DEFINER root@localhost +DROP PROCEDURE sp_for_routines; +DROP FUNCTION function_for_routines; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; +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 CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' +ORDER BY routine_name; +SPECIFIC_NAME function_for_routines +ROUTINE_CATALOG NULL +ROUTINE_SCHEMA db_datadict +ROUTINE_NAME function_for_routines +ROUTINE_TYPE FUNCTION +DTD_IDENTIFIER int(11) +ROUTINE_BODY SQL +ROUTINE_DEFINITION RETURN 0 +EXTERNAL_NAME NULL +EXTERNAL_LANGUAGE NULL +PARAMETER_STYLE SQL +IS_DETERMINISTIC NO +SQL_DATA_ACCESS CONTAINS SQL +SQL_PATH NULL +SECURITY_TYPE DEFINER +CREATED +LAST_ALTERED +SQL_MODE +ROUTINE_COMMENT +DEFINER root@localhost +SPECIFIC_NAME sp_for_routines +ROUTINE_CATALOG NULL +ROUTINE_SCHEMA db_datadict +ROUTINE_NAME sp_for_routines +ROUTINE_TYPE PROCEDURE +DTD_IDENTIFIER NULL +ROUTINE_BODY SQL +ROUTINE_DEFINITION SELECT 'db_datadict' +EXTERNAL_NAME NULL +EXTERNAL_LANGUAGE NULL +PARAMETER_STYLE SQL +IS_DETERMINISTIC NO +SQL_DATA_ACCESS CONTAINS SQL +SQL_PATH NULL +SECURITY_TYPE DEFINER +CREATED +LAST_ALTERED +SQL_MODE +ROUTINE_COMMENT +DEFINER root@localhost +use test; +DROP DATABASE db_datadict; +SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; +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 CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER +######################################################################### +# 3.2.8.4: INFORMATION_SCHEMA.ROUTINES routine body too big for +# ROUTINE_DEFINITION column +######################################################################### +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +USE db_datadict; +CREATE TABLE db_datadict.res_6_408004_1 +(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR) +ENGINE = ; +INSERT INTO db_datadict.res_6_408004_1 +VALUES ('abc', 98765 , 99999999 , 98765, 10); +CREATE TABLE db_datadict.res_6_408004_2 +(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR) +ENGINE = ; +INSERT INTO db_datadict.res_6_408004_2 +VALUES ('abc', 98765 , 99999999 , 98765, 10); +# Checking the max. possible length of (currently) 4 GByte is not +# in this environment here. +CREATE PROCEDURE sp_6_408004 () +BEGIN +DECLARE done INTEGER DEFAULt 0; +DECLARE variable_number_1 LONGTEXT; +DECLARE variable_number_2 MEDIUMINT; +DECLARE variable_number_3 LONGBLOB; +DECLARE variable_number_4 REAL; +DECLARE variable_number_5 YEAR; +DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; +BEGIN +OPEN cursor_number_1; +WHILE done <> 1 DO +FETCH cursor_number_1 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES (variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +BEGIN +BEGIN +SET done = 0; +OPEN cursor_number_2; +WHILE done <> 1 DO +FETCH cursor_number_2 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES(variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +SET done = 0; +OPEN cursor_number_3; +WHILE done <> 1 DO +FETCH cursor_number_3 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES(variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +END; +BEGIN +SET done = 0; +OPEN cursor_number_4; +WHILE done <> 1 DO +FETCH cursor_number_4 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES (variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +BEGIN +SET @a='test row'; +SELECT @a; +SELECT @a; +SELECT @a; +END; +BEGIN +SET done = 0; +OPEN cursor_number_5; +WHILE done <> 1 DO +FETCH cursor_number_5 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES (variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +BEGIN +SET @a='test row'; +SELECT @a; +SELECT @a; +SELECT @a; +END; +END// +CALL db_datadict.sp_6_408004 (); +@a +test row +@a +test row +@a +test row +@a +test row +@a +test row +@a +test row +SELECT * FROM db_datadict.res_6_408004_2; +f1 f2 f3 f4 f5 +abc 98765 99999999 98765 2010 +abc 98765 99999999 98765 2010 +abc 98765 99999999 98765 2010 +abc 98765 99999999 98765 2010 +abc 98765 99999999 98765 2010 +abc 98765 99999999 98765 2010 +SELECT *, LENGTH(routine_definition) FROM information_schema.routines +WHERE routine_schema = 'db_datadict'; +SPECIFIC_NAME sp_6_408004 +ROUTINE_CATALOG NULL +ROUTINE_SCHEMA db_datadict +ROUTINE_NAME sp_6_408004 +ROUTINE_TYPE PROCEDURE +DTD_IDENTIFIER NULL +ROUTINE_BODY SQL +ROUTINE_DEFINITION BEGIN +DECLARE done INTEGER DEFAULt 0; +DECLARE variable_number_1 LONGTEXT; +DECLARE variable_number_2 MEDIUMINT; +DECLARE variable_number_3 LONGBLOB; +DECLARE variable_number_4 REAL; +DECLARE variable_number_5 YEAR; +DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; +DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; +BEGIN +OPEN cursor_number_1; +WHILE done <> 1 DO +FETCH cursor_number_1 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES (variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +BEGIN +BEGIN +SET done = 0; +OPEN cursor_number_2; +WHILE done <> 1 DO +FETCH cursor_number_2 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES(variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +SET done = 0; +OPEN cursor_number_3; +WHILE done <> 1 DO +FETCH cursor_number_3 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES(variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +END; +BEGIN +SET done = 0; +OPEN cursor_number_4; +WHILE done <> 1 DO +FETCH cursor_number_4 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES (variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +BEGIN +SET @a='test row'; +SELECT @a; +SELECT @a; +SELECT @a; +END; +BEGIN +SET done = 0; +OPEN cursor_number_5; +WHILE done <> 1 DO +FETCH cursor_number_5 +INTO variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5; +IF done <> 0 THEN +INSERT INTO res_6_408004_2 +VALUES (variable_number_1, variable_number_2, variable_number_3, +variable_number_4, variable_number_5); +END IF; +END WHILE; +END; +BEGIN +SET @a='test row'; +SELECT @a; +SELECT @a; +SELECT @a; +END; +END +EXTERNAL_NAME NULL +EXTERNAL_LANGUAGE NULL +PARAMETER_STYLE SQL +IS_DETERMINISTIC NO +SQL_DATA_ACCESS CONTAINS SQL +SQL_PATH NULL +SECURITY_TYPE DEFINER +CREATED YYYY-MM-DD hh:mm:ss +LAST_ALTERED YYYY-MM-DD hh:mm:ss +SQL_MODE +ROUTINE_COMMENT +DEFINER root@localhost +LENGTH(routine_definition) 2549 +DROP DATABASE db_datadict; +######################################################################## +# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +# DDL on INFORMATION_SCHEMA table are not supported +######################################################################## +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +USE db_datadict; +CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; +USE test; +INSERT INTO information_schema.routines (routine_name, routine_type ) +VALUES ('p2', 'procedure'); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +UPDATE information_schema.routines SET routine_name = 'p2' +WHERE routine_body = 'sql'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DELETE FROM information_schema.routines ; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE information_schema.routines ; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +CREATE INDEX i7 ON information_schema.routines (routine_name); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.routines ADD f1 INT; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.routines DISCARD TABLESPACE; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP TABLE information_schema.routines ; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.routines RENAME db_datadict.routines; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.routines RENAME information_schema.xroutines; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_schemata_embedded.result b/mysql-test/suite/funcs_1/r/is_schemata_embedded.result new file mode 100644 index 00000000000..0dbbeaaa468 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_schemata_embedded.result @@ -0,0 +1,187 @@ +SHOW TABLES FROM information_schema LIKE 'SCHEMATA'; +Tables_in_information_schema (SCHEMATA) +SCHEMATA +####################################################################### +# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +####################################################################### +DROP VIEW IF EXISTS test.v1; +DROP PROCEDURE IF EXISTS test.p1; +DROP FUNCTION IF EXISTS test.f1; +CREATE VIEW test.v1 AS SELECT * FROM information_schema.SCHEMATA; +CREATE PROCEDURE test.p1() SELECT * FROM information_schema.SCHEMATA; +CREATE FUNCTION test.f1() returns BIGINT +BEGIN +DECLARE counter BIGINT DEFAULT NULL; +SELECT COUNT(*) INTO counter FROM information_schema.SCHEMATA; +RETURN counter; +END// +# Attention: The printing of the next result sets is disabled. +SELECT * FROM information_schema.SCHEMATA; +SELECT * FROM test.v1; +CALL test.p1; +SELECT test.f1(); +DROP VIEW test.v1; +DROP PROCEDURE test.p1; +DROP FUNCTION test.f1; +######################################################################### +# Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout; +######################################################################### +DESCRIBE information_schema.SCHEMATA; +Field Type Null Key Default Extra +CATALOG_NAME varchar(512) YES NULL +SCHEMA_NAME varchar(64) NO +DEFAULT_CHARACTER_SET_NAME varchar(64) NO +DEFAULT_COLLATION_NAME varchar(64) NO +SQL_PATH varchar(512) YES NULL +SHOW CREATE TABLE information_schema.SCHEMATA; +Table Create Table +SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` ( + `CATALOG_NAME` varchar(512) default NULL, + `SCHEMA_NAME` varchar(64) NOT NULL default '', + `DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL default '', + `DEFAULT_COLLATION_NAME` varchar(64) NOT NULL default '', + `SQL_PATH` varchar(512) default NULL +) ENGINE=MEMORY DEFAULT CHARSET=utf8 +SHOW COLUMNS FROM information_schema.SCHEMATA; +Field Type Null Key Default Extra +CATALOG_NAME varchar(512) YES NULL +SCHEMA_NAME varchar(64) NO +DEFAULT_CHARACTER_SET_NAME varchar(64) NO +DEFAULT_COLLATION_NAME varchar(64) NO +SQL_PATH varchar(512) YES NULL +SELECT catalog_name, schema_name, sql_path +FROM information_schema.schemata +WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL; +catalog_name schema_name sql_path +############################################################################### +# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information +############################################################################### +DROP DATABASE IF EXISTS db_datadict_1; +DROP DATABASE IF EXISTS db_datadict_2; +CREATE DATABASE db_datadict_1; +CREATE DATABASE db_datadict_2; +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; +GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost'; +GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost'; +GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost'; +SELECT * FROM information_schema.schemata +WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +NULL db_datadict_1 latin1 latin1_swedish_ci NULL +NULL db_datadict_2 latin1 latin1_swedish_ci NULL +SHOW DATABASES LIKE 'db_datadict_%'; +Database (db_datadict_%) +db_datadict_1 +db_datadict_2 +# Establish connection testuser1 (user=testuser1) +SELECT * FROM information_schema.schemata +WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +NULL db_datadict_1 latin1 latin1_swedish_ci NULL +NULL db_datadict_2 latin1 latin1_swedish_ci NULL +SHOW DATABASES LIKE 'db_datadict_%'; +Database (db_datadict_%) +db_datadict_1 +db_datadict_2 +# Establish connection testuser2 (user=testuser2) +SELECT * FROM information_schema.schemata +WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +NULL db_datadict_1 latin1 latin1_swedish_ci NULL +NULL db_datadict_2 latin1 latin1_swedish_ci NULL +SHOW DATABASES LIKE 'db_datadict_%'; +Database (db_datadict_%) +db_datadict_1 +db_datadict_2 +# Establish connection testuser3 (user=testuser3) +SELECT * FROM information_schema.schemata +WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +NULL db_datadict_1 latin1 latin1_swedish_ci NULL +NULL db_datadict_2 latin1 latin1_swedish_ci NULL +SHOW DATABASES LIKE 'db_datadict_%'; +Database (db_datadict_%) +db_datadict_1 +db_datadict_2 +# Switch to connection default and close connections testuser1,testuser2,testuser3 +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +DROP DATABASE db_datadict_1; +DROP DATABASE db_datadict_2; +################################################################################# +# Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications +################################################################################# +DROP DATABASE IF EXISTS db_datadict; +SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci'; +SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +NULL db_datadict latin1 latin1_swedish_ci NULL +SELECT schema_name, default_character_set_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +schema_name default_character_set_name +db_datadict latin1 +ALTER SCHEMA db_datadict CHARACTER SET 'utf8'; +SELECT schema_name, default_character_set_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +schema_name default_character_set_name +db_datadict utf8 +ALTER SCHEMA db_datadict CHARACTER SET 'latin1'; +SELECT schema_name, default_collation_name FROM information_schema.schemata +WHERE schema_name = 'db_datadict'; +schema_name default_collation_name +db_datadict latin1_swedish_ci +ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs'; +SELECT schema_name, default_collation_name FROM information_schema.schemata +WHERE schema_name = 'db_datadict'; +schema_name default_collation_name +db_datadict latin1_general_cs +SELECT schema_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +schema_name +db_datadict +DROP DATABASE db_datadict; +SELECT schema_name +FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +schema_name +######################################################################## +# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +# DDL on INFORMATION_SCHEMA tables are not supported +######################################################################## +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci'; +INSERT INTO information_schema.schemata +(catalog_name, schema_name, default_character_set_name, sql_path) +VALUES (NULL, 'db1', 'latin1', NULL); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +INSERT INTO information_schema.schemata +SELECT * FROM information_schema.schemata; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +UPDATE information_schema.schemata +SET default_character_set_name = 'utf8' +WHERE schema_name = 'db_datadict'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +UPDATE information_schema.schemata SET catalog_name = 't_4711'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE information_schema.schemata; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +CREATE INDEX i1 ON information_schema.schemata(schema_name); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.schemata ADD f1 INT; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP TABLE information_schema.schemata; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.schemata RENAME db_datadict.schemata; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.schemata RENAME information_schema.xschemata; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result new file mode 100644 index 00000000000..7602e71f7bf --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result @@ -0,0 +1,103 @@ +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +DROP USER testuser1@localhost; +CREATE USER testuser1@localhost; +GRANT SELECT ON db_datadict.* TO testuser1@localhost; +SELECT * FROM information_schema.statistics +WHERE table_schema = 'mysql' +ORDER BY table_schema, table_name, index_name, seq_in_index, column_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT +NULL mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE +NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE +NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE +NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE +NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE +NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE +NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE +NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE +NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE +NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE +# Establish connection testuser1 (user=testuser1) +SELECT * FROM information_schema.statistics +WHERE table_schema = 'mysql' +ORDER BY table_schema, table_name, index_name, seq_in_index, column_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT +NULL mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE +NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE +NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE +NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE +NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE +NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE +NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE +NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE +NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE +NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE +NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE +NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE +NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE +NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE +NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE +# Switch to connection default and close connection testuser1 +DROP USER testuser1@localhost; +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result new file mode 100644 index 00000000000..0ab31365eb5 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result @@ -0,0 +1,57 @@ +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +DROP USER testuser1@localhost; +CREATE USER testuser1@localhost; +GRANT SELECT ON db_datadict.* TO testuser1@localhost; +SELECT * FROM information_schema.table_constraints +WHERE table_schema = 'mysql' +ORDER BY table_schema,table_name,constraint_name; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE +NULL mysql PRIMARY mysql columns_priv PRIMARY KEY +NULL mysql PRIMARY mysql db PRIMARY KEY +NULL mysql PRIMARY mysql func PRIMARY KEY +NULL mysql name mysql help_category UNIQUE +NULL mysql PRIMARY mysql help_category PRIMARY KEY +NULL mysql name mysql help_keyword UNIQUE +NULL mysql PRIMARY mysql help_keyword PRIMARY KEY +NULL mysql PRIMARY mysql help_relation PRIMARY KEY +NULL mysql name mysql help_topic UNIQUE +NULL mysql PRIMARY mysql help_topic PRIMARY KEY +NULL mysql PRIMARY mysql host PRIMARY KEY +NULL mysql PRIMARY mysql proc PRIMARY KEY +NULL mysql PRIMARY mysql procs_priv PRIMARY KEY +NULL mysql PRIMARY mysql tables_priv PRIMARY KEY +NULL mysql PRIMARY mysql time_zone PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY +NULL mysql PRIMARY mysql user PRIMARY KEY +# Establish connection testuser1 (user=testuser1) +SELECT * FROM information_schema.table_constraints +WHERE table_schema = 'mysql' +ORDER BY table_schema,table_name,constraint_name; +CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE +NULL mysql PRIMARY mysql columns_priv PRIMARY KEY +NULL mysql PRIMARY mysql db PRIMARY KEY +NULL mysql PRIMARY mysql func PRIMARY KEY +NULL mysql name mysql help_category UNIQUE +NULL mysql PRIMARY mysql help_category PRIMARY KEY +NULL mysql name mysql help_keyword UNIQUE +NULL mysql PRIMARY mysql help_keyword PRIMARY KEY +NULL mysql PRIMARY mysql help_relation PRIMARY KEY +NULL mysql name mysql help_topic UNIQUE +NULL mysql PRIMARY mysql help_topic PRIMARY KEY +NULL mysql PRIMARY mysql host PRIMARY KEY +NULL mysql PRIMARY mysql proc PRIMARY KEY +NULL mysql PRIMARY mysql procs_priv PRIMARY KEY +NULL mysql PRIMARY mysql tables_priv PRIMARY KEY +NULL mysql PRIMARY mysql time_zone PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY +NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY +NULL mysql PRIMARY mysql user PRIMARY KEY +# Switch to connection default and close connection testuser1 +DROP USER testuser1@localhost; +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_tables_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_embedded.result new file mode 100644 index 00000000000..13ee6277bad --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_tables_embedded.result @@ -0,0 +1,427 @@ +SHOW TABLES FROM information_schema LIKE 'TABLES'; +Tables_in_information_schema (TABLES) +TABLES +####################################################################### +# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +####################################################################### +DROP VIEW IF EXISTS test.v1; +DROP PROCEDURE IF EXISTS test.p1; +DROP FUNCTION IF EXISTS test.f1; +CREATE VIEW test.v1 AS SELECT * FROM information_schema.TABLES; +CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TABLES; +CREATE FUNCTION test.f1() returns BIGINT +BEGIN +DECLARE counter BIGINT DEFAULT NULL; +SELECT COUNT(*) INTO counter FROM information_schema.TABLES; +RETURN counter; +END// +# Attention: The printing of the next result sets is disabled. +SELECT * FROM information_schema.TABLES; +SELECT * FROM test.v1; +CALL test.p1; +SELECT test.f1(); +DROP VIEW test.v1; +DROP PROCEDURE test.p1; +DROP FUNCTION test.f1; +######################################################################### +# Testcase 3.2.12.1: INFORMATION_SCHEMA.TABLES layout +######################################################################### +DESCRIBE information_schema.TABLES; +Field Type Null Key Default Extra +TABLE_CATALOG varchar(512) YES NULL +TABLE_SCHEMA varchar(64) NO +TABLE_NAME varchar(64) NO +TABLE_TYPE varchar(64) NO +ENGINE varchar(64) YES NULL +VERSION bigint(21) YES NULL +ROW_FORMAT varchar(10) YES NULL +TABLE_ROWS bigint(21) YES NULL +AVG_ROW_LENGTH bigint(21) YES NULL +DATA_LENGTH bigint(21) YES NULL +MAX_DATA_LENGTH bigint(21) YES NULL +INDEX_LENGTH bigint(21) YES NULL +DATA_FREE bigint(21) YES NULL +AUTO_INCREMENT bigint(21) YES NULL +CREATE_TIME datetime YES NULL +UPDATE_TIME datetime YES NULL +CHECK_TIME datetime YES NULL +TABLE_COLLATION varchar(64) YES NULL +CHECKSUM bigint(21) YES NULL +CREATE_OPTIONS varchar(255) YES NULL +TABLE_COMMENT varchar(80) NO +SHOW CREATE TABLE information_schema.TABLES; +Table Create Table +TABLES CREATE TEMPORARY TABLE `TABLES` ( + `TABLE_CATALOG` varchar(512) default NULL, + `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) default NULL, + `ROW_FORMAT` varchar(10) default NULL, + `TABLE_ROWS` bigint(21) default NULL, + `AVG_ROW_LENGTH` bigint(21) default NULL, + `DATA_LENGTH` bigint(21) default NULL, + `MAX_DATA_LENGTH` bigint(21) default NULL, + `INDEX_LENGTH` bigint(21) default NULL, + `DATA_FREE` bigint(21) default NULL, + `AUTO_INCREMENT` bigint(21) default NULL, + `CREATE_TIME` datetime default NULL, + `UPDATE_TIME` datetime default NULL, + `CHECK_TIME` datetime default NULL, + `TABLE_COLLATION` varchar(64) default NULL, + `CHECKSUM` bigint(21) default NULL, + `CREATE_OPTIONS` varchar(255) default NULL, + `TABLE_COMMENT` varchar(80) NOT NULL default '' +) ENGINE=MEMORY DEFAULT CHARSET=utf8 +SHOW COLUMNS FROM information_schema.TABLES; +Field Type Null Key Default Extra +TABLE_CATALOG varchar(512) YES NULL +TABLE_SCHEMA varchar(64) NO +TABLE_NAME varchar(64) NO +TABLE_TYPE varchar(64) NO +ENGINE varchar(64) YES NULL +VERSION bigint(21) YES NULL +ROW_FORMAT varchar(10) YES NULL +TABLE_ROWS bigint(21) YES NULL +AVG_ROW_LENGTH bigint(21) YES NULL +DATA_LENGTH bigint(21) YES NULL +MAX_DATA_LENGTH bigint(21) YES NULL +INDEX_LENGTH bigint(21) YES NULL +DATA_FREE bigint(21) YES NULL +AUTO_INCREMENT bigint(21) YES NULL +CREATE_TIME datetime YES NULL +UPDATE_TIME datetime YES NULL +CHECK_TIME datetime YES NULL +TABLE_COLLATION varchar(64) YES NULL +CHECKSUM bigint(21) YES NULL +CREATE_OPTIONS varchar(255) YES NULL +TABLE_COMMENT varchar(80) NO +SELECT table_catalog, table_schema, table_name +FROM information_schema.tables WHERE table_catalog IS NOT NULL; +table_catalog table_schema table_name +################################################################################ +# Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information +################################################################################ +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +GRANT CREATE, CREATE VIEW, INSERT, SELECT ON db_datadict.* +TO 'testuser1'@'localhost' WITH GRANT OPTION; +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; +CREATE TABLE db_datadict.tb1 (f1 INT, f2 INT, f3 INT) +ENGINE = ; +GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost'; +GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION; +# Establish connection testuser1 (user=testuser1) +CREATE TABLE tb2 (f1 DECIMAL) +ENGINE = ; +CREATE TABLE tb3 (f1 VARCHAR(200)) +ENGINE = ; +GRANT SELECT ON db_datadict.tb3 to 'testuser3'@'localhost'; +GRANT INSERT ON db_datadict.tb3 to 'testuser2'@'localhost'; +CREATE VIEW v3 AS SELECT * FROM tb3; +GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost'; +SELECT * FROM information_schema.tables +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT +NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW +SHOW TABLES FROM db_datadict; +Tables_in_db_datadict +tb1 +tb2 +tb3 +v3 +# Establish connection testuser2 (user=testuser2) +SELECT * FROM information_schema.tables +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT +NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW +SHOW TABLES FROM db_datadict; +Tables_in_db_datadict +tb1 +tb2 +tb3 +v3 +# Establish connection testuser3 (user=testuser3) +SELECT * FROM information_schema.tables +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT +NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW +SHOW TABLES FROM db_datadict; +Tables_in_db_datadict +tb1 +tb2 +tb3 +v3 +# Switch to connection default (user=root) +SELECT * FROM information_schema.tables +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT +NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS# +NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW +SHOW TABLES FROM db_datadict; +Tables_in_db_datadict +tb1 +tb2 +tb3 +v3 +# Close connection testuser1, testuser2, testuser3 +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +DROP DATABASE db_datadict; +######################################################################### +# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLES modifications +######################################################################### +DROP TABLE IF EXISTS test.t1_my_table; +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +table_name +CREATE TABLE test.t1_my_table (f1 BIGINT) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci +COMMENT = 'Initial Comment' ENGINE = ; +SELECT * FROM information_schema.tables +WHERE table_name = 't1_my_table'; +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t1_my_table +TABLE_TYPE BASE TABLE +ENGINE #ENG# +VERSION 10 +ROW_FORMAT #RF# +TABLE_ROWS 0 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM #CS# +CREATE_OPTIONS +TABLE_COMMENT Initial Comment +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +table_name +t1_my_table +RENAME TABLE test.t1_my_table TO test.t1_my_tablex; +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +table_name +t1_my_tablex +SELECT table_schema,table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_schema table_name +test t1_my_tablex +RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex; +SELECT table_schema,table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_schema table_name +db_datadict t1_my_tablex +SELECT table_name, engine FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name engine +t1_my_tablex +ALTER TABLE db_datadict.t1_my_tablex +ENGINE = ; +SELECT table_name, engine FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name engine +t1_my_tablex +SELECT table_name, table_rows FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name table_rows +t1_my_tablex 0 +INSERT INTO db_datadict.t1_my_tablex VALUES(1),(2); +SELECT table_name, table_rows FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name table_rows +t1_my_tablex 2 +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name table_collation +t1_my_tablex latin1_swedish_ci +ALTER TABLE db_datadict.t1_my_tablex DEFAULT CHARACTER SET utf8; +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name table_collation +t1_my_tablex utf8_general_ci +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name table_collation +t1_my_tablex utf8_general_ci +ALTER TABLE db_datadict.t1_my_tablex +DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci; +SELECT table_name, table_collation FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name table_collation +t1_my_tablex latin1_german1_ci +SELECT table_name, TABLE_COMMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name TABLE_COMMENT +t1_my_tablex Initial Comment +ALTER TABLE db_datadict.t1_my_tablex COMMENT 'Changed Comment'; +SELECT table_name, TABLE_COMMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name TABLE_COMMENT +t1_my_tablex Changed Comment +SELECT table_name, AUTO_INCREMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name AUTO_INCREMENT +t1_my_tablex NULL +ALTER TABLE db_datadict.t1_my_tablex +ADD f2 BIGINT AUTO_INCREMENT, ADD PRIMARY KEY (f2); +SELECT table_name, AUTO_INCREMENT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name AUTO_INCREMENT +t1_my_tablex 3 +SELECT table_name, ROW_FORMAT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name ROW_FORMAT +t1_my_tablex Fixed +ALTER TABLE db_datadict.t1_my_tablex ROW_FORMAT = dynamic; +SELECT table_name, ROW_FORMAT FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name ROW_FORMAT +t1_my_tablex Dynamic +SELECT table_name, checksum FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name checksum +t1_my_tablex NULL +ALTER TABLE db_datadict.t1_my_tablex CHECKSUM = 1; +SELECT table_name, checksum IS NOT NULL FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name checksum IS NOT NULL +t1_my_tablex 1 +SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +INSERT INTO db_datadict.t1_my_tablex SET f1 = 3; +SELECT UPDATE_TIME > @UPDATE_TIME +AS "Is current UPDATE_TIME bigger than before last INSERT?" +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +Is current UPDATE_TIME bigger than before last INSERT? +1 +SELECT checksum <> @checksum +AS "Is current CHECKSUM different than before last INSERT?" +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +Is current CHECKSUM different than before last INSERT? +1 +SELECT CREATE_TIME INTO @CREATE_TIME FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +table_name +t1_my_tablex +DROP TABLE db_datadict.t1_my_tablex; +SELECT table_name FROM information_schema.tables +WHERE table_name LIKE 't1_my_table%'; +table_name +CREATE TABLE test.t1_my_tablex (f1 BIGINT) +ENGINE = ; +SELECT CREATE_TIME > @CREATE_TIME +AS "Is current CREATE_TIME bigger than for the old dropped table?" +FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +Is current CREATE_TIME bigger than for the old dropped table? +1 +DROP TABLE test.t1_my_tablex; +CREATE VIEW test.t1_my_tablex AS SELECT 1; +SELECT * FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME t1_my_tablex +TABLE_TYPE VIEW +ENGINE NULL +VERSION NULL +ROW_FORMAT NULL +TABLE_ROWS NULL +AVG_ROW_LENGTH NULL +DATA_LENGTH NULL +MAX_DATA_LENGTH NULL +INDEX_LENGTH NULL +DATA_FREE NULL +AUTO_INCREMENT NULL +CREATE_TIME NULL +UPDATE_TIME NULL +CHECK_TIME NULL +TABLE_COLLATION NULL +CHECKSUM NULL +CREATE_OPTIONS NULL +TABLE_COMMENT VIEW +DROP VIEW test.t1_my_tablex; +SELECT table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name +CREATE TEMPORARY TABLE test.t1_my_tablex +ENGINE = +AS SELECT 1; +SELECT table_name, table_type FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +DROP TEMPORARY TABLE test.t1_my_tablex; +CREATE TABLE db_datadict.t1_my_tablex +ENGINE = AS +SELECT 1; +SELECT table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name +t1_my_tablex +DROP DATABASE db_datadict; +SELECT table_name FROM information_schema.tables +WHERE table_name = 't1_my_tablex'; +table_name +######################################################################## +# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +# DDL on INFORMATION_SCHEMA tables are not supported +######################################################################## +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +CREATE TABLE db_datadict.t1 (f1 BIGINT) +ENGINE = ; +INSERT INTO information_schema.tables +SELECT * FROM information_schema.tables; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +UPDATE information_schema.tables SET table_schema = 'test' +WHERE table_name = 't1'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DELETE FROM information_schema.tables WHERE table_name = 't1'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE information_schema.tables; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +CREATE INDEX my_idx_on_tables ON information_schema.tables(table_schema); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.tables DROP PRIMARY KEY; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.tables ADD f1 INT; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP TABLE information_schema.tables; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.tables RENAME db_datadict.tables; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.tables RENAME information_schema.xtables; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_tables_innodb.result b/mysql-test/suite/funcs_1/r/is_tables_innodb.result index 215e2c86654..f2d2e0a912a 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_innodb.result +++ b/mysql-test/suite/funcs_1/r/is_tables_innodb.result @@ -1,386 +1,10 @@ DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; CREATE DATABASE test1; -USE test; -drop table if exists tb1 ; -create table tb1 ( -f1 char(0), -f2 char(0) binary, -f3 char(0) ascii, -f4 tinytext unicode, -f5 text, -f6 mediumtext, -f7 longtext, -f8 tinyblob, -f9 blob, -f10 mediumblob, -f11 longblob, -f12 binary, -f13 tinyint, -f14 tinyint unsigned, -f15 tinyint zerofill, -f16 tinyint unsigned zerofill, -f17 smallint, -f18 smallint unsigned, -f19 smallint zerofill, -f20 smallint unsigned zerofill, -f21 mediumint, -f22 mediumint unsigned, -f23 mediumint zerofill, -f24 mediumint unsigned zerofill, -f25 int, -f26 int unsigned, -f27 int zerofill, -f28 int unsigned zerofill, -f29 bigint, -f30 bigint unsigned, -f31 bigint zerofill, -f32 bigint unsigned zerofill, -f33 decimal, -f34 decimal unsigned, -f35 decimal zerofill, -f36 decimal unsigned zerofill not null DEFAULT 9.9, -f37 decimal (0) not null DEFAULT 9.9, -f38 decimal (64) not null DEFAULT 9.9, -f39 decimal (0) unsigned not null DEFAULT 9.9, -f40 decimal (64) unsigned not null DEFAULT 9.9, -f41 decimal (0) zerofill not null DEFAULT 9.9, -f42 decimal (64) zerofill not null DEFAULT 9.9, -f43 decimal (0) unsigned zerofill not null DEFAULT 9.9, -f44 decimal (64) unsigned zerofill not null DEFAULT 9.9, -f45 decimal (0,0) not null DEFAULT 9.9, -f46 decimal (63,30) not null DEFAULT 9.9, -f47 decimal (0,0) unsigned not null DEFAULT 9.9, -f48 decimal (63,30) unsigned not null DEFAULT 9.9, -f49 decimal (0,0) zerofill not null DEFAULT 9.9, -f50 decimal (63,30) zerofill not null DEFAULT 9.9, -f51 decimal (0,0) unsigned zerofill not null DEFAULT 9.9, -f52 decimal (63,30) unsigned zerofill not null DEFAULT 9.9, -f53 numeric not null DEFAULT 99, -f54 numeric unsigned not null DEFAULT 99, -f55 numeric zerofill not null DEFAULT 99, -f56 numeric unsigned zerofill not null DEFAULT 99, -f57 numeric (0) not null DEFAULT 99, -f58 numeric (64) not null DEFAULT 99 -) engine = innodb; -Warnings: -Note 1265 Data truncated for column 'f36' at row 1 -Note 1265 Data truncated for column 'f37' at row 1 -Note 1265 Data truncated for column 'f38' at row 1 -Note 1265 Data truncated for column 'f39' at row 1 -Note 1265 Data truncated for column 'f40' at row 1 -Note 1265 Data truncated for column 'f41' at row 1 -Note 1265 Data truncated for column 'f42' at row 1 -Note 1265 Data truncated for column 'f43' at row 1 -Note 1265 Data truncated for column 'f44' at row 1 -Note 1265 Data truncated for column 'f45' at row 1 -Note 1265 Data truncated for column 'f47' at row 1 -Note 1265 Data truncated for column 'f49' at row 1 -Note 1265 Data truncated for column 'f51' at row 1 -load data infile '/std_data_ln/funcs_1/innodb_tb1.txt' -into table tb1; -drop table if exists tb2 ; -create table tb2 ( -f59 numeric (0) unsigned, -f60 numeric (64) unsigned, -f61 numeric (0) zerofill, -f62 numeric (64) zerofill, -f63 numeric (0) unsigned zerofill, -f64 numeric (64) unsigned zerofill, -f65 numeric (0,0), -f66 numeric (63,30), -f67 numeric (0,0) unsigned, -f68 numeric (63,30) unsigned, -f69 numeric (0,0) zerofill, -f70 numeric (63,30) zerofill, -f71 numeric (0,0) unsigned zerofill, -f72 numeric (63,30) unsigned zerofill, -f73 real, -f74 real unsigned, -f75 real zerofill, -f76 real unsigned zerofill, -f77 double default 7.7, -f78 double unsigned default 7.7, -f79 double zerofill default 7.7, -f80 double unsigned zerofill default 8.8, -f81 float not null default 8.8, -f82 float unsigned not null default 8.8, -f83 float zerofill not null default 8.8, -f84 float unsigned zerofill not null default 8.8, -f85 float(0) not null default 8.8, -f86 float(23) not null default 8.8, -f87 float(0) unsigned not null default 8.8, -f88 float(23) unsigned not null default 8.8, -f89 float(0) zerofill not null default 8.8, -f90 float(23) zerofill not null default 8.8, -f91 float(0) unsigned zerofill not null default 8.8, -f92 float(23) unsigned zerofill not null default 8.8, -f93 float(24) not null default 8.8, -f94 float(53) not null default 8.8, -f95 float(24) unsigned not null default 8.8, -f96 float(53) unsigned not null default 8.8, -f97 float(24) zerofill not null default 8.8, -f98 float(53) zerofill not null default 8.8, -f99 float(24) unsigned zerofill not null default 8.8, -f100 float(53) unsigned zerofill not null default 8.8, -f101 date not null default '2000-01-01', -f102 time not null default 20, -f103 datetime not null default '2/2/2', -f104 timestamp not null default 20001231235959, -f105 year not null default 2000, -f106 year(3) not null default 2000, -f107 year(4) not null default 2000, -f108 enum("1enum","2enum") not null default "1enum", -f109 set("1set","2set") not null default "1set" -) engine = innodb; -load data infile '/std_data_ln/funcs_1/innodb_tb2.txt' -into table tb2; -drop table if exists tb3 ; -create table tb3 ( -f118 char not null DEFAULT 'a', -f119 char binary not null DEFAULT b'101', -f120 char ascii not null DEFAULT b'101', -f121 tinytext, -f122 text, -f123 mediumtext, -f124 longtext unicode, -f125 tinyblob, -f126 blob, -f127 mediumblob, -f128 longblob, -f129 binary not null DEFAULT b'101', -f130 tinyint not null DEFAULT 99, -f131 tinyint unsigned not null DEFAULT 99, -f132 tinyint zerofill not null DEFAULT 99, -f133 tinyint unsigned zerofill not null DEFAULT 99, -f134 smallint not null DEFAULT 999, -f135 smallint unsigned not null DEFAULT 999, -f136 smallint zerofill not null DEFAULT 999, -f137 smallint unsigned zerofill not null DEFAULT 999, -f138 mediumint not null DEFAULT 9999, -f139 mediumint unsigned not null DEFAULT 9999, -f140 mediumint zerofill not null DEFAULT 9999, -f141 mediumint unsigned zerofill not null DEFAULT 9999, -f142 int not null DEFAULT 99999, -f143 int unsigned not null DEFAULT 99999, -f144 int zerofill not null DEFAULT 99999, -f145 int unsigned zerofill not null DEFAULT 99999, -f146 bigint not null DEFAULT 999999, -f147 bigint unsigned not null DEFAULT 999999, -f148 bigint zerofill not null DEFAULT 999999, -f149 bigint unsigned zerofill not null DEFAULT 999999, -f150 decimal not null DEFAULT 999.999, -f151 decimal unsigned not null DEFAULT 999.17, -f152 decimal zerofill not null DEFAULT 999.999, -f153 decimal unsigned zerofill, -f154 decimal (0), -f155 decimal (64), -f156 decimal (0) unsigned, -f157 decimal (64) unsigned, -f158 decimal (0) zerofill, -f159 decimal (64) zerofill, -f160 decimal (0) unsigned zerofill, -f161 decimal (64) unsigned zerofill, -f162 decimal (0,0), -f163 decimal (63,30), -f164 decimal (0,0) unsigned, -f165 decimal (63,30) unsigned, -f166 decimal (0,0) zerofill, -f167 decimal (63,30) zerofill, -f168 decimal (0,0) unsigned zerofill, -f169 decimal (63,30) unsigned zerofill, -f170 numeric, -f171 numeric unsigned, -f172 numeric zerofill, -f173 numeric unsigned zerofill, -f174 numeric (0), -f175 numeric (64) -) engine = innodb; -Warnings: -Note 1265 Data truncated for column 'f150' at row 1 -Note 1265 Data truncated for column 'f151' at row 1 -Note 1265 Data truncated for column 'f152' at row 1 -load data infile '/std_data_ln/funcs_1/innodb_tb3.txt' -into table tb3; -drop table if exists tb4; -create table tb4 ( -f176 numeric (0) unsigned not null DEFAULT 9, -f177 numeric (64) unsigned not null DEFAULT 9, -f178 numeric (0) zerofill not null DEFAULT 9, -f179 numeric (64) zerofill not null DEFAULT 9, -f180 numeric (0) unsigned zerofill not null DEFAULT 9, -f181 numeric (64) unsigned zerofill not null DEFAULT 9, -f182 numeric (0,0) not null DEFAULT 9, -f183 numeric (63,30) not null DEFAULT 9, -f184 numeric (0,0) unsigned not null DEFAULT 9, -f185 numeric (63,30) unsigned not null DEFAULT 9, -f186 numeric (0,0) zerofill not null DEFAULT 9, -f187 numeric (63,30) zerofill not null DEFAULT 9, -f188 numeric (0,0) unsigned zerofill not null DEFAULT 9, -f189 numeric (63,30) unsigned zerofill not null DEFAULT 9, -f190 real not null DEFAULT 88.8, -f191 real unsigned not null DEFAULT 88.8, -f192 real zerofill not null DEFAULT 88.8, -f193 real unsigned zerofill not null DEFAULT 88.8, -f194 double not null DEFAULT 55.5, -f195 double unsigned not null DEFAULT 55.5, -f196 double zerofill not null DEFAULT 55.5, -f197 double unsigned zerofill not null DEFAULT 55.5, -f198 float, -f199 float unsigned, -f200 float zerofill, -f201 float unsigned zerofill, -f202 float(0), -f203 float(23), -f204 float(0) unsigned, -f205 float(23) unsigned, -f206 float(0) zerofill, -f207 float(23) zerofill, -f208 float(0) unsigned zerofill, -f209 float(23) unsigned zerofill, -f210 float(24), -f211 float(53), -f212 float(24) unsigned, -f213 float(53) unsigned, -f214 float(24) zerofill, -f215 float(53) zerofill, -f216 float(24) unsigned zerofill, -f217 float(53) unsigned zerofill, -f218 date, -f219 time, -f220 datetime, -f221 timestamp, -f222 year, -f223 year(3), -f224 year(4), -f225 enum("1enum","2enum"), -f226 set("1set","2set"), -f235 char(0) unicode, -f236 char(90), -f237 char(255) ascii, -f238 varchar(0), -f239 varchar(20000) binary, -f240 varchar(2000) unicode, -f241 char(100) unicode -) engine = innodb; -load data infile '/std_data_ln/funcs_1/innodb_tb4.txt' -into table tb4; -USE test1; -drop table if exists tb2 ; -create table tb2 ( -f59 numeric (0) unsigned, -f60 numeric (64) unsigned, -f61 numeric (0) zerofill, -f62 numeric (64) zerofill, -f63 numeric (0) unsigned zerofill, -f64 numeric (64) unsigned zerofill, -f65 numeric (0,0), -f66 numeric (63,30), -f67 numeric (0,0) unsigned, -f68 numeric (63,30) unsigned, -f69 numeric (0,0) zerofill, -f70 numeric (63,30) zerofill, -f71 numeric (0,0) unsigned zerofill, -f72 numeric (63,30) unsigned zerofill, -f73 real, -f74 real unsigned, -f75 real zerofill, -f76 real unsigned zerofill, -f77 double default 7.7, -f78 double unsigned default 7.7, -f79 double zerofill default 7.7, -f80 double unsigned zerofill default 8.8, -f81 float not null default 8.8, -f82 float unsigned not null default 8.8, -f83 float zerofill not null default 8.8, -f84 float unsigned zerofill not null default 8.8, -f85 float(0) not null default 8.8, -f86 float(23) not null default 8.8, -f87 float(0) unsigned not null default 8.8, -f88 float(23) unsigned not null default 8.8, -f89 float(0) zerofill not null default 8.8, -f90 float(23) zerofill not null default 8.8, -f91 float(0) unsigned zerofill not null default 8.8, -f92 float(23) unsigned zerofill not null default 8.8, -f93 float(24) not null default 8.8, -f94 float(53) not null default 8.8, -f95 float(24) unsigned not null default 8.8, -f96 float(53) unsigned not null default 8.8, -f97 float(24) zerofill not null default 8.8, -f98 float(53) zerofill not null default 8.8, -f99 float(24) unsigned zerofill not null default 8.8, -f100 float(53) unsigned zerofill not null default 8.8, -f101 date not null default '2000-01-01', -f102 time not null default 20, -f103 datetime not null default '2/2/2', -f104 timestamp not null default 20001231235959, -f105 year not null default 2000, -f106 year(3) not null default 2000, -f107 year(4) not null default 2000, -f108 enum("1enum","2enum") not null default "1enum", -f109 set("1set","2set") not null default "1set" -) engine = innodb; -load data infile '/std_data_ln/funcs_1/innodb_tb2.txt' -into table tb2; -USE test; -USE test; -DROP TABLE IF EXISTS t1, t2, t4, t10, t11; -CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = InnoDB; -CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = InnoDB; -CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = InnoDB; -CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = InnoDB; -CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = InnoDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t1; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t2; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t4; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t10; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t11; -drop TABLE if exists t3; -CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = InnoDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t3.txt' INTO TABLE t3; -drop database if exists test4; -CREATE database test4; -use test4; -CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) -ENGINE = InnoDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t6; -use test; -drop TABLE if exists t7, t8; -CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB; -CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t7; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t8; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -drop TABLE if exists t9; -CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = InnoDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t9.txt' INTO TABLE t9; -DROP DATABASE IF EXISTS db_datadict; -CREATE DATABASE db_datadict; +CREATE DATABASE test2; +CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = ; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0 @@ -394,7 +18,7 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE InnoDB @@ -417,414 +41,7 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t2 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb1 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb3 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb4 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL TABLE_SCHEMA test1 -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test4 -TABLE_NAME t6 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -DROP USER testuser1@localhost; -CREATE USER testuser1@localhost; -GRANT SELECT ON db_datadict.* TO testuser1@localhost; -# Establish connection testuser1 (user=testuser1) -SELECT *, -LEFT( table_comment, -IF(INSTR(table_comment,'InnoDB free') = 0 -AND INSTR(table_comment,'number_of_replicas') = 0, -LENGTH(table_comment), -INSTR(table_comment,'InnoDB free') -+ INSTR(table_comment,'number_of_replicas') - 1)) -AS "user_comment", -'-----------------------------------------------------' AS "Separator" -FROM information_schema.tables -WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' -ORDER BY table_schema,table_name; -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t1 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE InnoDB @@ -847,8 +64,54 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 +TABLE_SCHEMA test2 +TABLE_NAME t1 +TABLE_TYPE BASE TABLE +ENGINE InnoDB +VERSION 10 +ROW_FORMAT Compact +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +Tables_in_test2 +t1 +DROP USER testuser1@localhost; +CREATE USER testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; +# Establish connection testuser1 (user=testuser1) +SELECT *, +LEFT( table_comment, +IF(INSTR(table_comment,'InnoDB free') = 0 +AND INSTR(table_comment,'number_of_replicas') = 0, +LENGTH(table_comment), +INSTR(table_comment,'InnoDB free') ++ INSTR(table_comment,'number_of_replicas') - 1)) +AS "user_comment", +'-----------------------------------------------------' AS "Separator" +FROM information_schema.tables +WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' +ORDER BY table_schema,table_name; +TABLE_CATALOG NULL +TABLE_SCHEMA test1 +TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE InnoDB VERSION 10 @@ -870,169 +133,8 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb1 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb3 -TABLE_TYPE BASE TABLE -ENGINE InnoDB -VERSION 10 -ROW_FORMAT Compact -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb4 +TABLE_SCHEMA test1 +TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE InnoDB VERSION 10 @@ -1053,21 +155,13 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2' # Switch to connection default and close connection testuser1 DROP USER testuser1@localhost; -DROP DATABASE db_datadict; DROP DATABASE test1; -DROP DATABASE test4; -DROP TABLE test.t1; -DROP TABLE test.t2; -DROP TABLE test.t3; -DROP TABLE test.t4; -DROP TABLE test.t7; -DROP TABLE test.t8; -DROP TABLE test.t9; -DROP TABLE test.t10; -DROP TABLE test.t11; -DROP TABLE test.tb1; -DROP TABLE test.tb2; -DROP TABLE test.tb3; -DROP TABLE test.tb4; +DROP DATABASE test2; diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result index 78193155e22..e651047e540 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is.result @@ -1,5 +1,5 @@ -DROP DATABASE IF EXISTS db_datadict; -CREATE DATABASE db_datadict; +DROP DATABASE IF EXISTS test1; +CREATE DATABASE test1; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0 @@ -383,7 +383,7 @@ user_comment Separator ----------------------------------------------------- DROP USER testuser1@localhost; CREATE USER testuser1@localhost; -GRANT SELECT ON db_datadict.* TO testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; # Establish connection testuser1 (user=testuser1) SELECT *, LEFT( table_comment, @@ -768,4 +768,4 @@ user_comment Separator ----------------------------------------------------- # Switch to connection default and close connection testuser1 DROP USER testuser1@localhost; -DROP DATABASE db_datadict; +DROP DATABASE test1; diff --git a/mysql-test/suite/funcs_1/r/is_tables_memory.result b/mysql-test/suite/funcs_1/r/is_tables_memory.result index bfc83fa1f92..561bf6e569f 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_memory.result +++ b/mysql-test/suite/funcs_1/r/is_tables_memory.result @@ -1,375 +1,11 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; CREATE DATABASE test1; -USE test; -drop table if exists tb1 ; -create table tb1 ( -f1 char, -f2 char binary, -f3 char ascii, -f12 binary, -f13 tinyint, -f14 tinyint unsigned, -f15 tinyint zerofill, -f16 tinyint unsigned zerofill, -f17 smallint, -f18 smallint unsigned, -f19 smallint zerofill, -f20 smallint unsigned zerofill, -f21 mediumint, -f22 mediumint unsigned, -f23 mediumint zerofill, -f24 mediumint unsigned zerofill, -f25 int, -f26 int unsigned, -f27 int zerofill, -f28 int unsigned zerofill, -f29 bigint, -f30 bigint unsigned, -f31 bigint zerofill, -f32 bigint unsigned zerofill, -f33 decimal not null DEFAULT 9.9, -f34 decimal unsigned not null DEFAULT 9.9, -f35 decimal zerofill not null DEFAULT 9.9, -f36 decimal unsigned zerofill not null DEFAULT 9.9, -f37 decimal (0) not null DEFAULT 9.9, -f38 decimal (64) not null DEFAULT 9.9, -f39 decimal (0) unsigned not null DEFAULT 9.9, -f40 decimal (64) unsigned not null DEFAULT 9.9, -f41 decimal (0) zerofill not null DEFAULT 9.9, -f42 decimal (64) zerofill not null DEFAULT 9.9, -f43 decimal (0) unsigned zerofill not null DEFAULT 9.9, -f44 decimal (64) unsigned zerofill not null DEFAULT 9.9, -f45 decimal (0,0) not null DEFAULT 9.9, -f46 decimal (63,30) not null DEFAULT 9.9, -f47 decimal (0,0) unsigned not null DEFAULT 9.9, -f48 decimal (63,30) unsigned not null DEFAULT 9.9, -f49 decimal (0,0) zerofill not null DEFAULT 9.9, -f50 decimal (63,30) zerofill not null DEFAULT 9.9, -f51 decimal (0,0) unsigned zerofill not null DEFAULT 9.9, -f52 decimal (63,30) unsigned zerofill not null DEFAULT 9.9, -f53 numeric not null DEFAULT 99, -f54 numeric unsigned not null DEFAULT 99, -f55 numeric zerofill not null DEFAULT 99, -f56 numeric unsigned zerofill not null DEFAULT 99, -f57 numeric (0) not null DEFAULT 99, -f58 numeric (64) not null DEFAULT 99 -) engine = memory; -Warnings: -Note 1265 Data truncated for column 'f33' at row 1 -Note 1265 Data truncated for column 'f34' at row 1 -Note 1265 Data truncated for column 'f35' at row 1 -Note 1265 Data truncated for column 'f36' at row 1 -Note 1265 Data truncated for column 'f37' at row 1 -Note 1265 Data truncated for column 'f38' at row 1 -Note 1265 Data truncated for column 'f39' at row 1 -Note 1265 Data truncated for column 'f40' at row 1 -Note 1265 Data truncated for column 'f41' at row 1 -Note 1265 Data truncated for column 'f42' at row 1 -Note 1265 Data truncated for column 'f43' at row 1 -Note 1265 Data truncated for column 'f44' at row 1 -Note 1265 Data truncated for column 'f45' at row 1 -Note 1265 Data truncated for column 'f47' at row 1 -Note 1265 Data truncated for column 'f49' at row 1 -Note 1265 Data truncated for column 'f51' at row 1 -load data infile '/std_data_ln/funcs_1/memory_tb1.txt' -into table tb1; -drop table if exists tb2 ; -create table tb2 ( -f59 numeric (0) unsigned, -f60 numeric (64) unsigned, -f61 numeric (0) zerofill, -f62 numeric (64) zerofill, -f63 numeric (0) unsigned zerofill, -f64 numeric (64) unsigned zerofill, -f65 numeric (0,0), -f66 numeric (63,30), -f67 numeric (0,0) unsigned, -f68 numeric (63,30) unsigned, -f69 numeric (0,0) zerofill, -f70 numeric (63,30) zerofill, -f71 numeric (0,0) unsigned zerofill, -f72 numeric (63,30) unsigned zerofill, -f73 real, -f74 real unsigned, -f75 real zerofill, -f76 real unsigned zerofill, -f77 double default 7.7, -f78 double unsigned default 7.7, -f79 double zerofill default 7.7, -f80 double unsigned zerofill default 8.8, -f81 float not null default 8.8, -f82 float unsigned not null default 8.8, -f83 float zerofill not null default 8.8, -f84 float unsigned zerofill not null default 8.8, -f85 float(0) not null default 8.8, -f86 float(23) not null default 8.8, -f87 float(0) unsigned not null default 8.8, -f88 float(23) unsigned not null default 8.8, -f89 float(0) zerofill not null default 8.8, -f90 float(23) zerofill not null default 8.8, -f91 float(0) unsigned zerofill not null default 8.8, -f92 float(23) unsigned zerofill not null default 8.8, -f93 float(24) not null default 8.8, -f94 float(53) not null default 8.8, -f95 float(24) unsigned not null default 8.8, -f96 float(53) unsigned not null default 8.8, -f97 float(24) zerofill not null default 8.8, -f98 float(53) zerofill not null default 8.8, -f99 float(24) unsigned zerofill not null default 8.8, -f100 float(53) unsigned zerofill not null default 8.8, -f101 date not null default '2000-01-01', -f102 time not null default 20, -f103 datetime not null default '2/2/2', -f104 timestamp not null default 20001231235959, -f105 year not null default 2000, -f106 year(3) not null default 2000, -f107 year(4) not null default 2000, -f108 enum("1enum","2enum") not null default "1enum", -f109 set("1set","2set") not null default "1set" -) engine = memory; -load data infile '/std_data_ln/funcs_1/memory_tb2.txt' -into table tb2 ; -drop table if exists tb3; -create table tb3 ( -f118 char not null DEFAULT 'a', -f119 char binary not null DEFAULT b'101', -f120 char ascii not null DEFAULT b'101', -f121 char(50), -f122 char(50), -f129 binary not null DEFAULT b'101', -f130 tinyint not null DEFAULT 99, -f131 tinyint unsigned not null DEFAULT 99, -f132 tinyint zerofill not null DEFAULT 99, -f133 tinyint unsigned zerofill not null DEFAULT 99, -f134 smallint not null DEFAULT 999, -f135 smallint unsigned not null DEFAULT 999, -f136 smallint zerofill not null DEFAULT 999, -f137 smallint unsigned zerofill not null DEFAULT 999, -f138 mediumint not null DEFAULT 9999, -f139 mediumint unsigned not null DEFAULT 9999, -f140 mediumint zerofill not null DEFAULT 9999, -f141 mediumint unsigned zerofill not null DEFAULT 9999, -f142 int not null DEFAULT 99999, -f143 int unsigned not null DEFAULT 99999, -f144 int zerofill not null DEFAULT 99999, -f145 int unsigned zerofill not null DEFAULT 99999, -f146 bigint not null DEFAULT 999999, -f147 bigint unsigned not null DEFAULT 999999, -f148 bigint zerofill not null DEFAULT 999999, -f149 bigint unsigned zerofill not null DEFAULT 999999, -f150 decimal not null DEFAULT 999.999, -f151 decimal unsigned not null DEFAULT 999.17, -f152 decimal zerofill not null DEFAULT 999.999, -f153 decimal unsigned zerofill, -f154 decimal (0), -f155 decimal (64), -f156 decimal (0) unsigned, -f157 decimal (64) unsigned, -f158 decimal (0) zerofill, -f159 decimal (64) zerofill, -f160 decimal (0) unsigned zerofill, -f161 decimal (64) unsigned zerofill, -f162 decimal (0,0), -f163 decimal (63,30), -f164 decimal (0,0) unsigned, -f165 decimal (63,30) unsigned, -f166 decimal (0,0) zerofill, -f167 decimal (63,30) zerofill, -f168 decimal (0,0) unsigned zerofill, -f169 decimal (63,30) unsigned zerofill, -f170 numeric, -f171 numeric unsigned, -f172 numeric zerofill, -f173 numeric unsigned zerofill, -f174 numeric (0), -f175 numeric (64) -) engine = memory; -Warnings: -Note 1265 Data truncated for column 'f150' at row 1 -Note 1265 Data truncated for column 'f151' at row 1 -Note 1265 Data truncated for column 'f152' at row 1 -load data infile '/std_data_ln/funcs_1/memory_tb3.txt' -into table tb3; -drop table if exists tb4 ; -create table tb4 ( -f176 numeric (0) unsigned not null DEFAULT 9, -f177 numeric (64) unsigned not null DEFAULT 9, -f178 numeric (0) zerofill not null DEFAULT 9, -f179 numeric (64) zerofill not null DEFAULT 9, -f180 numeric (0) unsigned zerofill not null DEFAULT 9, -f181 numeric (64) unsigned zerofill not null DEFAULT 9, -f182 numeric (0,0) not null DEFAULT 9, -f183 numeric (63,30) not null DEFAULT 9, -f184 numeric (0,0) unsigned not null DEFAULT 9, -f185 numeric (63,30) unsigned not null DEFAULT 9, -f186 numeric (0,0) zerofill not null DEFAULT 9, -f187 numeric (63,30) zerofill not null DEFAULT 9, -f188 numeric (0,0) unsigned zerofill not null DEFAULT 9, -f189 numeric (63,30) unsigned zerofill not null DEFAULT 9, -f190 real not null DEFAULT 88.8, -f191 real unsigned not null DEFAULT 88.8, -f192 real zerofill not null DEFAULT 88.8, -f193 real unsigned zerofill not null DEFAULT 88.8, -f194 double not null DEFAULT 55.5, -f195 double unsigned not null DEFAULT 55.5, -f196 double zerofill not null DEFAULT 55.5, -f197 double unsigned zerofill not null DEFAULT 55.5, -f198 float, -f199 float unsigned, -f200 float zerofill, -f201 float unsigned zerofill, -f202 float(0), -f203 float(23), -f204 float(0) unsigned, -f205 float(23) unsigned, -f206 float(0) zerofill, -f207 float(23) zerofill, -f208 float(0) unsigned zerofill, -f209 float(23) unsigned zerofill, -f210 float(24), -f211 float(53), -f212 float(24) unsigned, -f213 float(53) unsigned, -f214 float(24) zerofill, -f215 float(53) zerofill, -f216 float(24) unsigned zerofill, -f217 float(53) unsigned zerofill, -f218 date, -f219 time, -f220 datetime, -f221 timestamp, -f222 year, -f223 year(3), -f224 year(4), -f225 enum("1enum","2enum"), -f226 set("1set","2set"), -f236 char(95) unicode, -f241 char(255) unicode, -f237 char(130) binary, -f238 varchar(25000) binary, -f239 varbinary(0), -f240 varchar(1200) unicode -) engine = memory; -load data infile '/std_data_ln/funcs_1/memory_tb4.txt' -into table tb4; -USE test1; -drop table if exists tb2 ; -create table tb2 ( -f59 numeric (0) unsigned, -f60 numeric (64) unsigned, -f61 numeric (0) zerofill, -f62 numeric (64) zerofill, -f63 numeric (0) unsigned zerofill, -f64 numeric (64) unsigned zerofill, -f65 numeric (0,0), -f66 numeric (63,30), -f67 numeric (0,0) unsigned, -f68 numeric (63,30) unsigned, -f69 numeric (0,0) zerofill, -f70 numeric (63,30) zerofill, -f71 numeric (0,0) unsigned zerofill, -f72 numeric (63,30) unsigned zerofill, -f73 real, -f74 real unsigned, -f75 real zerofill, -f76 real unsigned zerofill, -f77 double default 7.7, -f78 double unsigned default 7.7, -f79 double zerofill default 7.7, -f80 double unsigned zerofill default 8.8, -f81 float not null default 8.8, -f82 float unsigned not null default 8.8, -f83 float zerofill not null default 8.8, -f84 float unsigned zerofill not null default 8.8, -f85 float(0) not null default 8.8, -f86 float(23) not null default 8.8, -f87 float(0) unsigned not null default 8.8, -f88 float(23) unsigned not null default 8.8, -f89 float(0) zerofill not null default 8.8, -f90 float(23) zerofill not null default 8.8, -f91 float(0) unsigned zerofill not null default 8.8, -f92 float(23) unsigned zerofill not null default 8.8, -f93 float(24) not null default 8.8, -f94 float(53) not null default 8.8, -f95 float(24) unsigned not null default 8.8, -f96 float(53) unsigned not null default 8.8, -f97 float(24) zerofill not null default 8.8, -f98 float(53) zerofill not null default 8.8, -f99 float(24) unsigned zerofill not null default 8.8, -f100 float(53) unsigned zerofill not null default 8.8, -f101 date not null default '2000-01-01', -f102 time not null default 20, -f103 datetime not null default '2/2/2', -f104 timestamp not null default 20001231235959, -f105 year not null default 2000, -f106 year(3) not null default 2000, -f107 year(4) not null default 2000, -f108 enum("1enum","2enum") not null default "1enum", -f109 set("1set","2set") not null default "1set" -) engine = memory; -load data infile '/std_data_ln/funcs_1/memory_tb2.txt' -into table tb2 ; -USE test; -USE test; -DROP TABLE IF EXISTS t1, t2, t4, t10, t11; -CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MEMORY; -CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MEMORY; -CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MEMORY; -CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MEMORY; -CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MEMORY; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t1; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t2; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t4; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t10; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t11; -drop TABLE if exists t3; -CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MEMORY; -LOAD DATA INFILE '/std_data_ln/funcs_1/t3.txt' INTO TABLE t3; -drop database if exists test4; -CREATE database test4; -use test4; -CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) -ENGINE = MEMORY; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t6; -use test; -drop TABLE if exists t7, t8; -CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY; -CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY; -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t7; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t8; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -drop TABLE if exists t9; -CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MEMORY; -LOAD DATA INFILE '/std_data_ln/funcs_1/t9.txt' INTO TABLE t9; -DROP DATABASE IF EXISTS db_datadict; -CREATE DATABASE db_datadict; +CREATE DATABASE test2; +CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = ; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0 @@ -383,7 +19,7 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE MEMORY @@ -406,414 +42,7 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t2 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb1 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb3 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb4 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL TABLE_SCHEMA test1 -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test4 -TABLE_NAME t6 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -DROP USER testuser1@localhost; -CREATE USER testuser1@localhost; -GRANT SELECT ON db_datadict.* TO testuser1@localhost; -# Establish connection testuser1 (user=testuser1) -SELECT *, -LEFT( table_comment, -IF(INSTR(table_comment,'InnoDB free') = 0 -AND INSTR(table_comment,'number_of_replicas') = 0, -LENGTH(table_comment), -INSTR(table_comment,'InnoDB free') -+ INSTR(table_comment,'number_of_replicas') - 1)) -AS "user_comment", -'-----------------------------------------------------' AS "Separator" -FROM information_schema.tables -WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' -ORDER BY table_schema,table_name; -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t1 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE MEMORY @@ -836,8 +65,54 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 +TABLE_SCHEMA test2 +TABLE_NAME t1 +TABLE_TYPE BASE TABLE +ENGINE MEMORY +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +Tables_in_test2 +t1 +DROP USER testuser1@localhost; +CREATE USER testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; +# Establish connection testuser1 (user=testuser1) +SELECT *, +LEFT( table_comment, +IF(INSTR(table_comment,'InnoDB free') = 0 +AND INSTR(table_comment,'number_of_replicas') = 0, +LENGTH(table_comment), +INSTR(table_comment,'InnoDB free') ++ INSTR(table_comment,'number_of_replicas') - 1)) +AS "user_comment", +'-----------------------------------------------------' AS "Separator" +FROM information_schema.tables +WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' +ORDER BY table_schema,table_name; +TABLE_CATALOG NULL +TABLE_SCHEMA test1 +TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE MEMORY VERSION 10 @@ -859,169 +134,8 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb1 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb3 -TABLE_TYPE BASE TABLE -ENGINE MEMORY -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb4 +TABLE_SCHEMA test1 +TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE MEMORY VERSION 10 @@ -1042,21 +156,13 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2' # Switch to connection default and close connection testuser1 DROP USER testuser1@localhost; -DROP DATABASE db_datadict; DROP DATABASE test1; -DROP DATABASE test4; -DROP TABLE test.t1; -DROP TABLE test.t2; -DROP TABLE test.t3; -DROP TABLE test.t4; -DROP TABLE test.t7; -DROP TABLE test.t8; -DROP TABLE test.t9; -DROP TABLE test.t10; -DROP TABLE test.t11; -DROP TABLE test.tb1; -DROP TABLE test.tb2; -DROP TABLE test.tb3; -DROP TABLE test.tb4; +DROP DATABASE test2; diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam.result b/mysql-test/suite/funcs_1/r/is_tables_myisam.result index 99d34818d98..0f476309303 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_tables_myisam.result @@ -1,415 +1,11 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; CREATE DATABASE test1; -USE test; -drop table if exists tb1 ; -create table tb1 ( -f1 char, -f2 char binary, -f3 char ascii, -f4 tinytext unicode, -f5 text, -f6 mediumtext, -f7 longtext, -f8 tinyblob, -f9 blob, -f10 mediumblob, -f11 longblob, -f12 binary, -f13 tinyint, -f14 tinyint unsigned, -f15 tinyint zerofill, -f16 tinyint unsigned zerofill, -f17 smallint, -f18 smallint unsigned, -f19 smallint zerofill, -f20 smallint unsigned zerofill, -f21 mediumint, -f22 mediumint unsigned, -f23 mediumint zerofill, -f24 mediumint unsigned zerofill, -f25 int, -f26 int unsigned, -f27 int zerofill, -f28 int unsigned zerofill, -f29 bigint, -f30 bigint unsigned, -f31 bigint zerofill, -f32 bigint unsigned zerofill, -f33 decimal not null DEFAULT 9.9, -f34 decimal unsigned not null DEFAULT 9.9, -f35 decimal zerofill not null DEFAULT 9.9, -f36 decimal unsigned zerofill not null DEFAULT 9.9, -f37 decimal (0) not null DEFAULT 9.9, -f38 decimal (64) not null DEFAULT 9.9, -f39 decimal (0) unsigned not null DEFAULT 9.9, -f40 decimal (64) unsigned not null DEFAULT 9.9, -f41 decimal (0) zerofill not null DEFAULT 9.9, -f42 decimal (64) zerofill not null DEFAULT 9.9, -f43 decimal (0) unsigned zerofill not null DEFAULT 9.9, -f44 decimal (64) unsigned zerofill not null DEFAULT 9.9, -f45 decimal (0,0) not null DEFAULT 9.9, -f46 decimal (63,30) not null DEFAULT 9.9, -f47 decimal (0,0) unsigned not null DEFAULT 9.9, -f48 decimal (63,30) unsigned not null DEFAULT 9.9, -f49 decimal (0,0) zerofill not null DEFAULT 9.9, -f50 decimal (63,30) zerofill not null DEFAULT 9.9, -f51 decimal (0,0) unsigned zerofill not null DEFAULT 9.9, -f52 decimal (63,30) unsigned zerofill not null DEFAULT 9.9, -f53 numeric not null DEFAULT 99, -f54 numeric unsigned not null DEFAULT 99, -f55 numeric zerofill not null DEFAULT 99, -f56 numeric unsigned zerofill not null DEFAULT 99, -f57 numeric (0) not null DEFAULT 99, -f58 numeric (64) not null DEFAULT 99 -) engine = myisam; -Warnings: -Note 1265 Data truncated for column 'f33' at row 1 -Note 1265 Data truncated for column 'f34' at row 1 -Note 1265 Data truncated for column 'f35' at row 1 -Note 1265 Data truncated for column 'f36' at row 1 -Note 1265 Data truncated for column 'f37' at row 1 -Note 1265 Data truncated for column 'f38' at row 1 -Note 1265 Data truncated for column 'f39' at row 1 -Note 1265 Data truncated for column 'f40' at row 1 -Note 1265 Data truncated for column 'f41' at row 1 -Note 1265 Data truncated for column 'f42' at row 1 -Note 1265 Data truncated for column 'f43' at row 1 -Note 1265 Data truncated for column 'f44' at row 1 -Note 1265 Data truncated for column 'f45' at row 1 -Note 1265 Data truncated for column 'f47' at row 1 -Note 1265 Data truncated for column 'f49' at row 1 -Note 1265 Data truncated for column 'f51' at row 1 -load data infile '/std_data_ln/funcs_1/myisam_tb1.txt' -into table tb1; -drop table if exists tb2 ; -create table tb2 ( -f59 numeric (0) unsigned, -f60 numeric (64) unsigned, -f61 numeric (0) zerofill, -f62 numeric (64) zerofill, -f63 numeric (0) unsigned zerofill, -f64 numeric (64) unsigned zerofill, -f65 numeric (0,0), -f66 numeric (63,30), -f67 numeric (0,0) unsigned, -f68 numeric (63,30) unsigned, -f69 numeric (0,0) zerofill, -f70 numeric (63,30) zerofill, -f71 numeric (0,0) unsigned zerofill, -f72 numeric (63,30) unsigned zerofill, -f73 real, -f74 real unsigned, -f75 real zerofill, -f76 real unsigned zerofill, -f77 double default 7.7, -f78 double unsigned default 7.7, -f79 double zerofill default 7.7, -f80 double unsigned zerofill default 8.8, -f81 float not null default 8.8, -f82 float unsigned not null default 8.8, -f83 float zerofill not null default 8.8, -f84 float unsigned zerofill not null default 8.8, -f85 float(0) not null default 8.8, -f86 float(23) not null default 8.8, -f87 float(0) unsigned not null default 8.8, -f88 float(23) unsigned not null default 8.8, -f89 float(0) zerofill not null default 8.8, -f90 float(23) zerofill not null default 8.8, -f91 float(0) unsigned zerofill not null default 8.8, -f92 float(23) unsigned zerofill not null default 8.8, -f93 float(24) not null default 8.8, -f94 float(53) not null default 8.8, -f95 float(24) unsigned not null default 8.8, -f96 float(53) unsigned not null default 8.8, -f97 float(24) zerofill not null default 8.8, -f98 float(53) zerofill not null default 8.8, -f99 float(24) unsigned zerofill not null default 8.8, -f100 float(53) unsigned zerofill not null default 8.8, -f101 date not null default '2000-01-01', -f102 time not null default 20, -f103 datetime not null default '2/2/2', -f104 timestamp not null default 20001231235959, -f105 year not null default 2000, -f106 year(3) not null default 2000, -f107 year(4) not null default 2000, -f108 enum("1enum","2enum") not null default "1enum", -f109 set("1set","2set") not null default "1set", -f110 VARBINARY(64) null, -f111 VARBINARY(27) null , -f112 VARBINARY(64) null , -f113 VARBINARY(192) null , -f114 VARBINARY(192) , -f115 VARBINARY(27) null , -f116 VARBINARY(64) null, -f117 VARBINARY(192) null -) engine = myisam; -load data infile '/std_data_ln/funcs_1/myisam_tb2.txt' -into table tb2; -drop table if exists tb3 ; -create table tb3 ( -f118 char not null DEFAULT 'a', -f119 char binary not null DEFAULT b'101', -f120 char ascii not null DEFAULT b'101', -f121 tinytext, -f122 text, -f123 mediumtext, -f124 longtext unicode, -f125 tinyblob, -f126 blob, -f127 mediumblob, -f128 longblob, -f129 binary not null DEFAULT b'101', -f130 tinyint not null DEFAULT 99, -f131 tinyint unsigned not null DEFAULT 99, -f132 tinyint zerofill not null DEFAULT 99, -f133 tinyint unsigned zerofill not null DEFAULT 99, -f134 smallint not null DEFAULT 999, -f135 smallint unsigned not null DEFAULT 999, -f136 smallint zerofill not null DEFAULT 999, -f137 smallint unsigned zerofill not null DEFAULT 999, -f138 mediumint not null DEFAULT 9999, -f139 mediumint unsigned not null DEFAULT 9999, -f140 mediumint zerofill not null DEFAULT 9999, -f141 mediumint unsigned zerofill not null DEFAULT 9999, -f142 int not null DEFAULT 99999, -f143 int unsigned not null DEFAULT 99999, -f144 int zerofill not null DEFAULT 99999, -f145 int unsigned zerofill not null DEFAULT 99999, -f146 bigint not null DEFAULT 999999, -f147 bigint unsigned not null DEFAULT 999999, -f148 bigint zerofill not null DEFAULT 999999, -f149 bigint unsigned zerofill not null DEFAULT 999999, -f150 decimal not null DEFAULT 999.999, -f151 decimal unsigned not null DEFAULT 999.17, -f152 decimal zerofill not null DEFAULT 999.999, -f153 decimal unsigned zerofill, -f154 decimal (0), -f155 decimal (64), -f156 decimal (0) unsigned, -f157 decimal (64) unsigned, -f158 decimal (0) zerofill, -f159 decimal (64) zerofill, -f160 decimal (0) unsigned zerofill, -f161 decimal (64) unsigned zerofill, -f162 decimal (0,0), -f163 decimal (63,30), -f164 decimal (0,0) unsigned, -f165 decimal (63,30) unsigned, -f166 decimal (0,0) zerofill, -f167 decimal (63,30) zerofill, -f168 decimal (0,0) unsigned zerofill, -f169 decimal (63,30) unsigned zerofill, -f170 numeric, -f171 numeric unsigned, -f172 numeric zerofill, -f173 numeric unsigned zerofill, -f174 numeric (0), -f175 numeric (64) -) Engine = myisam; -Warnings: -Note 1265 Data truncated for column 'f150' at row 1 -Note 1265 Data truncated for column 'f151' at row 1 -Note 1265 Data truncated for column 'f152' at row 1 -load data infile '/std_data_ln/funcs_1/myisam_tb3.txt' -into table tb3; -drop table if exists tb4 ; -create table tb4 ( -f176 numeric (0) unsigned not null DEFAULT 9, -f177 numeric (64) unsigned not null DEFAULT 9, -f178 numeric (0) zerofill not null DEFAULT 9, -f179 numeric (64) zerofill not null DEFAULT 9, -f180 numeric (0) unsigned zerofill not null DEFAULT 9, -f181 numeric (64) unsigned zerofill not null DEFAULT 9, -f182 numeric (0,0) not null DEFAULT 9, -f183 numeric (63,30) not null DEFAULT 9, -f184 numeric (0,0) unsigned not null DEFAULT 9, -f185 numeric (63,30) unsigned not null DEFAULT 9, -f186 numeric (0,0) zerofill not null DEFAULT 9, -f187 numeric (63,30) zerofill not null DEFAULT 9, -f188 numeric (0,0) unsigned zerofill not null DEFAULT 9, -f189 numeric (63,30) unsigned zerofill not null DEFAULT 9, -f190 real not null DEFAULT 88.8, -f191 real unsigned not null DEFAULT 88.8, -f192 real zerofill not null DEFAULT 88.8, -f193 real unsigned zerofill not null DEFAULT 88.8, -f194 double not null DEFAULT 55.5, -f195 double unsigned not null DEFAULT 55.5, -f196 double zerofill not null DEFAULT 55.5, -f197 double unsigned zerofill not null DEFAULT 55.5, -f198 float, -f199 float unsigned, -f200 float zerofill, -f201 float unsigned zerofill, -f202 float(0), -f203 float(23), -f204 float(0) unsigned, -f205 float(23) unsigned, -f206 float(0) zerofill, -f207 float(23) zerofill, -f208 float(0) unsigned zerofill, -f209 float(23) unsigned zerofill, -f210 float(24), -f211 float(53), -f212 float(24) unsigned, -f213 float(53) unsigned, -f214 float(24) zerofill, -f215 float(53) zerofill, -f216 float(24) unsigned zerofill, -f217 float(53) unsigned zerofill, -f218 date, -f219 time, -f220 datetime, -f221 timestamp, -f222 year, -f223 year(3), -f224 year(4), -f225 enum("1enum","2enum"), -f226 set("1set","2set"), -f227 VARBINARY(64), -f228 VARBINARY(27), -f229 VARBINARY(64), -f230 VARBINARY(192), -f231 VARBINARY(192), -f232 VARBINARY(27), -f233 VARBINARY(64), -f234 VARBINARY(192), -f235 char(255) unicode, -f236 char(60) ascii, -f237 char(255) binary, -f238 varchar(0) binary, -f239 varbinary(1000), -f240 varchar(120) unicode, -f241 char(100) unicode, -f242 bit(30) -) engine = myisam; -load data infile '/std_data_ln/funcs_1/myisam_tb4.txt' -into table tb4; -USE test1; -drop table if exists tb2 ; -create table tb2 ( -f59 numeric (0) unsigned, -f60 numeric (64) unsigned, -f61 numeric (0) zerofill, -f62 numeric (64) zerofill, -f63 numeric (0) unsigned zerofill, -f64 numeric (64) unsigned zerofill, -f65 numeric (0,0), -f66 numeric (63,30), -f67 numeric (0,0) unsigned, -f68 numeric (63,30) unsigned, -f69 numeric (0,0) zerofill, -f70 numeric (63,30) zerofill, -f71 numeric (0,0) unsigned zerofill, -f72 numeric (63,30) unsigned zerofill, -f73 real, -f74 real unsigned, -f75 real zerofill, -f76 real unsigned zerofill, -f77 double default 7.7, -f78 double unsigned default 7.7, -f79 double zerofill default 7.7, -f80 double unsigned zerofill default 8.8, -f81 float not null default 8.8, -f82 float unsigned not null default 8.8, -f83 float zerofill not null default 8.8, -f84 float unsigned zerofill not null default 8.8, -f85 float(0) not null default 8.8, -f86 float(23) not null default 8.8, -f87 float(0) unsigned not null default 8.8, -f88 float(23) unsigned not null default 8.8, -f89 float(0) zerofill not null default 8.8, -f90 float(23) zerofill not null default 8.8, -f91 float(0) unsigned zerofill not null default 8.8, -f92 float(23) unsigned zerofill not null default 8.8, -f93 float(24) not null default 8.8, -f94 float(53) not null default 8.8, -f95 float(24) unsigned not null default 8.8, -f96 float(53) unsigned not null default 8.8, -f97 float(24) zerofill not null default 8.8, -f98 float(53) zerofill not null default 8.8, -f99 float(24) unsigned zerofill not null default 8.8, -f100 float(53) unsigned zerofill not null default 8.8, -f101 date not null default '2000-01-01', -f102 time not null default 20, -f103 datetime not null default '2/2/2', -f104 timestamp not null default 20001231235959, -f105 year not null default 2000, -f106 year(3) not null default 2000, -f107 year(4) not null default 2000, -f108 enum("1enum","2enum") not null default "1enum", -f109 set("1set","2set") not null default "1set", -f110 VARBINARY(64) null, -f111 VARBINARY(27) null , -f112 VARBINARY(64) null , -f113 VARBINARY(192) null , -f114 VARBINARY(192) , -f115 VARBINARY(27) null , -f116 VARBINARY(64) null, -f117 VARBINARY(192) null -) engine = myisam; -load data infile '/std_data_ln/funcs_1/myisam_tb2.txt' -into table tb2; -USE test; -USE test; -DROP TABLE IF EXISTS t1, t2, t4, t10, t11; -CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MyISAM; -CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MyISAM; -CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MyISAM; -CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MyISAM; -CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = MyISAM; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t1; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t2; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t4; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t10; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t11; -drop TABLE if exists t3; -CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MyISAM; -LOAD DATA INFILE '/std_data_ln/funcs_1/t3.txt' INTO TABLE t3; -drop database if exists test4; -CREATE database test4; -use test4; -CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) -ENGINE = MyISAM; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t6; -use test; -drop TABLE if exists t7, t8; -CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM; -CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM; -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t7; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t8; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -drop TABLE if exists t9; -CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MyISAM; -LOAD DATA INFILE '/std_data_ln/funcs_1/t9.txt' INTO TABLE t9; -DROP DATABASE IF EXISTS db_datadict; -CREATE DATABASE db_datadict; +CREATE DATABASE test2; +CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = ; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0 @@ -423,287 +19,11 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t2 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb1 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Dynamic -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Dynamic -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb3 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Dynamic -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb4 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -723,7 +43,7 @@ user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL TABLE_SCHEMA test1 -TABLE_NAME tb2 +TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 @@ -745,12 +65,12 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test4 -TABLE_NAME t6 +TABLE_SCHEMA test2 +TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -767,9 +87,16 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +Tables_in_test2 +t1 DROP USER testuser1@localhost; CREATE USER testuser1@localhost; -GRANT SELECT ON db_datadict.* TO testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; # Establish connection testuser1 (user=testuser1) SELECT *, LEFT( table_comment, @@ -784,12 +111,12 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -807,264 +134,11 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE MyISAM VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb1 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Dynamic -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb2 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Dynamic -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb3 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 -ROW_FORMAT Dynamic -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME tb4 -TABLE_TYPE BASE TABLE -ENGINE MyISAM -VERSION 10 ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# @@ -1082,21 +156,13 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2' # Switch to connection default and close connection testuser1 DROP USER testuser1@localhost; -DROP DATABASE db_datadict; DROP DATABASE test1; -DROP DATABASE test4; -DROP TABLE test.t1; -DROP TABLE test.t2; -DROP TABLE test.t3; -DROP TABLE test.t4; -DROP TABLE test.t7; -DROP TABLE test.t8; -DROP TABLE test.t9; -DROP TABLE test.t10; -DROP TABLE test.t11; -DROP TABLE test.tb1; -DROP TABLE test.tb2; -DROP TABLE test.tb3; -DROP TABLE test.tb4; +DROP DATABASE test2; diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result new file mode 100644 index 00000000000..25c482bb73c --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result @@ -0,0 +1,192 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; +CREATE DATABASE test1; +CREATE DATABASE test2; +CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = ; +SELECT *, +LEFT( table_comment, +IF(INSTR(table_comment,'InnoDB free') = 0 +AND INSTR(table_comment,'number_of_replicas') = 0, +LENGTH(table_comment), +INSTR(table_comment,'InnoDB free') ++ INSTR(table_comment,'number_of_replicas') - 1)) +AS "user_comment", +'-----------------------------------------------------' AS "Separator" +FROM information_schema.tables +WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' +ORDER BY table_schema,table_name; +TABLE_CATALOG NULL +TABLE_SCHEMA test1 +TABLE_NAME t1 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test1 +TABLE_NAME t2 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test2 +TABLE_NAME t1 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +Tables_in_test2 +t1 +DROP USER testuser1@localhost; +CREATE USER testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; +# Establish connection testuser1 (user=testuser1) +SELECT *, +LEFT( table_comment, +IF(INSTR(table_comment,'InnoDB free') = 0 +AND INSTR(table_comment,'number_of_replicas') = 0, +LENGTH(table_comment), +INSTR(table_comment,'InnoDB free') ++ INSTR(table_comment,'number_of_replicas') - 1)) +AS "user_comment", +'-----------------------------------------------------' AS "Separator" +FROM information_schema.tables +WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' +ORDER BY table_schema,table_name; +TABLE_CATALOG NULL +TABLE_SCHEMA test1 +TABLE_NAME t1 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test1 +TABLE_NAME t2 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA test2 +TABLE_NAME t1 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +Tables_in_test2 +t1 +# Switch to connection default and close connection testuser1 +DROP USER testuser1@localhost; +DROP DATABASE test1; +DROP DATABASE test2; diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result index d407f224b7d..49a4267d170 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result @@ -1,5 +1,5 @@ -DROP DATABASE IF EXISTS db_datadict; -CREATE DATABASE db_datadict; +DROP DATABASE IF EXISTS test1; +CREATE DATABASE test1; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0 @@ -405,7 +405,7 @@ user_comment Users and global privileges Separator ----------------------------------------------------- DROP USER testuser1@localhost; CREATE USER testuser1@localhost; -GRANT SELECT ON db_datadict.* TO testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; # Establish connection testuser1 (user=testuser1) SELECT *, LEFT( table_comment, @@ -421,4 +421,4 @@ WHERE table_schema = 'mysql' ORDER BY table_schema,table_name; # Switch to connection default and close connection testuser1 DROP USER testuser1@localhost; -DROP DATABASE db_datadict; +DROP DATABASE test1; diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result new file mode 100644 index 00000000000..e5416555189 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result @@ -0,0 +1,815 @@ +DROP DATABASE IF EXISTS test1; +CREATE DATABASE test1; +SELECT *, +LEFT( table_comment, +IF(INSTR(table_comment,'InnoDB free') = 0 +AND INSTR(table_comment,'number_of_replicas') = 0, +LENGTH(table_comment), +INSTR(table_comment,'InnoDB free') ++ INSTR(table_comment,'number_of_replicas') - 1)) +AS "user_comment", +'-----------------------------------------------------' AS "Separator" +FROM information_schema.tables +WHERE table_schema = 'mysql' +ORDER BY table_schema,table_name; +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME columns_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Column privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME db +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Database privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME func +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment User defined functions +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment help categories +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment help keywords +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment keyword-topic relation +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment help topics +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME host +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Host privileges; Merged with database privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME proc +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Stored Procedures +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME procs_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Procedure privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME tables_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Table privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT 6 +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zones +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_leap_second +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Leap seconds information for time zones +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_name +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zone names +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_transition +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zone transitions +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_transition_type +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zone transition types +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME user +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Users and global privileges +Separator ----------------------------------------------------- +DROP USER testuser1@localhost; +CREATE USER testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; +# Establish connection testuser1 (user=testuser1) +SELECT *, +LEFT( table_comment, +IF(INSTR(table_comment,'InnoDB free') = 0 +AND INSTR(table_comment,'number_of_replicas') = 0, +LENGTH(table_comment), +INSTR(table_comment,'InnoDB free') ++ INSTR(table_comment,'number_of_replicas') - 1)) +AS "user_comment", +'-----------------------------------------------------' AS "Separator" +FROM information_schema.tables +WHERE table_schema = 'mysql' +ORDER BY table_schema,table_name; +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME columns_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Column privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME db +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Database privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME func +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment User defined functions +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment help categories +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment help keywords +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment keyword-topic relation +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment help topics +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME host +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Host privileges; Merged with database privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME proc +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Stored Procedures +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME procs_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Procedure privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME tables_priv +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Table privileges +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT 6 +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zones +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_leap_second +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Leap seconds information for time zones +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_name +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zone names +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_transition +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zone transitions +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME time_zone_transition_type +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Time zone transition types +Separator ----------------------------------------------------- +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME user +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_bin +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment Users and global privileges +Separator ----------------------------------------------------- +# Switch to connection default and close connection testuser1 +DROP USER testuser1@localhost; +DROP DATABASE test1; diff --git a/mysql-test/suite/funcs_1/r/is_tables_ndb.result b/mysql-test/suite/funcs_1/r/is_tables_ndb.result index 467f4566912..4ce150353c1 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_ndb.result +++ b/mysql-test/suite/funcs_1/r/is_tables_ndb.result @@ -1,66 +1,10 @@ DROP DATABASE IF EXISTS test1; +DROP DATABASE IF EXISTS test2; CREATE DATABASE test1; -USE test; -USE test; -USE test; -DROP TABLE IF EXISTS t1, t2, t4, t10, t11; -CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = NDB; -CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = NDB; -CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = NDB; -CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = NDB; -CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) -ENGINE = NDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t1; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t2; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t4; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t10; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t11; -drop TABLE if exists t3; -CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = NDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t3.txt' INTO TABLE t3; -drop database if exists test4; -CREATE database test4; -use test4; -CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) -ENGINE = NDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t4.txt' INTO TABLE t6; -use test; -drop TABLE if exists t7, t8; -CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = NDB; -CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = NDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t7; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -LOAD DATA INFILE '/std_data_ln/funcs_1/t7.txt' INTO TABLE t8; -Warnings: -Warning 1265 Data truncated for column 'f3' at row 1 -Warning 1265 Data truncated for column 'f3' at row 2 -Warning 1265 Data truncated for column 'f3' at row 3 -Warning 1265 Data truncated for column 'f3' at row 4 -Warning 1265 Data truncated for column 'f3' at row 5 -Warning 1265 Data truncated for column 'f3' at row 6 -Warning 1265 Data truncated for column 'f3' at row 7 -Warning 1265 Data truncated for column 'f3' at row 8 -Warning 1265 Data truncated for column 'f3' at row 9 -Warning 1265 Data truncated for column 'f3' at row 10 -drop TABLE if exists t9; -CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = NDB; -LOAD DATA INFILE '/std_data_ln/funcs_1/t9.txt' INTO TABLE t9; -DROP DATABASE IF EXISTS db_datadict; -CREATE DATABASE db_datadict; +CREATE DATABASE test2; +CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = ; +CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = ; SELECT *, LEFT( table_comment, IF(INSTR(table_comment,'InnoDB free') = 0 @@ -74,12 +18,12 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE ndbcluster VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -97,58 +41,12 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE ndbcluster VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -166,127 +64,12 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 +TABLE_SCHEMA test2 +TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE ndbcluster VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test4 -TABLE_NAME t6 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -303,9 +86,16 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +Tables_in_test2 +t1 DROP USER testuser1@localhost; CREATE USER testuser1@localhost; -GRANT SELECT ON db_datadict.* TO testuser1@localhost; +GRANT SELECT ON test1.* TO testuser1@localhost; # Establish connection testuser1 (user=testuser1) SELECT *, LEFT( table_comment, @@ -320,12 +110,12 @@ FROM information_schema.tables WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE' ORDER BY table_schema,table_name; TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t1 TABLE_TYPE BASE TABLE ENGINE ndbcluster VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -343,196 +133,12 @@ TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t10 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t11 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test +TABLE_SCHEMA test1 TABLE_NAME t2 TABLE_TYPE BASE TABLE ENGINE ndbcluster VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t3 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t4 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t7 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t8 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test -TABLE_NAME t9 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed -TABLE_ROWS #TBLR# -AVG_ROW_LENGTH #ARL# -DATA_LENGTH #DL# -MAX_DATA_LENGTH #MDL# -INDEX_LENGTH #IL# -DATA_FREE #DF# -AUTO_INCREMENT NULL -CREATE_TIME #CRT# -UPDATE_TIME #UT# -CHECK_TIME #CT# -TABLE_COLLATION latin1_swedish_ci -CHECKSUM NULL -CREATE_OPTIONS #CO# -TABLE_COMMENT #TC# -user_comment -Separator ----------------------------------------------------- -TABLE_CATALOG NULL -TABLE_SCHEMA test4 -TABLE_NAME t6 -TABLE_TYPE BASE TABLE -ENGINE ndbcluster -VERSION 10 -ROW_FORMAT Fixed +ROW_FORMAT Dynamic TABLE_ROWS #TBLR# AVG_ROW_LENGTH #ARL# DATA_LENGTH #DL# @@ -549,17 +155,13 @@ CREATE_OPTIONS #CO# TABLE_COMMENT #TC# user_comment Separator ----------------------------------------------------- +SHOW TABLES FROM test1; +Tables_in_test1 +t1 +t2 +SHOW TABLES FROM test2; +ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2' # Switch to connection default and close connection testuser1 DROP USER testuser1@localhost; -DROP DATABASE db_datadict; DROP DATABASE test1; -DROP DATABASE test4; -DROP TABLE test.t1; -DROP TABLE test.t2; -DROP TABLE test.t3; -DROP TABLE test.t4; -DROP TABLE test.t7; -DROP TABLE test.t8; -DROP TABLE test.t9; -DROP TABLE test.t10; -DROP TABLE test.t11; +DROP DATABASE test2; diff --git a/mysql-test/suite/funcs_1/r/is_triggers_embedded.result b/mysql-test/suite/funcs_1/r/is_triggers_embedded.result new file mode 100644 index 00000000000..5e0c7601da7 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_triggers_embedded.result @@ -0,0 +1,208 @@ +SHOW TABLES FROM information_schema LIKE 'TRIGGERS'; +Tables_in_information_schema (TRIGGERS) +TRIGGERS +####################################################################### +# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +####################################################################### +DROP VIEW IF EXISTS test.v1; +DROP PROCEDURE IF EXISTS test.p1; +DROP FUNCTION IF EXISTS test.f1; +CREATE VIEW test.v1 AS SELECT * FROM information_schema.TRIGGERS; +CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TRIGGERS; +CREATE FUNCTION test.f1() returns BIGINT +BEGIN +DECLARE counter BIGINT DEFAULT NULL; +SELECT COUNT(*) INTO counter FROM information_schema.TRIGGERS; +RETURN counter; +END// +# Attention: The printing of the next result sets is disabled. +SELECT * FROM information_schema.TRIGGERS; +SELECT * FROM test.v1; +CALL test.p1; +SELECT test.f1(); +DROP VIEW test.v1; +DROP PROCEDURE test.p1; +DROP FUNCTION test.f1; +######################################################################### +# Testcase 3.2.12.1: INFORMATION_SCHEMA.TRIGGERS layout +######################################################################### +DESCRIBE information_schema.TRIGGERS; +Field Type Null Key Default Extra +TRIGGER_CATALOG varchar(512) YES NULL +TRIGGER_SCHEMA varchar(64) NO +TRIGGER_NAME varchar(64) NO +EVENT_MANIPULATION varchar(6) NO +EVENT_OBJECT_CATALOG varchar(512) YES NULL +EVENT_OBJECT_SCHEMA varchar(64) NO +EVENT_OBJECT_TABLE varchar(64) NO +ACTION_ORDER bigint(4) NO 0 +ACTION_CONDITION longtext YES NULL +ACTION_STATEMENT longtext NO NULL +ACTION_ORIENTATION varchar(9) NO +ACTION_TIMING varchar(6) NO +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 +CREATED datetime YES NULL +SQL_MODE longtext NO NULL +DEFINER longtext NO NULL +SHOW CREATE TABLE information_schema.TRIGGERS; +Table Create Table +TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( + `TRIGGER_CATALOG` varchar(512) default NULL, + `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) default NULL, + `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, + `ACTION_STATEMENT` longtext NOT NULL, + `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 default NULL, + `SQL_MODE` longtext NOT NULL, + `DEFINER` longtext NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW COLUMNS FROM information_schema.TRIGGERS; +Field Type Null Key Default Extra +TRIGGER_CATALOG varchar(512) YES NULL +TRIGGER_SCHEMA varchar(64) NO +TRIGGER_NAME varchar(64) NO +EVENT_MANIPULATION varchar(6) NO +EVENT_OBJECT_CATALOG varchar(512) YES NULL +EVENT_OBJECT_SCHEMA varchar(64) NO +EVENT_OBJECT_TABLE varchar(64) NO +ACTION_ORDER bigint(4) NO 0 +ACTION_CONDITION longtext YES NULL +ACTION_STATEMENT longtext NO NULL +ACTION_ORIENTATION varchar(9) NO +ACTION_TIMING varchar(6) NO +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 +CREATED datetime YES NULL +SQL_MODE longtext NO NULL +DEFINER longtext 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 +OR action_reference_new_table IS NOT NULL; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER +################################################################################## +# Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information +################################################################################## +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +CREATE USER 'testuser3'@'localhost'; +DROP USER 'testuser4'@'localhost'; +CREATE USER 'testuser4'@'localhost'; +GRANT SUPER ON *.* TO 'testuser1'@'localhost'; +GRANT SUPER ON *.* TO 'testuser3'@'localhost'; +GRANT SUPER ON *.* TO 'testuser4'@'localhost'; +GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; +# Establish connection testuser1 (user=testuser1) +CREATE TABLE db_datadict.t1 (f1 INT, f2 INT, f3 INT) +ENGINE = ; +CREATE TRIGGER trg1 BEFORE INSERT +ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before; +GRANT ALL ON db_datadict.t1 TO 'testuser2'@'localhost'; +GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost'; +SELECT * FROM information_schema.triggers +WHERE trigger_name = 'trg1'; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER +NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost +SHOW TRIGGERS FROM db_datadict; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost +# Establish connection testuser2 (user=testuser2) +SHOW GRANTS FOR 'testuser2'@'localhost'; +# No SUPER Privilege --> no result for query +SELECT * FROM information_schema.triggers +WHERE trigger_name = 'trg1'; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER +NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost +SHOW TRIGGERS FROM db_datadict; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost +# Establish connection testuser3 (user=testuser3) +SHOW GRANTS FOR 'testuser3'@'localhost'; +# SUPER Privilege + SELECT Privilege on t1 --> result for query +SELECT * FROM information_schema.triggers +WHERE trigger_name = 'trg1'; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER +NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost +SHOW TRIGGERS FROM db_datadict; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost +# Establish connection testuser4 (user=testuser4) +SHOW GRANTS FOR 'testuser4'@'localhost'; +# SUPER Privilege + no SELECT Privilege on t1 --> no result for query +SELECT * FROM information_schema.triggers +WHERE trigger_name = 'trg1'; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER +NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost +SHOW TRIGGERS FROM db_datadict; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost +# Switch to connection default and close connections testuser1 - testuser4 +SELECT * FROM information_schema.triggers +WHERE trigger_name = 'trg1'; +TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER +NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost +SHOW TRIGGERS FROM db_datadict; +Trigger Event Table Statement Timing Created sql_mode Definer +trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'testuser3'@'localhost'; +DROP USER 'testuser4'@'localhost'; +DROP DATABASE db_datadict; +######################################################################### +# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TRIGGERS modifications +######################################################################### +######################################################################## +# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +# DDL on INFORMATION_SCHEMA tables are not supported +######################################################################## +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +CREATE TABLE db_datadict.t1 (f1 BIGINT) +ENGINE = ; +CREATE TRIGGER db_datadict.trg1 BEFORE INSERT +ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before; +INSERT INTO information_schema.triggers +SELECT * FROM information_schema.triggers; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +UPDATE information_schema.triggers SET trigger_schema = 'test' +WHERE table_name = 't1'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DELETE FROM information_schema.triggers WHERE trigger_name = 't1'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE information_schema.triggers; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +CREATE INDEX my_idx_on_triggers ON information_schema.triggers(trigger_schema); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.triggers DROP PRIMARY KEY; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.triggers ADD f1 INT; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP TABLE information_schema.triggers; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.triggers RENAME db_datadict.triggers; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/r/is_views_embedded.result b/mysql-test/suite/funcs_1/r/is_views_embedded.result new file mode 100644 index 00000000000..21f799fca79 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/is_views_embedded.result @@ -0,0 +1,241 @@ +SHOW TABLES FROM information_schema LIKE 'VIEWS'; +Tables_in_information_schema (VIEWS) +VIEWS +####################################################################### +# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT +####################################################################### +DROP VIEW IF EXISTS test.v1; +DROP PROCEDURE IF EXISTS test.p1; +DROP FUNCTION IF EXISTS test.f1; +CREATE VIEW test.v1 AS SELECT * FROM information_schema.VIEWS; +CREATE PROCEDURE test.p1() SELECT * FROM information_schema.VIEWS; +CREATE FUNCTION test.f1() returns BIGINT +BEGIN +DECLARE counter BIGINT DEFAULT NULL; +SELECT COUNT(*) INTO counter FROM information_schema.VIEWS; +RETURN counter; +END// +# Attention: The printing of the next result sets is disabled. +SELECT * FROM information_schema.VIEWS; +SELECT * FROM test.v1; +CALL test.p1; +SELECT test.f1(); +DROP VIEW test.v1; +DROP PROCEDURE test.p1; +DROP FUNCTION test.f1; +######################################################################### +# Testcase 3.2.13.1: INFORMATION_SCHEMA.VIEWS layout +######################################################################### +DESCRIBE information_schema.VIEWS; +Field Type Null Key Default Extra +TABLE_CATALOG varchar(512) YES NULL +TABLE_SCHEMA varchar(64) NO +TABLE_NAME varchar(64) NO +VIEW_DEFINITION longtext NO NULL +CHECK_OPTION varchar(8) NO +IS_UPDATABLE varchar(3) NO +DEFINER varchar(77) NO +SECURITY_TYPE varchar(7) NO +SHOW CREATE TABLE information_schema.VIEWS; +Table Create Table +VIEWS CREATE TEMPORARY TABLE `VIEWS` ( + `TABLE_CATALOG` varchar(512) default NULL, + `TABLE_SCHEMA` varchar(64) NOT NULL default '', + `TABLE_NAME` varchar(64) NOT NULL default '', + `VIEW_DEFINITION` longtext NOT NULL, + `CHECK_OPTION` varchar(8) NOT NULL default '', + `IS_UPDATABLE` varchar(3) NOT NULL default '', + `DEFINER` varchar(77) NOT NULL default '', + `SECURITY_TYPE` varchar(7) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW COLUMNS FROM information_schema.VIEWS; +Field Type Null Key Default Extra +TABLE_CATALOG varchar(512) YES NULL +TABLE_SCHEMA varchar(64) NO +TABLE_NAME varchar(64) NO +VIEW_DEFINITION longtext NO NULL +CHECK_OPTION varchar(8) NO +IS_UPDATABLE varchar(3) NO +DEFINER varchar(77) NO +SECURITY_TYPE varchar(7) NO +SELECT table_catalog, table_schema, table_name +FROM information_schema.views WHERE table_catalog IS NOT NULL; +table_catalog table_schema table_name +################################################################################ +# Testcase 3.2.13.2 + 3.2.13.3: INFORMATION_SCHEMA.VIEWS accessible information +################################################################################ +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +CREATE USER 'testuser2'@'localhost'; +DROP USER 'test_no_views'@'localhost'; +CREATE USER 'test_no_views'@'localhost'; +CREATE TABLE db_datadict.t1(f1 INT, f2 INT, f3 INT) +ENGINE = ; +CREATE VIEW db_datadict.v_granted_to_1 AS SELECT * FROM db_datadict.t1; +CREATE VIEW db_datadict.v_granted_glob AS SELECT f2, f3 FROM db_datadict.t1; +GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost'; +GRANT SELECT ON db_datadict.v_granted_to_1 TO 'testuser1'@'localhost'; +GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost'; +SELECT * FROM information_schema.views +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE +NULL db_datadict v_granted_glob /* ALGORITHM=UNDEFINED */ select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER +NULL db_datadict v_granted_to_1 /* ALGORITHM=UNDEFINED */ select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER +# Establish connection testuser1 (user=testuser1) +SELECT * FROM information_schema.views +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE +NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER +NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER +# Establish connection testuser2 (user=testuser2) +SELECT * FROM information_schema.views +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE +NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER +NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER +# Establish connection test_no_views (user=test_no_views) +SELECT * FROM information_schema.views +WHERE table_schema = 'db_datadict' ORDER BY table_name; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE +NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER +NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER +# Switch to connection default and close all other connections +DROP USER 'testuser1'@'localhost'; +DROP USER 'testuser2'@'localhost'; +DROP USER 'test_no_views'@'localhost'; +DROP DATABASE db_datadict; +######################################################################### +# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.VIEWS modifications +######################################################################### +DROP TABLE IF EXISTS test.t1_my_table; +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10)) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci +ENGINE = ; +DROP USER 'testuser1'@'localhost'; +CREATE USER 'testuser1'@'localhost'; +SELECT * FROM information_schema.views +WHERE table_name LIKE 't1_%'; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE +CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table; +SELECT * FROM information_schema.views +WHERE table_name LIKE 't1_%'; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE +NULL test t1_view /* ALGORITHM=UNDEFINED */ select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER +SELECT table_name,definer FROM information_schema.views +WHERE table_name = 't1_view'; +table_name definer +t1_view root@localhost +ALTER DEFINER = 'testuser1'@'localhost' VIEW test.t1_view AS +SELECT DISTINCT f1 FROM test.t1_table; +SELECT table_name,definer,security_type FROM information_schema.views +WHERE table_name LIKE 't1_%'; +table_name definer security_type +t1_view testuser1@localhost DEFINER +ALTER DEFINER = 'root'@'localhost' SQL SECURITY INVOKER VIEW test.t1_view AS +SELECT f1 FROM test.t1_table WITH LOCAL CHECK OPTION; +SELECT table_name,definer,security_type FROM information_schema.views +WHERE table_name LIKE 't1_%'; +table_name definer security_type +t1_view root@localhost INVOKER +SELECT table_schema,table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_schema,table_name; +table_schema table_name +test t1_view +RENAME TABLE test.t1_view TO db_datadict.t1_view; +ERROR HY000: Changing schema from 'test' to 'db_datadict' is not allowed. +DROP VIEW test.t1_view; +CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table; +SELECT table_schema,table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_schema,table_name; +table_schema table_name +db_datadict t1_view +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +t1_view +RENAME TABLE db_datadict.t1_view TO db_datadict.t1_viewx; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +t1_viewx +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +t1_viewx +DROP VIEW db_datadict.t1_viewx; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +t1_view +DROP TABLE test.t1_table; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +t1_view +Warnings: +Warning 1356 View 'db_datadict.t1_view' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10)) +DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci COMMENT = 'Initial Comment' +ENGINE = ; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +t1_view +DROP DATABASE db_datadict; +SELECT table_name FROM information_schema.views +WHERE table_name LIKE 't1_%' +ORDER BY table_name; +table_name +DROP USER 'testuser1'@'localhost'; +DROP TABLE test.t1_table; +######################################################################## +# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and +# DDL on INFORMATION_SCHEMA table are not supported +######################################################################## +DROP DATABASE IF EXISTS db_datadict; +CREATE DATABASE db_datadict; +CREATE VIEW db_datadict.v1 AS SELECT 1; +INSERT INTO information_schema.views +SELECT * FROM information_schema.views; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +INSERT INTO information_schema.views(table_schema, table_name) +VALUES ('db2', 'v2'); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +UPDATE information_schema.views SET table_schema = 'test' +WHERE table_name = 't1'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DELETE FROM information_schema.views WHERE table_name = 't1'; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +TRUNCATE information_schema.views; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +CREATE INDEX my_idx_on_views ON information_schema.views(table_schema); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.views DROP PRIMARY KEY; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.views ADD f1 INT; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP TABLE information_schema.views; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.views RENAME db_datadict.views; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ALTER TABLE information_schema.views RENAME information_schema.xviews; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +DROP DATABASE db_datadict; diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc index 1a4dd9ff327..29f5bd73b04 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc @@ -1,5 +1,9 @@ #### suite/funcs_1/storedproc/storedproc_06.inc -# + +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc + --source suite/funcs_1/storedproc/load_sp_tb.inc # ============================================================================== diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc index 8e32a43e18f..83f5f2105c5 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc @@ -1,5 +1,9 @@ #### suite/funcs_1/storedproc/storedproc_10.inc -# + +# This test cannot be used for the embedded server because we check here +# privilgeges. +--source include/not_embedded.inc + --source suite/funcs_1/storedproc/load_sp_tb.inc # ============================================================================== diff --git a/mysql-test/suite/funcs_1/t/disabled.def b/mysql-test/suite/funcs_1/t/disabled.def index c9b7c8fb4dd..e9b85036259 100644 --- a/mysql-test/suite/funcs_1/t/disabled.def +++ b/mysql-test/suite/funcs_1/t/disabled.def @@ -14,3 +14,4 @@ innodb_storedproc: (changes of WL#2984, using storeproc_nn instead) memory_storedproc: (changes of WL#2984, using storeproc_nn instead) myisam_storedproc: (changes of WL#2984, using storeproc_nn instead) ndb_trig_1011ext: Bug#32656 NDB: Duplicate key error aborts transaction in handler. Doesn't talk back to SQL +is_tables_ndb: Bug#37198 user without any right on schema sees NDB table diff --git a/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test b/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test index 57298fd9056..32da61ec876 100644 --- a/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test +++ b/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test @@ -7,10 +7,4 @@ # 2. Set $engine_type let $engine_type= innodb; -# Create some objects needed in many testcases -USE test; ---source suite/funcs_1/include/innodb_tb3.inc - --source suite/funcs_1/triggers/trig_frkey.inc -DROP TABLE test.tb3; - diff --git a/mysql-test/suite/funcs_1/t/is_basics_mixed.test b/mysql-test/suite/funcs_1/t/is_basics_mixed.test index 30aeba12915..235b91c67d0 100644 --- a/mysql-test/suite/funcs_1/t/is_basics_mixed.test +++ b/mysql-test/suite/funcs_1/t/is_basics_mixed.test @@ -11,6 +11,19 @@ # Create this script based on older scripts and new code. # +# This test is strict adjusted to the behaviour of the non embedded server. +# Example of common differences between both servers: +# USE information_schema; CREATE VIEW tables AS SELECT 'garbage'; +# non embedded server: +# - errname ER_DBACCESS_DENIED_ERROR +# - ERROR 42000: Access denied for user 'root'@'localhost' to +# database 'information_schema' +# embedded server: +# - errno 1 +# - Can't create/write to file +# '.../var/master-data/information_schema/tables.frm~ +--source include/not_embedded.inc + --source suite/funcs_1/datadict/datadict.pre # $engine_type must point to storage engine which is all time available. diff --git a/mysql-test/suite/funcs_1/t/is_cml_innodb.test b/mysql-test/suite/funcs_1/t/is_cml_innodb.test new file mode 100644 index 00000000000..a37e5c8d94c --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_cml_innodb.test @@ -0,0 +1,41 @@ +# suite/funcs_1/t/is_cml_innodb.test +# +# Check the content of information_schema.columns about tables using +# UNICODE columns. +# Variant for storage engine InnoDB +# +# Author: +# 2008-06-04 mleich Create this script based on older scripts and new code. +# + +--source include/have_ucs2.inc + +# This test cannot be used for the embedded server because privileges +# are expected within result sets. +--source include/not_embedded.inc + +--source include/have_innodb.inc +let $engine_type= InnoDB; +USE test; +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +eval CREATE TABLE t1 +( + f1 CHAR UNICODE, + f2 CHAR(0) UNICODE, + f3 CHAR(10) UNICODE, + f5 VARCHAR(0) UNICODE, + f6 VARCHAR(255) UNICODE, + f7 VARCHAR(260) UNICODE, + f8 TEXT UNICODE, + f9 TINYTEXT UNICODE, + f10 MEDIUMTEXT UNICODE, + f11 LONGTEXT UNICODE +) ENGINE = $engine_type; + +# We look only for the tables created here. +let $my_where = WHERE table_schema LIKE 'test%'; +--source suite/funcs_1/datadict/columns.inc + +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/t/is_cml_memory.test b/mysql-test/suite/funcs_1/t/is_cml_memory.test new file mode 100644 index 00000000000..41602ac863a --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_cml_memory.test @@ -0,0 +1,37 @@ +# suite/funcs_1/t/is_cml_memory.test +# +# Check the content of information_schema.columns about tables using +# UNICODE columns. +# Variant for storage engine MEMORY +# +# Author: +# 2008-06-04 mleich Create this script based on older scripts and new code. +# + +--source include/have_ucs2.inc + +# This test cannot be used for the embedded server because privileges +# are expected within result sets. +--source include/not_embedded.inc + +let $engine_type= MEMORY; +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +USE test; +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +eval CREATE TABLE t1 +( + f1 CHAR UNICODE, + f2 CHAR(0) UNICODE, + f3 CHAR(10) UNICODE, + f5 VARCHAR(0) UNICODE, + f6 VARCHAR(255) UNICODE, + f7 VARCHAR(260) UNICODE +) ENGINE = $engine_type; + +# We look only for the tables created here. +let $my_where = WHERE table_schema LIKE 'test%'; +--source suite/funcs_1/datadict/columns.inc + +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/t/is_cml_myisam.test b/mysql-test/suite/funcs_1/t/is_cml_myisam.test new file mode 100644 index 00000000000..904cefbd4d7 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_cml_myisam.test @@ -0,0 +1,41 @@ +# suite/funcs_1/t/is_cml_myisam.test +# +# Check the content of information_schema.columns about tables using +# UNICODE columns. +# Variant for storage engine MyISAM +# +# Author: +# 2008-06-04 mleich Create this script based on older scripts and new code. +# + +--source include/have_ucs2.inc + +# This test cannot be used for the embedded server because privileges +# are expected within result sets. +--source include/not_embedded.inc + +let $engine_type= MyISAM; +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +USE test; +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +eval CREATE TABLE t1 +( + f1 CHAR UNICODE, + f2 CHAR(0) UNICODE, + f3 CHAR(10) UNICODE, + f5 VARCHAR(0) UNICODE, + f6 VARCHAR(255) UNICODE, + f7 VARCHAR(260) UNICODE, + f8 TEXT UNICODE, + f9 TINYTEXT UNICODE, + f10 MEDIUMTEXT UNICODE, + f11 LONGTEXT UNICODE +) ENGINE = $engine_type; + +# We look only for the tables created here. +let $my_where = WHERE table_schema LIKE 'test%'; +--source suite/funcs_1/datadict/columns.inc + +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/t/is_cml_ndb.test b/mysql-test/suite/funcs_1/t/is_cml_ndb.test new file mode 100644 index 00000000000..55899be830b --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_cml_ndb.test @@ -0,0 +1,41 @@ +# suite/funcs_1/t/is_cml_ndb.test +# +# Check the content of information_schema.columns about tables using +# UNICODE columns. +# Variant for storage engine NDB +# +# Author: +# 2008-06-04 mleich Create this script based on older scripts and new code. +# + +--source include/have_ucs2.inc + +# This test cannot be used for the embedded server because privileges +# are expected within result sets. +--source include/not_embedded.inc + +--source include/have_ndb.inc +let $engine_type= NDB; +USE test; +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +eval CREATE TABLE t1 +( + f1 CHAR UNICODE, + f2 CHAR(0) UNICODE, + f3 CHAR(10) UNICODE, + f5 VARCHAR(0) UNICODE, + f6 VARCHAR(255) UNICODE, + f7 VARCHAR(260) UNICODE, + f8 TEXT UNICODE, + f9 TINYTEXT UNICODE, + f10 MEDIUMTEXT UNICODE, + f11 LONGTEXT UNICODE +) ENGINE = $engine_type; + +# We look only for the tables created here. +let $my_where = WHERE table_schema LIKE 'test%'; +--source suite/funcs_1/datadict/columns.inc + +DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/t/is_column_privileges.test b/mysql-test/suite/funcs_1/t/is_column_privileges.test index 8f125051060..cb8c50c01b7 100644 --- a/mysql-test/suite/funcs_1/t/is_column_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_column_privileges.test @@ -16,7 +16,9 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc let $engine_type = MEMORY; let $other_engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test index 3ed8597e309..33269fe929c 100644 --- a/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test +++ b/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test @@ -8,7 +8,10 @@ # testsuite funcs_1 # Create this script based on older scripts and new code. # -# + +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc --echo ############################################################################## --echo # Testcases 3.2.9.2+3.2.9.3 INFORMATION_SCHEMA.SCHEMATA accessible information diff --git a/mysql-test/suite/funcs_1/t/is_columns.test b/mysql-test/suite/funcs_1/t/is_columns.test index 385de733ac3..efb52acd48c 100644 --- a/mysql-test/suite/funcs_1/t/is_columns.test +++ b/mysql-test/suite/funcs_1/t/is_columns.test @@ -16,7 +16,9 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc let $engine_type = MEMORY; let $other_engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/t/is_columns_innodb.test b/mysql-test/suite/funcs_1/t/is_columns_innodb.test index 04b9f8354e4..7d8ca9a3a8e 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_innodb.test +++ b/mysql-test/suite/funcs_1/t/is_columns_innodb.test @@ -10,6 +10,10 @@ # Create this script based on older scripts and new code. # +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc + --source include/have_innodb.inc let $engine_type= InnoDB; --source suite/funcs_1/datadict/datadict_load.inc diff --git a/mysql-test/suite/funcs_1/t/is_columns_is.test b/mysql-test/suite/funcs_1/t/is_columns_is.test index 41a7d180be8..743b11d7bff 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_is.test +++ b/mysql-test/suite/funcs_1/t/is_columns_is.test @@ -2,6 +2,9 @@ # # Check the content of information_schema.columns about tables within # the database information_schema. +# Variant for the non embedded server +# The expected results must equal is_columns_is_embedded except that +# columns.privileges are not empty. # # Note: The INFORMATION_SCHEMA table PROFILING is optional (exists in MySQL # Community version only) and therefore we exclude it from retrieval. @@ -12,8 +15,8 @@ # Create this script based on older scripts and new code. # +--source include/not_embedded.inc + let $my_where = WHERE table_schema = 'information_schema' AND table_name <> 'profiling'; -# --source suite/funcs_1/datadict/datadict.pre --source suite/funcs_1/datadict/columns.inc - 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 new file mode 100644 index 00000000000..7bc29624f1d --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_columns_is_embedded.test @@ -0,0 +1,23 @@ +# suite/funcs_1/t/is_columns_is_embedded.test +# +# Check the content of information_schema.columns about tables within +# the database information_schema. +# Variant for the embedded server +# The expected results must equal is_columns_is except that +# columns.privileges is empty. +# +# Note: The INFORMATION_SCHEMA table PROFILING is optional (exists in MySQL +# Community version only) and therefore we exclude it from retrieval. +# +# Author: +# 2008-06-06 mleich Create this variant for the embedded server +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} + +let $my_where = WHERE table_schema = 'information_schema' +AND table_name <> 'profiling'; +--source suite/funcs_1/datadict/columns.inc diff --git a/mysql-test/suite/funcs_1/t/is_columns_memory.test b/mysql-test/suite/funcs_1/t/is_columns_memory.test index 6cbf3b298b4..b76325d114a 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_memory.test +++ b/mysql-test/suite/funcs_1/t/is_columns_memory.test @@ -10,6 +10,10 @@ # Create this script based on older scripts and new code. # +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc + let $engine_type= MEMORY; SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; --source suite/funcs_1/datadict/datadict_load.inc diff --git a/mysql-test/suite/funcs_1/t/is_columns_myisam.test b/mysql-test/suite/funcs_1/t/is_columns_myisam.test index d98cd0347c6..09b5b088489 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_myisam.test +++ b/mysql-test/suite/funcs_1/t/is_columns_myisam.test @@ -2,7 +2,9 @@ # # Check the content of information_schema.columns about tables within # the databases created by the user. -# Variant for storage engine MyISAM +# Variant for storage engine MyISAM and the non embedded server +# The expected results must equal is_columns_myisam_embedded except that +# that the privilege system works (affects some result sets). # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -10,6 +12,7 @@ # Create this script based on older scripts and new code. # +--source include/not_embedded.inc let $engine_type= MyISAM; SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; --source suite/funcs_1/datadict/datadict_load.inc 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 new file mode 100644 index 00000000000..0d5f1a72cdb --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test @@ -0,0 +1,30 @@ +# suite/funcs_1/t/is_columns_myisam_embedded.test +# +# Check the content of information_schema.columns about tables within +# the databases created by the user. +# Variant for storage engine MyISAM and the embedded server +# The expected results must equal is_columns_myisam except that all users +# have all privileges (affects some result sets). +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +let $value= query_get_value(SHOW VARIABLES LIKE 'version_compile_os',Value,1); +if (`SELECT '$value' LIKE 'apple-darwin%'`) +{ + skip Bug#37380 Test funcs_1.is_columns_myisam_embedded fails on OS X; +} +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +let $engine_type= MyISAM; +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +--source suite/funcs_1/datadict/datadict_load.inc + +# We look only for the tables created by datadict_load.inc. +let $my_where = WHERE table_schema LIKE 'test%'; +--source suite/funcs_1/datadict/columns.inc + +--source suite/funcs_1/include/cleanup.inc diff --git a/mysql-test/suite/funcs_1/t/is_columns_mysql.test b/mysql-test/suite/funcs_1/t/is_columns_mysql.test index 26539d0c8e0..a844e18f5be 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_mysql.test +++ b/mysql-test/suite/funcs_1/t/is_columns_mysql.test @@ -2,6 +2,9 @@ # # Check the content of information_schema.columns about tables within # the database mysql. +# Variant for the non embedded server +# The expected results must equal is_columns_mysql_embedded except that +# columns.privileges are not empty. # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -9,5 +12,7 @@ # Create this script based on older scripts and new code. # +--source include/not_embedded.inc + let $my_where = WHERE table_schema = 'mysql'; --source suite/funcs_1/datadict/columns.inc 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 new file mode 100644 index 00000000000..d1ed45425ec --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_columns_mysql_embedded.test @@ -0,0 +1,19 @@ +# suite/funcs_1/t/is_columns_mysql_embedded.test +# +# Check the content of information_schema.columns about tables within +# the database mysql. +# Variant for the embedded server +# The expected results must equal is_columns_mysql except that +# columns.privileges is empty. +# +# Author: +# 2008-06-06 mleich Create this variant for the embedded server +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} + +let $my_where = WHERE table_schema = 'mysql'; +--source suite/funcs_1/datadict/columns.inc diff --git a/mysql-test/suite/funcs_1/t/is_columns_ndb.test b/mysql-test/suite/funcs_1/t/is_columns_ndb.test index 960e5f079bb..3d2a8d7aa5b 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_ndb.test +++ b/mysql-test/suite/funcs_1/t/is_columns_ndb.test @@ -10,6 +10,10 @@ # Create this script based on older scripts and new code. # +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc + --source include/have_ndb.inc let $engine_type= ndb; --source suite/funcs_1/datadict/datadict_load.inc diff --git a/mysql-test/suite/funcs_1/t/is_key_column_usage.test b/mysql-test/suite/funcs_1/t/is_key_column_usage.test index 219277c8645..a6bd8fc3989 100644 --- a/mysql-test/suite/funcs_1/t/is_key_column_usage.test +++ b/mysql-test/suite/funcs_1/t/is_key_column_usage.test @@ -2,13 +2,12 @@ # # Check the layout of information_schema.key_column_usage and the impact of # CREATE/ALTER/DROP TABLE/VIEW/SCHEMA/COLUMN ... on it. +# Variant for the non embedded server +# The expected results must equal is_key_column_usage_embedded except that +# that the privilege system works (affects some result sets). # -# Note: -# This test is not intended -# - to show information about the all time existing tables -# within the databases information_schema and mysql -# - for checking storage engine properties -# Therefore please do not alter $engine_type and $other_engine_type. +# There is detailed information about this test within +# suite/funcs_1/datadict/is_key_column_usage.inc # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -16,329 +15,5 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre - -let $engine_type = MEMORY; -# let $other_engine_type = MyISAM; - -let $is_table = KEY_COLUMN_USAGE; - -# The table INFORMATION_SCHEMA.KEY_COLUMN_USAGE must exist -eval SHOW TABLES FROM information_schema LIKE '$is_table'; - ---echo ####################################################################### ---echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT ---echo ####################################################################### -# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT -# statement, just as if it were an ordinary user-defined table. -# ---source suite/funcs_1/datadict/is_table_query.inc - - ---echo ######################################################################### ---echo # Testcase 3.2.7.1: INFORMATION_SCHEMA.KEY_COLUMN_USAGE layout ---echo ######################################################################### -# Ensure that the INFORMATION_SCHEMA.KEY_COLUMN_USAGE table has the following -# columns, in the following order: -# -# CONSTRAINT_CATALOG (always shows NULL), -# CONSTRAINT_SCHEMA (shows the database, or schema, in which an accessible -# constraint, or index, resides), -# CONSTRAINT_NAME (shows the name of the accessible constraint), -# TABLE_CATALOG (always shows NULL), -# TABLE_SCHEMA (shows the database, or schema, in which the table constrained -# by that constraint resides), -# TABLE_NAME (shows the name of the table constrained by the constraint), -# COLUMN_NAME (shows the name of a column that is the index key, or part of -# the index key), -# ORDINAL_POSITION (shows the ordinal position of the column within the -# constraint index), -# POSITION_IN_UNIQUE_CONSTRAINT (shows, for a foreign key column, the ordinal -# position of the referenced column within the referenced unique index; -# otherwise NULL). -# added with 5.0.6: -# REFERENCED_TABLE_SCHEMA, -# REFERENCED_TABLE_NAME, -# REFERENCED_COLUMN_NAME -# ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval DESCRIBE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW CREATE TABLE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW COLUMNS FROM information_schema.$is_table; - -# Note: Retrieval of information within information_schema.columns about -# information_schema.key_column_usage is in is_columns_is.test. - -# Show that CONSTRAINT_CATALOG and TABLE_CATALOG are always NULL. -SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog, - table_schema, table_name, column_name -FROM information_schema.key_column_usage -WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL; - - ---echo ######################################################################################## ---echo # Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information ---echo ######################################################################################## -# 3.2.7.2: Ensure that the table shows the relevant information on every column, defined to -# be part of an index key, which is accessible to the current user or to PUBLIC. -# 3.2.7.3: Ensure that the table does not show any information on any indexed column that is -# not accessible to the current user or PUBLIC. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; - ---error 0,ER_CANNOT_USER -DROP USER 'testuser1'@'localhost'; -CREATE USER 'testuser1'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser2'@'localhost'; -CREATE USER 'testuser2'@'localhost'; - -USE db_datadict; - ---replace_result $engine_type -eval -CREATE TABLE t1_1 - (f1 INT NOT NULL, PRIMARY KEY(f1), - f2 INT, INDEX f2_ind(f2)) -ENGINE = $engine_type; -GRANT SELECT ON t1_1 to 'testuser1'@'localhost'; - ---replace_result $engine_type -eval -CREATE TABLE t1_2 - (f1 INT NOT NULL, PRIMARY KEY(f1), - f2 INT, INDEX f2_ind(f2)) -ENGINE = $engine_type; -GRANT SELECT ON t1_2 to 'testuser2'@'localhost'; -#FIXME: add foreign keys - -let $select= SELECT * FROM information_schema.key_column_usage -WHERE table_name LIKE 't1_%' -ORDER BY constraint_catalog, constraint_schema, constraint_name, - table_catalog, table_schema, table_name, ordinal_position; - -# show view of user root -eval $select; - ---echo # Establish connection testuser1 (user=testuser1) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser1, localhost, testuser1, , db_datadict); -eval $select; - ---echo # Establish connection testuser2 (user=testuser2) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser2, localhost, testuser2, , db_datadict); -eval $select; - -# Cleanup ---echo # Switch to connection default and close connections testuser1, testuser2 -connection default; -disconnect testuser1; -disconnect testuser2; -DROP USER 'testuser1'@'localhost'; -DROP USER 'testuser2'@'localhost'; -DROP TABLE t1_1; -DROP TABLE t1_2; -DROP DATABASE IF EXISTS db_datadict; - - ---echo ######################################################################################## ---echo # Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.KEY_COLUMN_USAGE modifications ---echo ######################################################################################## -# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or -# column) automatically inserts all relevant information on that -# object into every appropriate INFORMATION_SCHEMA table. -# 3.2.1.14: Ensure that the alteration of any existing database object -# automatically updates all relevant information on that object in -# every appropriate INFORMATION_SCHEMA table. -# 3.2.1.15: Ensure that the dropping of any existing database object -# automatically deletes all relevant information on that object from -# every appropriate INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; -DROP TABLE IF EXISTS test.t1_my_table; ---enable_warnings -CREATE DATABASE db_datadict; - -SELECT table_name FROM information_schema.key_column_usage -WHERE table_name LIKE 't1_my_table%'; ---replace_result $engine_type -eval -CREATE TABLE test.t1_my_table - (f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1,f2)) -DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci -ENGINE = $engine_type; -# Settings used in CREATE TABLE must be visible -# in information_schema.key_column_usage. ---vertical_results -SELECT * FROM information_schema.key_column_usage -WHERE table_name = 't1_my_table'; ---horizontal_results -# -# Check modification of TABLE_NAME -SELECT DISTINCT table_name FROM information_schema.key_column_usage -WHERE table_name LIKE 't1_my_table%'; -RENAME TABLE test.t1_my_table TO test.t1_my_tablex; -SELECT DISTINCT table_name FROM information_schema.key_column_usage -WHERE table_name LIKE 't1_my_table%'; -# -# Check modification of TABLE_SCHEMA -SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; -RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex; -SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; -# -# Check modification of COLUMN_NAME -SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex' -ORDER BY table_name, column_name; -ALTER TABLE db_datadict.t1_my_tablex CHANGE COLUMN f1 first_col CHAR(12); -SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex' -ORDER BY table_name, column_name; -# -# Note: The size of the column list and the not very selective qualification -# is intended. I want to see that the schema names are equal and -# all records about 't1_my_tablex'. -let $my_select = SELECT constraint_schema, constraint_name, table_schema, -table_name, column_name, ordinal_position -FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex' -ORDER BY constraint_schema, constraint_name, table_schema, - table_name, ordinal_position; -# -# Check ADD INDEX being not UNIQUE (does not show up in key_column_usage) -eval $my_select; -CREATE INDEX f2 ON db_datadict.t1_my_tablex(f2); -eval $my_select; -DROP INDEX f2 ON db_datadict.t1_my_tablex; -# -# Check ADD UNIQUE INDEX without name explicit assigned -eval $my_select; -ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE (f2); -eval $my_select; -DROP INDEX f2 ON db_datadict.t1_my_tablex; -# -# Check ADD UNIQUE INDEX with name explicit assigned -eval $my_select; -ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f2); -eval $my_select; -DROP INDEX my_idx ON db_datadict.t1_my_tablex; -eval $my_select; -ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f4,first_col); -eval $my_select; -# -# Check DROP COLUMN -eval $my_select; -ALTER TABLE db_datadict.t1_my_tablex -DROP COLUMN first_col; -eval $my_select; -# -# Check impact of DROP TABLE -SELECT table_name, column_name -FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex' -ORDER BY table_name, column_name; -DROP TABLE db_datadict.t1_my_tablex; -SELECT table_name, column_name -FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; -# -# No UNIQUE CONSTRAINT -> no entry in key_column_usage -SELECT table_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; ---replace_result $engine_type -eval -CREATE TABLE db_datadict.t1_my_tablex -ENGINE = $engine_type AS -SELECT 1 AS f1; -SELECT table_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; -# UNIQUE CONSTRAINT -> entry in key_column_usage -ALTER TABLE db_datadict.t1_my_tablex ADD PRIMARY KEY(f1); -SELECT table_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; -# -# Check impact of DROP SCHEMA -SELECT table_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; -DROP DATABASE db_datadict; -SELECT table_name FROM information_schema.key_column_usage -WHERE table_name = 't1_my_tablex'; -# - - ---echo ######################################################################## ---echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and ---echo # DDL on INFORMATION_SCHEMA table are not supported ---echo ######################################################################## -# 3.2.1.3: Ensure that no user may execute an INSERT statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.5: Ensure that no user may execute a DELETE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.8: Ensure that no user may create an index on an -# INFORMATION_SCHEMA table. -# 3.2.1.9: Ensure that no user may alter the definition of an -# INFORMATION_SCHEMA table. -# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. -# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any -# other database. -# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data -# in an INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; -DROP TABLE IF EXISTS db_datadict.t1; ---enable_warnings -CREATE DATABASE db_datadict; ---replace_result $engine_type -eval -CREATE TABLE db_datadict.t1 (f1 BIGINT) -ENGINE = $engine_type; - ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.key_column_usage - (constraint_schema, constraint_name, table_name) -VALUES ( 'mysql', 'primary', 'db'); ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.key_column_usage -SELECT * FROM information_schema.key_column_usage; - ---error ER_DBACCESS_DENIED_ERROR -UPDATE information_schema.key_column_usage -SET table_name = 'db1' WHERE constraint_name = 'primary'; - ---error ER_DBACCESS_DENIED_ERROR -DELETE FROM information_schema.key_column_usage WHERE table_name = 't1'; ---error ER_DBACCESS_DENIED_ERROR -TRUNCATE information_schema.key_column_usage; - ---error ER_DBACCESS_DENIED_ERROR -CREATE INDEX i3 ON information_schema.key_column_usage(table_name); - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.key_column_usage ADD f1 INT; - ---error ER_DBACCESS_DENIED_ERROR -DROP TABLE information_schema.key_column_usage; - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.key_column_usage -RENAME db_datadict.key_column_usage; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.key_column_usage -RENAME information_schema.xkey_column_usage; - -# Cleanup -DROP TABLE db_datadict.t1; -DROP DATABASE db_datadict; - +--source include/not_embedded.inc +--source suite/funcs_1/datadict/is_key_column_usage.inc diff --git a/mysql-test/suite/funcs_1/t/is_key_column_usage_embedded.test b/mysql-test/suite/funcs_1/t/is_key_column_usage_embedded.test new file mode 100644 index 00000000000..ccdc8dec3d9 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_key_column_usage_embedded.test @@ -0,0 +1,20 @@ +# suite/funcs_1/t/is_key_column_usage_embedded.test +# +# Check the layout of information_schema.key_column_usage and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA/COLUMN ... on it. +# Variant for the embedded server +# The expected results must equal is_key_column_usage except that all users +# have all privileges (affects some result sets). +# +# There is detailed information about this test within +# suite/funcs_1/datadict/is_key_column_usage.inc +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +--source suite/funcs_1/datadict/is_key_column_usage.inc diff --git a/mysql-test/suite/funcs_1/t/is_routines.test b/mysql-test/suite/funcs_1/t/is_routines.test index 5f015b8624b..30a0e02c23a 100644 --- a/mysql-test/suite/funcs_1/t/is_routines.test +++ b/mysql-test/suite/funcs_1/t/is_routines.test @@ -2,13 +2,12 @@ # # Check the layout of information_schema.routines and the impact of # CREATE/ALTER/DROP PROCEDURE/FUNCTION ... on it. +# Variant for the non embedded server +# The expected results must equal is_routines_embedded except that +# that the privilege system works (affects some result sets). # -# Note: -# This test is not intended -# - to show information about the all time existing routines (there are no -# in the moment) within the databases information_schema and mysql -# - for checking storage engine properties -# Therefore please do not alter $engine_type and $other_engine_type. +# There is detailed information about this test within +# suite/funcs_1/datadict/is_routines.inc # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -16,456 +15,5 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre - -let $engine_type = MEMORY; -let $other_engine_type = MyISAM; - -let $is_table = ROUTINES; - -# The table INFORMATION_SCHEMA.TABLES must exist -eval SHOW TABLES FROM information_schema LIKE '$is_table'; - ---echo ####################################################################### ---echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT ---echo ####################################################################### -# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT -# statement, just as if it were an ordinary user-defined table. -# ---source suite/funcs_1/datadict/is_table_query.inc - - ---echo ######################################################################### ---echo # Testcase 3.2.8.1: INFORMATION_SCHEMA.ROUTINES layout ---echo ######################################################################### -# Ensure that the INFORMATION_SCHEMA.ROUTINES table has the following columns, -# in the following order: -# -# SPECIFIC_NAME (shows the name of an accessible stored procedure, or routine), -# ROUTINE_CATALOG (always shows NULL), -# ROUTINE_SCHEMA (shows the database, or schema, in which the routine resides), -# ROUTINE_NAME (shows the same stored procedure name), -# ROUTINE_TYPE (shows whether the stored procedure is a procedure or a function), -# DTD_IDENTIFIER (shows, for a function, the complete data type definition of -# the value the function will return; otherwise NULL), -# ROUTINE_BODY (shows the language in which the stored procedure is written; -# currently always SQL), -# ROUTINE_DEFINITION (shows as much of the routine body as is possible in the -# allotted space), -# EXTERNAL_NAME (always shows NULL), -# EXTERNAL_LANGUAGE (always shows NULL), -# PARAMETER_STYLE (shows the routine's parameter style; always SQL), -# IS_DETERMINISTIC (shows whether the routine is deterministic), -# SQL_DATA_ACCESS (shows the routine's defined sql-data-access clause value), -# SQL_PATH (always shows NULL), -# SECURITY_TYPE (shows whether the routine's defined security_type is 'definer' -# or 'invoker'), -# CREATED (shows the timestamp of the time the routine was created), -# LAST_ALTERED (shows the timestamp of the time the routine was last altered), -# SQL_MODE (shows the sql_mode setting at the time the routine was created), -# ROUTINE_COMMENT (shows the comment, if any, defined for the routine; -# otherwise NULL), -# DEFINER (shows the user who created the routine). -# ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval DESCRIBE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW CREATE TABLE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW COLUMNS FROM information_schema.$is_table; - -USE test; ---disable_warnings -DROP PROCEDURE IF EXISTS sp_for_routines; -DROP FUNCTION IF EXISTS function_for_routines; ---enable_warnings -CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; -CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; - -# Show that the column values of -# ROUTINE_CATALOG, EXTERNAL_NAME, EXTERNAL_LANGUAGE, SQL_PATH are always NULL -# and -# ROUTINE_BODY, PARAMETER_STYLE are 'SQL' -# and -# SPECIFIC_NAME = ROUTINE_NAME. -SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type, - routine_body,external_name,external_language,parameter_style,sql_path -FROM information_schema.routines -WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL - OR external_language IS NOT NULL OR sql_path IS NOT NULL - OR routine_body <> 'SQL' OR parameter_style <> 'SQL' - OR specific_name <> routine_name; - -DROP PROCEDURE sp_for_routines; -DROP FUNCTION function_for_routines; - - ---echo ################################################################################ ---echo # Testcase 3.2.8.2 + 3.2.8.3: INFORMATION_SCHEMA.ROUTINES accessible information ---echo ################################################################################ -# 3.2.8.2: Ensure that the table shows the relevant information on every SQL-invoked -# routine (i.e. stored procedure) which is accessible to the current user -# or to PUBLIC. -# 3.2.8.3: Ensure that the table does not show any information on any stored procedure -# that is not accessible to the current user or PUBLIC. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; -DROP DATABASE IF EXISTS db_datadict_2; ---enable_warnings - -CREATE DATABASE db_datadict; -USE db_datadict; ---replace_result $other_engine_type -eval -CREATE TABLE res_6_408002_1(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT) -ENGINE = $other_engine_type; -INSERT INTO res_6_408002_1(f1, f2, f3, f4) -VALUES('abc', 'xyz', '1989-11-09', 0815); ---disable_warnings -DROP PROCEDURE IF EXISTS sp_6_408002_1; ---enable_warnings -delimiter //; -CREATE PROCEDURE sp_6_408002_1() -BEGIN - SELECT * FROM db_datadict.res_6_408002_1; -END// -delimiter ;// - -CREATE DATABASE db_datadict_2; -USE db_datadict_2; ---replace_result $other_engine_type -eval -CREATE TABLE res_6_408002_2(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT) -ENGINE = $other_engine_type; -INSERT INTO res_6_408002_2(f1, f2, f3, f4) -VALUES('abc', 'xyz', '1990-10-03', 4711); ---disable_warnings -DROP PROCEDURE IF EXISTS sp_6_408002_2; ---enable_warnings -delimiter //; -CREATE PROCEDURE sp_6_408002_2() -BEGIN - SELECT * FROM db_datadict_2.res_6_408002_2; -END// -delimiter ;// - ---error 0,ER_CANNOT_USER -DROP USER 'testuser1'@'localhost'; -CREATE USER 'testuser1'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser2'@'localhost'; -CREATE USER 'testuser2'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser3'@'localhost'; -CREATE USER 'testuser3'@'localhost'; - - -GRANT SELECT ON db_datadict_2.* TO 'testuser1'@'localhost'; -GRANT EXECUTE ON db_datadict_2.* TO 'testuser1'@'localhost'; - -GRANT EXECUTE ON db_datadict.* TO 'testuser1'@'localhost'; -GRANT SELECT ON db_datadict.* TO 'testuser2'@'localhost'; - -GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2 -TO 'testuser2'@'localhost'; -GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost'; -FLUSH PRIVILEGES; - ---echo # Establish connection testuser1 (user=testuser1) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser1, localhost, testuser1, , db_datadict); ---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" -SELECT * FROM information_schema.routines; - ---echo # Establish connection testuser2 (user=testuser2) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser2, localhost, testuser2, , db_datadict); ---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" -SELECT * FROM information_schema.routines; - ---echo # Establish connection testuser3 (user=testuser3) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser3, localhost, testuser3, , test); ---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" -SELECT * FROM information_schema.routines; - -# Cleanup ---echo # Switch to connection default and close connections testuser1,testuser2,testuser3 -connection default; -disconnect testuser1; -disconnect testuser2; -disconnect testuser3; - -DROP USER 'testuser1'@'localhost'; -DROP USER 'testuser2'@'localhost'; -DROP USER 'testuser3'@'localhost'; - -USE test; -DROP DATABASE db_datadict; -DROP DATABASE db_datadict_2; - - ---echo ######################################################################### ---echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.ROUTINES modifications ---echo ######################################################################### -# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or -# column) automatically inserts all relevant information on that -# object into every appropriate INFORMATION_SCHEMA table. -# 3.2.1.14: Ensure that the alteration of any existing database object -# automatically updates all relevant information on that object in -# every appropriate INFORMATION_SCHEMA table. -# 3.2.1.15: Ensure that the dropping of any existing database object -# automatically deletes all relevant information on that object from -# every appropriate INFORMATION_SCHEMA table. -# -# Some more tests are in t/information_schema_routines.test which exists -# in MySQL 5.1 and up only. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; - -SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; -USE db_datadict; -CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; -CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; ---vertical_results ---replace_column 16 17 -SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' -ORDER BY routine_name; ---horizontal_results - -ALTER PROCEDURE sp_for_routines SQL SECURITY INVOKER; -ALTER FUNCTION function_for_routines COMMENT 'updated comments'; ---vertical_results ---replace_column 16 17 -SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' -ORDER BY routine_name; ---horizontal_results - -DROP PROCEDURE sp_for_routines; -DROP FUNCTION function_for_routines; -SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; - -CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; -CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0; ---vertical_results ---replace_column 16 17 -SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict' -ORDER BY routine_name; ---horizontal_results -use test; -DROP DATABASE db_datadict; -SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'; - - ---echo ######################################################################### ---echo # 3.2.8.4: INFORMATION_SCHEMA.ROUTINES routine body too big for ---echo # ROUTINE_DEFINITION column ---echo ######################################################################### -# Ensure that a stored procedure with a routine body that is too large to fit -# into the INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION column correctly shows -# as much of the information as is possible within the allotted size. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; -USE db_datadict; -# ---replace_result $other_engine_type -eval -CREATE TABLE db_datadict.res_6_408004_1 - (f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR) -ENGINE = $other_engine_type; -INSERT INTO db_datadict.res_6_408004_1 -VALUES ('abc', 98765 , 99999999 , 98765, 10); -# ---replace_result $other_engine_type -eval -CREATE TABLE db_datadict.res_6_408004_2 - (f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR) -ENGINE = $other_engine_type; -INSERT INTO db_datadict.res_6_408004_2 -VALUES ('abc', 98765 , 99999999 , 98765, 10); - ---echo # Checking the max. possible length of (currently) 4 GByte is not ---echo # in this environment here. - -delimiter //; -CREATE PROCEDURE sp_6_408004 () -BEGIN - DECLARE done INTEGER DEFAULt 0; - DECLARE variable_number_1 LONGTEXT; - DECLARE variable_number_2 MEDIUMINT; - DECLARE variable_number_3 LONGBLOB; - DECLARE variable_number_4 REAL; - DECLARE variable_number_5 YEAR; - DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; - DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; - DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; - DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; - DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10; - DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; - BEGIN - OPEN cursor_number_1; - WHILE done <> 1 DO - FETCH cursor_number_1 - INTO variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5; - IF done <> 0 THEN - INSERT INTO res_6_408004_2 - VALUES (variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5); - END IF; - END WHILE; - BEGIN - BEGIN - SET done = 0; - OPEN cursor_number_2; - WHILE done <> 1 DO - FETCH cursor_number_2 - INTO variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5; - IF done <> 0 THEN - INSERT INTO res_6_408004_2 - VALUES(variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5); - END IF; - END WHILE; - END; - SET done = 0; - OPEN cursor_number_3; - WHILE done <> 1 DO - FETCH cursor_number_3 - INTO variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5; - IF done <> 0 THEN - INSERT INTO res_6_408004_2 - VALUES(variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5); - END IF; - END WHILE; - END; - END; - BEGIN - SET done = 0; - OPEN cursor_number_4; - WHILE done <> 1 DO - FETCH cursor_number_4 - INTO variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5; - IF done <> 0 THEN - INSERT INTO res_6_408004_2 - VALUES (variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5); - END IF; - END WHILE; - END; - BEGIN - SET @a='test row'; - SELECT @a; - SELECT @a; - SELECT @a; - END; - BEGIN - SET done = 0; - OPEN cursor_number_5; - WHILE done <> 1 DO - FETCH cursor_number_5 - INTO variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5; - IF done <> 0 THEN - INSERT INTO res_6_408004_2 - VALUES (variable_number_1, variable_number_2, variable_number_3, - variable_number_4, variable_number_5); - END IF; - END WHILE; - END; - BEGIN - SET @a='test row'; - SELECT @a; - SELECT @a; - SELECT @a; - END; -END// -delimiter ;// - -CALL db_datadict.sp_6_408004 (); -SELECT * FROM db_datadict.res_6_408004_2; - ---vertical_results ---replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss" -SELECT *, LENGTH(routine_definition) FROM information_schema.routines -WHERE routine_schema = 'db_datadict'; ---horizontal_results - -# Cleanup -DROP DATABASE db_datadict; -# ---------------------------------------------------------------------------------------------- - - ---echo ######################################################################## ---echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and ---echo # DDL on INFORMATION_SCHEMA table are not supported ---echo ######################################################################## -# 3.2.1.3: Ensure that no user may execute an INSERT statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.5: Ensure that no user may execute a DELETE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.8: Ensure that no user may create an index on an INFORMATION_SCHEMA table. -# 3.2.1.9: Ensure that no user may alter the definition of an -# INFORMATION_SCHEMA table. -# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. -# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any -# other database. -# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data -# in an INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; -USE db_datadict; -CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict'; -USE test; - ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.routines (routine_name, routine_type ) -VALUES ('p2', 'procedure'); - ---error ER_DBACCESS_DENIED_ERROR -UPDATE information_schema.routines SET routine_name = 'p2' -WHERE routine_body = 'sql'; - ---error ER_DBACCESS_DENIED_ERROR -DELETE FROM information_schema.routines ; -# ---error ER_DBACCESS_DENIED_ERROR -TRUNCATE information_schema.routines ; - ---error ER_DBACCESS_DENIED_ERROR -CREATE INDEX i7 ON information_schema.routines (routine_name); - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.routines ADD f1 INT; -# ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.routines DISCARD TABLESPACE; - ---error ER_DBACCESS_DENIED_ERROR -DROP TABLE information_schema.routines ; - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.routines RENAME db_datadict.routines; -# ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.routines RENAME information_schema.xroutines; - -# Cleanup -DROP DATABASE db_datadict; - +--source include/not_embedded.inc +--source suite/funcs_1/datadict/is_routines.inc diff --git a/mysql-test/suite/funcs_1/t/is_routines_embedded.test b/mysql-test/suite/funcs_1/t/is_routines_embedded.test new file mode 100644 index 00000000000..86e1145690d --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_routines_embedded.test @@ -0,0 +1,20 @@ +# suite/funcs_1/t/is_routines_embedded.test +# +# Check the layout of information_schema.routines and the impact of +# CREATE/ALTER/DROP PROCEDURE/FUNCTION ... on it. +# Variant for the embedded server +# The expected results must equal is_routines except that all users +# have all privileges (affects some result sets). +# +# There is detailed information about this test within +# suite/funcs_1/datadict/is_routines.inc +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +--source suite/funcs_1/datadict/is_routines.inc diff --git a/mysql-test/suite/funcs_1/t/is_schema_privileges.test b/mysql-test/suite/funcs_1/t/is_schema_privileges.test index 4eb4a273362..1f408d71b39 100644 --- a/mysql-test/suite/funcs_1/t/is_schema_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_schema_privileges.test @@ -16,7 +16,9 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc let $engine_type = MEMORY; let $other_engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test index cb34d1bad2d..3f60f71fe9a 100644 --- a/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test +++ b/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test @@ -8,7 +8,10 @@ # testsuite funcs_1 # Create this script based on older scripts and new code. # -# + +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc --echo ############################################################################## --echo # Testcases 3.2.9.2+3.2.9.3 INFORMATION_SCHEMA.SCHEMATA accessible information diff --git a/mysql-test/suite/funcs_1/t/is_schemata.test b/mysql-test/suite/funcs_1/t/is_schemata.test index 7eb08dba463..e262869e6d4 100644 --- a/mysql-test/suite/funcs_1/t/is_schemata.test +++ b/mysql-test/suite/funcs_1/t/is_schemata.test @@ -2,12 +2,12 @@ # # Check the layout of information_schema.schemata, permissions and the impact of # CREATE/ALTER/DROP SCHEMA on it. +# Variant for the non embedded server +# The expected results must equal is_schemata_embedded except that +# that the privilege system works (affects some result sets). # -# Note: -# This test is not intended -# - to show information about the all time existing databases -# information_schema and mysql -# - for checking storage engine properties +# There is detailed information about this test within +# suite/funcs_1/datadict/is_schemata.inc # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -15,232 +15,5 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre - -let $is_table = SCHEMATA; - -# The table INFORMATION_SCHEMA.SCHEMATA must exist -eval SHOW TABLES FROM information_schema LIKE '$is_table'; - ---echo ####################################################################### ---echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT ---echo ####################################################################### -# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT -# statement, just as if it were an ordinary user-defined table. -# ---source suite/funcs_1/datadict/is_table_query.inc - - ---echo ######################################################################### ---echo # Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout; ---echo ######################################################################### -# Ensure that the INFORMATION_SCHEMA.SCHEMATA table has the following columns, -# in the following order: -# -# CATALOG_NAME (always shows NULL), -# SCHEMA_NAME (shows the name of a database, or schema, on which the current -# user or PUBLIC has privileges), -# DEFAULT_CHARACTER_SET_NAME (shows the name of that database's default -# character set), -# DEFAULT_COLLATION_NAME (shows the database defaul collation) -# SQL_PATH (always shows NULL). -# ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval DESCRIBE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW CREATE TABLE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW COLUMNS FROM information_schema.$is_table; - -# Note: Retrieval of information within information_schema.columns about -# information_schema.schemata is in is_columns_is.test. - -# Show that CATALOG_NAME and SQL_PATH are always NULL. -SELECT catalog_name, schema_name, sql_path -FROM information_schema.schemata -WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL; - - ---echo ############################################################################### ---echo # Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information ---echo ############################################################################### -# 3.2.9.2 Ensure that the table shows the relevant information for every -# database on which the current user or PUBLIC have privileges. -# 3.2.9.3 Ensure that the table does not show any information on any databases -# on which the current user and PUBLIC have no privileges. -# -# Note: Check of content within information_schema.schemata about the databases -# information_schema and mysql is in -# suite/funcs_1/t/is_schemata_is_mysql.test. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict_1; -DROP DATABASE IF EXISTS db_datadict_2; ---enable_warnings -CREATE DATABASE db_datadict_1; -CREATE DATABASE db_datadict_2; - ---error 0,ER_CANNOT_USER -DROP USER 'testuser1'@'localhost'; -CREATE USER 'testuser1'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser2'@'localhost'; -CREATE USER 'testuser2'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser3'@'localhost'; -CREATE USER 'testuser3'@'localhost'; - -GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost'; -GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost'; -GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost'; - -let $my_select = SELECT * FROM information_schema.schemata -WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name; -let $my_show = SHOW DATABASES LIKE 'db_datadict_%'; - -eval $my_select; ---sorted_result -eval $my_show; - ---echo # Establish connection testuser1 (user=testuser1) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser1, localhost, testuser1, , db_datadict_1); -# Shows db_datadict_1 -eval $my_select; ---sorted_result -eval $my_show; - ---echo # Establish connection testuser2 (user=testuser2) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser2, localhost, testuser2, , db_datadict_2); -# Shows db_datadict_1 and db_datadict_2 -eval $my_select; ---sorted_result -eval $my_show; - ---echo # Establish connection testuser3 (user=testuser3) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser3, localhost, testuser3, , test); -# Shows neither db_datadict_1 nor db_datadict_2 -eval $my_select; ---sorted_result -eval $my_show; - -# Cleanup ---echo # Switch to connection default and close connections testuser1,testuser2,testuser3 -connection default; -disconnect testuser1; -disconnect testuser2; -disconnect testuser3; -DROP USER 'testuser1'@'localhost'; -DROP USER 'testuser2'@'localhost'; -DROP USER 'testuser3'@'localhost'; -DROP DATABASE db_datadict_1; -DROP DATABASE db_datadict_2; - - ---echo ################################################################################# ---echo # Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications ---echo ################################################################################# -# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or -# column) automatically inserts all relevant information on that -# object into every appropriate INFORMATION_SCHEMA table. -# 3.2.1.14: Ensure that the alteration of any existing database object -# automatically updates all relevant information on that object in -# every appropriate INFORMATION_SCHEMA table. -# 3.2.1.15: Ensure that the dropping of any existing database object -# automatically deletes all relevant information on that object from -# every appropriate INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings - -SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict'; -CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci'; -SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict'; - -# Check modify default CHARACTER SET -SELECT schema_name, default_character_set_name -FROM information_schema.schemata WHERE schema_name = 'db_datadict'; -ALTER SCHEMA db_datadict CHARACTER SET 'utf8'; -SELECT schema_name, default_character_set_name -FROM information_schema.schemata WHERE schema_name = 'db_datadict'; -ALTER SCHEMA db_datadict CHARACTER SET 'latin1'; - -# Check modify default COLLATION -SELECT schema_name, default_collation_name FROM information_schema.schemata -WHERE schema_name = 'db_datadict'; -ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs'; -SELECT schema_name, default_collation_name FROM information_schema.schemata -WHERE schema_name = 'db_datadict'; - -# Check DROP DATABASE -SELECT schema_name -FROM information_schema.schemata WHERE schema_name = 'db_datadict'; -DROP DATABASE db_datadict; -SELECT schema_name -FROM information_schema.schemata WHERE schema_name = 'db_datadict'; - - ---echo ######################################################################## ---echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and ---echo # DDL on INFORMATION_SCHEMA tables are not supported ---echo ######################################################################## -# 3.2.1.3: Ensure that no user may execute an INSERT statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.5: Ensure that no user may execute a DELETE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.8: Ensure that no user may create an index on an INFORMATION_SCHEMA table. -# 3.2.1.9: Ensure that no user may alter the definition of an -# INFORMATION_SCHEMA table. -# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. -# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any -# other database. -# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data -# in an INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci'; - ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.schemata - (catalog_name, schema_name, default_character_set_name, sql_path) -VALUES (NULL, 'db1', 'latin1', NULL); ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.schemata -SELECT * FROM information_schema.schemata; - ---error ER_DBACCESS_DENIED_ERROR -UPDATE information_schema.schemata -SET default_character_set_name = 'utf8' -WHERE schema_name = 'db_datadict'; ---error ER_DBACCESS_DENIED_ERROR -UPDATE information_schema.schemata SET catalog_name = 't_4711'; - ---error ER_DBACCESS_DENIED_ERROR -DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict'; ---error ER_DBACCESS_DENIED_ERROR -TRUNCATE information_schema.schemata; - ---error ER_DBACCESS_DENIED_ERROR -CREATE INDEX i1 ON information_schema.schemata(schema_name); - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.schemata ADD f1 INT; - ---error ER_DBACCESS_DENIED_ERROR -DROP TABLE information_schema.schemata; - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.schemata RENAME db_datadict.schemata; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.schemata RENAME information_schema.xschemata; - -# Cleanup -DROP DATABASE db_datadict; - +--source include/not_embedded.inc +--source suite/funcs_1/datadict/is_schemata.inc diff --git a/mysql-test/suite/funcs_1/t/is_schemata_embedded.test b/mysql-test/suite/funcs_1/t/is_schemata_embedded.test new file mode 100644 index 00000000000..5fbb023dd8e --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_schemata_embedded.test @@ -0,0 +1,20 @@ +# suite/funcs_1/t/is_schemata_embedded.test +# +# Check the layout of information_schema.schemata, permissions and the impact of +# CREATE/ALTER/DROP SCHEMA on it. +# Variant for the embedded server +# The expected results must equal is_schemata except that all users +# have all privileges (affects some result sets). +# +# There is detailed information about this test within +# suite/funcs_1/datadict/is_schemata.inc +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +--source suite/funcs_1/datadict/is_schemata.inc diff --git a/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test index cabcfa640d7..9bfbf0cf335 100644 --- a/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test +++ b/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test @@ -8,7 +8,10 @@ # testsuite funcs_1 # Create this script based on older scripts and new code. # -# + +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc --echo ################################################################################# --echo # Testcases 3.2.9.2 + 3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information diff --git a/mysql-test/suite/funcs_1/t/is_statistics.test b/mysql-test/suite/funcs_1/t/is_statistics.test index 5b17b711fff..458892a6d91 100644 --- a/mysql-test/suite/funcs_1/t/is_statistics.test +++ b/mysql-test/suite/funcs_1/t/is_statistics.test @@ -16,7 +16,9 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc let $engine_type = MEMORY; let $other_engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/t/is_statistics_mysql.test b/mysql-test/suite/funcs_1/t/is_statistics_mysql.test index a75cc922777..a1250b67b8c 100644 --- a/mysql-test/suite/funcs_1/t/is_statistics_mysql.test +++ b/mysql-test/suite/funcs_1/t/is_statistics_mysql.test @@ -2,6 +2,9 @@ # # Check the content of information_schema.statistics about tables within # the database mysql for a high and a low privileged user. +# Variant for the non embedded server +# The expected results must equal is_statistics_mysql_embedded except that +# that the privilege system works (affects some result sets). # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -9,7 +12,7 @@ # Create this script based on older scripts and new code. # +--source include/not_embedded.inc let $database = mysql; let $my_where = WHERE table_schema = 'mysql'; --source suite/funcs_1/datadict/statistics.inc - diff --git a/mysql-test/suite/funcs_1/t/is_statistics_mysql_embedded.test b/mysql-test/suite/funcs_1/t/is_statistics_mysql_embedded.test new file mode 100644 index 00000000000..6fedbe4d3a8 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_statistics_mysql_embedded.test @@ -0,0 +1,19 @@ +# suite/funcs_1/t/is_statistics_mysql_embedded.test +# +# Check the content of information_schema.statistics about tables within +# the database mysql for a high and a low privileged user. +# Variant for the embedded server +# The expected results must equal is_statistics_mysql except that all users +# have all privileges (affects some result sets). +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +let $database = mysql; +let $my_where = WHERE table_schema = 'mysql'; +--source suite/funcs_1/datadict/statistics.inc diff --git a/mysql-test/suite/funcs_1/t/is_table_constraints.test b/mysql-test/suite/funcs_1/t/is_table_constraints.test index 60d5ebce703..a64b3bfaa6e 100644 --- a/mysql-test/suite/funcs_1/t/is_table_constraints.test +++ b/mysql-test/suite/funcs_1/t/is_table_constraints.test @@ -16,7 +16,9 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc let $engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/t/is_table_constraints_mysql.test b/mysql-test/suite/funcs_1/t/is_table_constraints_mysql.test index 5ef1561ccdf..a909676943e 100644 --- a/mysql-test/suite/funcs_1/t/is_table_constraints_mysql.test +++ b/mysql-test/suite/funcs_1/t/is_table_constraints_mysql.test @@ -2,6 +2,9 @@ # # Check the content of information_schema.table_constraints about tables within # the database mysql (= the system tables) with different privileged users. +# Variant for the non embedded server +# The expected results must equal is_table_constraints_mysql_embedded +# except that the privilege system works (affects some result sets). # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -9,6 +12,6 @@ # Create this script based on older scripts and new code. # +--source include/not_embedded.inc let $table_schema = mysql; --source suite/funcs_1/datadict/table_constraints.inc - diff --git a/mysql-test/suite/funcs_1/t/is_table_constraints_mysql_embedded.test b/mysql-test/suite/funcs_1/t/is_table_constraints_mysql_embedded.test new file mode 100644 index 00000000000..8994be31be8 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_table_constraints_mysql_embedded.test @@ -0,0 +1,18 @@ +# suite/funcs_1/t/is_table_constraints_mysql_embedded.test +# +# Check the content of information_schema.table_constraints about tables within +# the database mysql (= the system tables) with different privileged users. +# Variant for the embedded server +# The expected results must equal is_table_constraints_mysql +# except that all users have all privileges (affects some result sets). +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +let $table_schema = mysql; +--source suite/funcs_1/datadict/table_constraints.inc diff --git a/mysql-test/suite/funcs_1/t/is_table_privileges.test b/mysql-test/suite/funcs_1/t/is_table_privileges.test index b095a5ddad6..5ea0dd7c6a7 100644 --- a/mysql-test/suite/funcs_1/t/is_table_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_table_privileges.test @@ -16,7 +16,9 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc let $engine_type = MEMORY; let $other_engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/t/is_tables.test b/mysql-test/suite/funcs_1/t/is_tables.test index 35b6b7ef007..1c7620ffd45 100644 --- a/mysql-test/suite/funcs_1/t/is_tables.test +++ b/mysql-test/suite/funcs_1/t/is_tables.test @@ -2,14 +2,12 @@ # # Check the layout of information_schema.tables and the impact of # CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# Variant for the non embedded server +# The expected results must equal is_tables_embedded except that +# that the privilege system works (affects some result sets). # -# Note: -# This test is not intended -# - to show information about the all time existing tables -# within the databases information_schema and mysql -# - for checking storage engine properties -# Therefore please do not alter $engine_type and $other_engine_type. -# Some results of the subtests depend on the storage engines assigned. +# There is detailed information about this test within +# suite/funcs_1/datadict/is_tables.inc # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -17,458 +15,5 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre - -let $engine_type = MEMORY; -let $other_engine_type = MyISAM; - -let $is_table = TABLES; - -# The table INFORMATION_SCHEMA.TABLES must exist -eval SHOW TABLES FROM information_schema LIKE '$is_table'; - ---echo ####################################################################### ---echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT ---echo ####################################################################### -# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT -# statement, just as if it were an ordinary user-defined table. -# ---source suite/funcs_1/datadict/is_table_query.inc - - ---echo ######################################################################### ---echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.TABLES layout ---echo ######################################################################### -# Ensure that the INFORMATION_SCHEMA.TABLES table has the following columns, -# in the following order: -# -# TABLE_CATALOG (always shows NULL), -# TABLE_SCHEMA (shows the name of the database, or schema, in which an -# accessible table resides), -# TABLE_NAME (shows the name of a table which the current user may access), -# TABLE_TYPE (shows whether the table is a BASE TABLE, a TEMPORARY table, -# or a VIEW), -# ENGINE (shows the storage engine used for the table), -# VERSION (shows the version number of the table's .frm file), -# ROW_FORMAT (shows the table's row storage format; either FIXED, DYNAMIC -# or COMPRESSED), -# TABLE_ROWS (shows the number of rows in the table), -# AVG_ROW_LENGTH (shows the average length of the table's rows), -# DATA_LENGTH (shows the length of the table's data file), -# MAX_DATA_LENGTH (shows the maximum length of the table's data file), -# INDEX_LENGTH (shows the length of the index file associated with the table), -# DATA_FREE (shows the number of allocated, unused bytes), -# AUTO_INCREMENT (shows the next AUTO_INCREMENT value, where applicable), -# CREATE_TIME (shows the timestamp of the time the table was created), -# UPDATE_TIME (shows the timestamp of the time the table's data file was -# last updated), -# CHECK_TIME (shows the timestamp of the time the table was last checked), -# TABLE_COLLATION (shows the table's default collation), -# CHECKSUM (shows the live checksum value for the table, if any; otherwise NULL), -# CREATE_OPTIONS (shows any additional options used in the table's definition; -# otherwise NULL), -# TABLE_COMMENT (shows the comment added to the table's definition; -# otherwise NULL). -# ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval DESCRIBE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW CREATE TABLE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW COLUMNS FROM information_schema.$is_table; - -# Note: Retrieval of information within information_schema.columns about -# information_schema.tables is in is_columns_is.test. - -# Show that TABLE_CATALOG is always NULL. -SELECT table_catalog, table_schema, table_name -FROM information_schema.tables WHERE table_catalog IS NOT NULL; - - ---echo ################################################################################ ---echo # Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information ---echo ################################################################################ -# 3.2.12.2: Ensure that the table shows the relevant information on every base table -# and view on which the current user or PUBLIC has privileges. -# 3.2.12.3: Ensure that the table does not show any information on any tables -# on which the current user and public have no privileges. -# -# Note: Check of content within information_schema.tables about tables within -# database is in -# mysql is_tables_mysql.test -# information_schema is_tables_is.test -# test% is_tables_.test -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; - ---error 0,ER_CANNOT_USER -DROP USER 'testuser1'@'localhost'; -CREATE USER 'testuser1'@'localhost'; -GRANT CREATE, CREATE VIEW, INSERT, SELECT ON db_datadict.* - TO 'testuser1'@'localhost' WITH GRANT OPTION; ---error 0,ER_CANNOT_USER -DROP USER 'testuser2'@'localhost'; -CREATE USER 'testuser2'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser3'@'localhost'; -CREATE USER 'testuser3'@'localhost'; - ---replace_result $engine_type -eval -CREATE TABLE db_datadict.tb1 (f1 INT, f2 INT, f3 INT) -ENGINE = $engine_type; - -GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost'; -GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION; - -let $my_select = SELECT * FROM information_schema.tables -WHERE table_schema = 'db_datadict' ORDER BY table_name; -let $my_show = SHOW TABLES FROM db_datadict; - ---echo # Establish connection testuser1 (user=testuser1) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser1, localhost, testuser1, , db_datadict); -# tb2 is not granted to anyone ---replace_result $engine_type -eval -CREATE TABLE tb2 (f1 DECIMAL) -ENGINE = $engine_type; ---replace_result $engine_type -eval -CREATE TABLE tb3 (f1 VARCHAR(200)) -ENGINE = $engine_type; -GRANT SELECT ON db_datadict.tb3 to 'testuser3'@'localhost'; -GRANT INSERT ON db_datadict.tb3 to 'testuser2'@'localhost'; -CREATE VIEW v3 AS SELECT * FROM tb3; -GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost'; - -if ($have_bug_32285) -{ ---disable_ps_protocol -} -# We do not want to check here values affected by -# - the storage engine used -# - Operating system / Filesystem -# - start time of test -# 1 TABLE_CATALOG -# 2 TABLE_SCHEMA -# 3 TABLE_NAME -# 4 TABLE_TYPE -# 5 ENGINE affected by storage engine used -# 6 VERSION -# 7 ROW_FORMAT affected by storage engine used -# 8 TABLE_ROWS -# 9 AVG_ROW_LENGTH affected by storage engine used -# 10 DATA_LENGTH affected by storage engine used and maybe OS -# 11 MAX_DATA_LENGTH affected by storage engine used and maybe OS -# 12 INDEX_LENGTH affected by storage engine used and maybe OS -# 13 DATA_FREE affected by storage engine used and maybe OS -# 14 AUTO_INCREMENT -# 15 CREATE_TIME depends roughly on start time of test (*) -# 16 UPDATE_TIME depends roughly on start time of test (*) -# 17 CHECK_TIME depends roughly on start time of test and storage engine (*) -# 18 TABLE_COLLATION -# 19 CHECKSUM affected by storage engine used -# 20 CREATE_OPTIONS -# 21 TABLE_COMMENT affected by some storage engines -# (*) In case of view or temporary table NULL. ---replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" -eval $my_select; ---enable_ps_protocol ---sorted_result -eval $my_show; - ---echo # Establish connection testuser2 (user=testuser2) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser2, localhost, testuser2, , db_datadict); -if ($have_bug_32285) -{ ---disable_ps_protocol -} ---replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" -eval $my_select; ---enable_ps_protocol ---sorted_result -eval $my_show; - ---echo # Establish connection testuser3 (user=testuser3) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser3, localhost, testuser3, , db_datadict); -if ($have_bug_32285) -{ ---disable_ps_protocol -} ---replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" -eval $my_select; ---enable_ps_protocol ---sorted_result -eval $my_show; - ---echo # Switch to connection default (user=root) -connection default; -# we see only 'public' tables -if ($have_bug_32285) -{ ---disable_ps_protocol -} ---replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" -eval $my_select; ---enable_ps_protocol ---sorted_result -eval $my_show; - -# Cleanup ---echo # Close connection testuser1, testuser2, testuser3 -disconnect testuser1; -disconnect testuser2; -disconnect testuser3; -DROP USER 'testuser1'@'localhost'; -DROP USER 'testuser2'@'localhost'; -DROP USER 'testuser3'@'localhost'; -DROP DATABASE db_datadict; - - ---echo ######################################################################### ---echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLES modifications ---echo ######################################################################### -# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or -# column) automatically inserts all relevant information on that -# object into every appropriate INFORMATION_SCHEMA table. -# 3.2.1.14: Ensure that the alteration of any existing database object -# automatically updates all relevant information on that object in -# every appropriate INFORMATION_SCHEMA table. -# 3.2.1.15: Ensure that the dropping of any existing database object -# automatically deletes all relevant information on that object from -# every appropriate INFORMATION_SCHEMA table. -# ---disable_warnings -DROP TABLE IF EXISTS test.t1_my_table; -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; - -SELECT table_name FROM information_schema.tables -WHERE table_name LIKE 't1_my_table%'; ---replace_result $engine_type -eval -CREATE TABLE test.t1_my_table (f1 BIGINT) -DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci -COMMENT = 'Initial Comment' ENGINE = $engine_type; -# Settings used in CREATE TABLE must be visible in information_schema.tables. ---vertical_results ---replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#" -SELECT * FROM information_schema.tables -WHERE table_name = 't1_my_table'; ---horizontal_results -# -# Check modification of TABLE_NAME -SELECT table_name FROM information_schema.tables -WHERE table_name LIKE 't1_my_table%'; -RENAME TABLE test.t1_my_table TO test.t1_my_tablex; -SELECT table_name FROM information_schema.tables -WHERE table_name LIKE 't1_my_table%'; -# -# Check modification of TABLE_SCHEMA -SELECT table_schema,table_name FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex; -SELECT table_schema,table_name FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check modification of ENGINE ---replace_result $engine_type -SELECT table_name, engine FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; ---replace_result $other_engine_type -eval -ALTER TABLE db_datadict.t1_my_tablex -ENGINE = $other_engine_type; ---replace_result $other_engine_type -SELECT table_name, engine FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check modification of TABLE_ROWS -SELECT table_name, table_rows FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -INSERT INTO db_datadict.t1_my_tablex VALUES(1),(2); -SELECT table_name, table_rows FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check indirect modification of TABLE_COLLATION -SELECT table_name, table_collation FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -ALTER TABLE db_datadict.t1_my_tablex DEFAULT CHARACTER SET utf8; -SELECT table_name, table_collation FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# Check direct modification of TABLE_COLLATION -SELECT table_name, table_collation FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -ALTER TABLE db_datadict.t1_my_tablex -DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci; -SELECT table_name, table_collation FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check modification of TABLE_COMMENT -SELECT table_name, TABLE_COMMENT FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -ALTER TABLE db_datadict.t1_my_tablex COMMENT 'Changed Comment'; -SELECT table_name, TABLE_COMMENT FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check modification of AUTO_INCREMENT -SELECT table_name, AUTO_INCREMENT FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -ALTER TABLE db_datadict.t1_my_tablex -ADD f2 BIGINT AUTO_INCREMENT, ADD PRIMARY KEY (f2); -SELECT table_name, AUTO_INCREMENT FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check modification of ROW_FORMAT -SELECT table_name, ROW_FORMAT FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -ALTER TABLE db_datadict.t1_my_tablex ROW_FORMAT = dynamic; -SELECT table_name, ROW_FORMAT FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check "growth" of UPDATE_TIME and modification of CHECKSUM -SELECT table_name, checksum FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -ALTER TABLE db_datadict.t1_my_tablex CHECKSUM = 1; -SELECT table_name, checksum IS NOT NULL FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum -FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# Enforce a time difference bigger than the smallest unit (1 second). ---real_sleep 1.1 -INSERT INTO db_datadict.t1_my_tablex SET f1 = 3; -SELECT UPDATE_TIME > @UPDATE_TIME - AS "Is current UPDATE_TIME bigger than before last INSERT?" -FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -SELECT checksum <> @checksum - AS "Is current CHECKSUM different than before last INSERT?" -FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Information is used later -SELECT CREATE_TIME INTO @CREATE_TIME FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check impact of DROP TABLE -SELECT table_name FROM information_schema.tables -WHERE table_name LIKE 't1_my_table%'; -DROP TABLE db_datadict.t1_my_tablex; -SELECT table_name FROM information_schema.tables -WHERE table_name LIKE 't1_my_table%'; -# -# Check "growth" of CREATE_TIME ---replace_result $other_engine_type -eval -CREATE TABLE test.t1_my_tablex (f1 BIGINT) -ENGINE = $other_engine_type; -SELECT CREATE_TIME > @CREATE_TIME - AS "Is current CREATE_TIME bigger than for the old dropped table?" -FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -DROP TABLE test.t1_my_tablex; -# -# Check a VIEW -CREATE VIEW test.t1_my_tablex AS SELECT 1; ---vertical_results -SELECT * FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; ---horizontal_results -DROP VIEW test.t1_my_tablex; -SELECT table_name FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -# -# Check a temporary table ---replace_result $other_engine_type -eval -CREATE TEMPORARY TABLE test.t1_my_tablex -ENGINE = $other_engine_type - AS SELECT 1; ---vertical_results -SELECT table_name, table_type FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; ---horizontal_results -DROP TEMPORARY TABLE test.t1_my_tablex; -# -# Check impact of DROP SCHEMA ---replace_result $engine_type -eval -CREATE TABLE db_datadict.t1_my_tablex -ENGINE = $engine_type AS -SELECT 1; -SELECT table_name FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; -DROP DATABASE db_datadict; -SELECT table_name FROM information_schema.tables -WHERE table_name = 't1_my_tablex'; - - ---echo ######################################################################## ---echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and ---echo # DDL on INFORMATION_SCHEMA tables are not supported ---echo ######################################################################## -# 3.2.1.3: Ensure that no user may execute an INSERT statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.5: Ensure that no user may execute a DELETE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.8: Ensure that no user may create an index on an -# INFORMATION_SCHEMA table. -# 3.2.1.9: Ensure that no user may alter the definition of an -# INFORMATION_SCHEMA table. -# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. -# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any -# other database. -# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data -# in an INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; ---replace_result $engine_type -eval -CREATE TABLE db_datadict.t1 (f1 BIGINT) -ENGINE = $engine_type; - ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.tables -SELECT * FROM information_schema.tables; - ---error ER_DBACCESS_DENIED_ERROR -UPDATE information_schema.tables SET table_schema = 'test' -WHERE table_name = 't1'; - ---error ER_DBACCESS_DENIED_ERROR -DELETE FROM information_schema.tables WHERE table_name = 't1'; ---error ER_DBACCESS_DENIED_ERROR -TRUNCATE information_schema.tables; - ---error ER_DBACCESS_DENIED_ERROR -CREATE INDEX my_idx_on_tables ON information_schema.tables(table_schema); - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.tables DROP PRIMARY KEY; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.tables ADD f1 INT; - ---error ER_DBACCESS_DENIED_ERROR -DROP TABLE information_schema.tables; - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.tables RENAME db_datadict.tables; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.tables RENAME information_schema.xtables; - -# Cleanup -DROP DATABASE db_datadict; - +--source include/not_embedded.inc +--source suite/funcs_1/datadict/is_tables.inc diff --git a/mysql-test/suite/funcs_1/t/is_tables_embedded.test b/mysql-test/suite/funcs_1/t/is_tables_embedded.test new file mode 100644 index 00000000000..d3c59ffff36 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_tables_embedded.test @@ -0,0 +1,20 @@ +# suite/funcs_1/t/is_tables_embedded.test +# +# Check the layout of information_schema.tables and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# Variant for the embedded server +# The expected results must equal is_tables except that all users +# have all privileges (affects some result sets). +# +# There is detailed information about this test within +# suite/funcs_1/datadict/is_tables.inc +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +--source suite/funcs_1/datadict/is_tables.inc diff --git a/mysql-test/suite/funcs_1/t/is_tables_innodb.test b/mysql-test/suite/funcs_1/t/is_tables_innodb.test index 31a3900c7c3..ed6b7e60bbd 100644 --- a/mysql-test/suite/funcs_1/t/is_tables_innodb.test +++ b/mysql-test/suite/funcs_1/t/is_tables_innodb.test @@ -10,13 +10,13 @@ # Create this script based on older scripts and new code. # +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc + --source include/have_innodb.inc let $engine_type= InnoDB; ---source suite/funcs_1/datadict/datadict_load.inc ---enable_abort_on_error -# We look only for the tables created by datadict_load.inc. +# We look only for the tables created by suite/funcs_1/datadict/tables.inc let $my_where = WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'; ---source suite/funcs_1/datadict/tables1.inc - ---source suite/funcs_1/include/cleanup.inc +--source suite/funcs_1/datadict/tables.inc diff --git a/mysql-test/suite/funcs_1/t/is_tables_memory.test b/mysql-test/suite/funcs_1/t/is_tables_memory.test index 8b5da595462..68909aee866 100644 --- a/mysql-test/suite/funcs_1/t/is_tables_memory.test +++ b/mysql-test/suite/funcs_1/t/is_tables_memory.test @@ -10,13 +10,13 @@ # Create this script based on older scripts and new code. # +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc + let $engine_type= MEMORY; SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; ---source suite/funcs_1/datadict/datadict_load.inc ---enable_abort_on_error -# We look only for the tables created by datadict_load.inc. +# We look only for the tables created by suite/funcs_1/datadict/tables.inc let $my_where = WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'; ---source suite/funcs_1/datadict/tables1.inc - ---source suite/funcs_1/include/cleanup.inc +--source suite/funcs_1/datadict/tables.inc diff --git a/mysql-test/suite/funcs_1/t/is_tables_myisam.test b/mysql-test/suite/funcs_1/t/is_tables_myisam.test index 4fc88364d87..c3f7c87b0ed 100644 --- a/mysql-test/suite/funcs_1/t/is_tables_myisam.test +++ b/mysql-test/suite/funcs_1/t/is_tables_myisam.test @@ -2,7 +2,9 @@ # # Check the content of information_schema.tables about tables within # the databases created by the user. -# Variant for storage engine MyISAM +# Variant for storage engine MyISAM and the non embedded server +# The expected results must equal is_columns_myisam_embedded except that +# that the privilege system works (affects some result sets). # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -10,13 +12,10 @@ # Create this script based on older scripts and new code. # +--source include/not_embedded.inc let $engine_type= MyISAM; SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; ---source suite/funcs_1/datadict/datadict_load.inc ---enable_abort_on_error -# We look only for the tables created by datadict_load.inc. +# We look only for the tables created by suite/funcs_1/datadict/tables.inc let $my_where = WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'; ---source suite/funcs_1/datadict/tables1.inc - ---source suite/funcs_1/include/cleanup.inc +--source suite/funcs_1/datadict/tables.inc diff --git a/mysql-test/suite/funcs_1/t/is_tables_myisam_embedded.test b/mysql-test/suite/funcs_1/t/is_tables_myisam_embedded.test new file mode 100644 index 00000000000..d4595900939 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_tables_myisam_embedded.test @@ -0,0 +1,22 @@ +# suite/funcs_1/t/is_tables_myisam_embedded.test +# +# Check the content of information_schema.tables about tables within +# the databases created by the user. +# Variant for storage engine MyISAM and the embedded server +# The expected results must equal is_tabless_myisam except that +# that the privilege system works (affects some result sets). +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +let $engine_type= MyISAM; +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; + +# We look only for the tables created by suite/funcs_1/datadict/tables.inc +let $my_where = WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'; +--source suite/funcs_1/datadict/tables.inc diff --git a/mysql-test/suite/funcs_1/t/is_tables_mysql.test b/mysql-test/suite/funcs_1/t/is_tables_mysql.test index a6c3a72a1cf..838704051f8 100644 --- a/mysql-test/suite/funcs_1/t/is_tables_mysql.test +++ b/mysql-test/suite/funcs_1/t/is_tables_mysql.test @@ -2,6 +2,9 @@ # # Check the content of information_schema.tables about tables within # the database mysql (= the system tables). +# Variant for the non embedded server +# The expected results must equal is_tables_mysql_embedded except that +# that the privilege system works (affects some result sets). # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -9,6 +12,6 @@ # Create this script based on older scripts and new code. # +--source include/not_embedded.inc let $my_where = WHERE table_schema = 'mysql'; --source suite/funcs_1/datadict/tables1.inc - diff --git a/mysql-test/suite/funcs_1/t/is_tables_mysql_embedded.test b/mysql-test/suite/funcs_1/t/is_tables_mysql_embedded.test new file mode 100644 index 00000000000..3f4ca17cdd3 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_tables_mysql_embedded.test @@ -0,0 +1,18 @@ +# suite/funcs_1/t/is_tables_mysql_embedded.test +# +# Check the content of information_schema.tables about tables within +# the database mysql (= the system tables). +# Variant for the embedded server +# The expected results must equal is_tables_mysql except that all users +# have all privileges (affects some result sets). +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +let $my_where = WHERE table_schema = 'mysql'; +--source suite/funcs_1/datadict/tables1.inc diff --git a/mysql-test/suite/funcs_1/t/is_tables_ndb.test b/mysql-test/suite/funcs_1/t/is_tables_ndb.test index 49ce60b08bd..d21831b75c8 100644 --- a/mysql-test/suite/funcs_1/t/is_tables_ndb.test +++ b/mysql-test/suite/funcs_1/t/is_tables_ndb.test @@ -10,25 +10,13 @@ # Create this script based on older scripts and new code. # +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc + --source include/have_ndb.inc let $engine_type= NDB; ---source suite/funcs_1/datadict/datadict_load.inc ---enable_abort_on_error -# We look only for the tables created by datadict_load.inc. +# We look only for the tables created by suite/funcs_1/datadict/tables.inc let $my_where = WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'; ---source suite/funcs_1/datadict/tables1.inc - -# This test runs with a different set of tables. -# --source suite/funcs_1/include/cleanup.inc -DROP DATABASE test1; -DROP DATABASE test4; -DROP TABLE test.t1; -DROP TABLE test.t2; -DROP TABLE test.t3; -DROP TABLE test.t4; -DROP TABLE test.t7; -DROP TABLE test.t8; -DROP TABLE test.t9; -DROP TABLE test.t10; -DROP TABLE test.t11; +--source suite/funcs_1/datadict/tables.inc diff --git a/mysql-test/suite/funcs_1/t/is_triggers.test b/mysql-test/suite/funcs_1/t/is_triggers.test index 261f082fb50..fd42cb4e734 100644 --- a/mysql-test/suite/funcs_1/t/is_triggers.test +++ b/mysql-test/suite/funcs_1/t/is_triggers.test @@ -2,14 +2,12 @@ # # Check the layout of information_schema.triggers and the impact of # CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# Variant for the non embedded server +# The expected results must equal is_triggers_embedded except that +# that the privilege system works (affects some result sets). # -# Note: -# This test is not intended -# - to show information about the all time existing triggers -# (there are no in the moment) within the databases information_schema -# and mysql -# - for checking storage engine properties -# Therefore please do not alter $engine_type and $other_engine_type. +# There is detailed information about this test within +# suite/funcs_1/datadict/is_triggers.inc # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -17,237 +15,5 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre - -let $engine_type = MEMORY; -let $other_engine_type = MyISAM; - -let $is_table = TRIGGERS; - -# The table INFORMATION_SCHEMA.TRIGGERS must exist -eval SHOW TABLES FROM information_schema LIKE '$is_table'; - ---echo ####################################################################### ---echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT ---echo ####################################################################### -# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT -# statement, just as if it were an ordinary user-defined table. -# ---source suite/funcs_1/datadict/is_table_query.inc - - ---echo ######################################################################### ---echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.TRIGGERS layout ---echo ######################################################################### -# Ensure that the INFORMATION_SCHEMA.TRIGGERS table has the following columns, -# in the following order: -# -# TRIGGER_CATALOG NULL -# TRIGGER_SCHEMA name of the database in which the trigger occurs -# TRIGGER_NAME -# EVENT_MANIPULATION event associated with the trigger -# ('INSERT', 'DELETE', or 'UPDATE') -# EVENT_OBJECT_CATALOG NULL -# EVENT_OBJECT_SCHEMA database in which the table associated with the -# trigger occurs -# EVENT_OBJECT_TABLE name of the table associated with the trigger -# ACTION_ORDER 0 -# ACTION_CONDITION NULL -# ACTION_STATEMENT -# ACTION_ORIENTATION ROW -# ACTION_TIMING 'BEFORE' or 'AFTER' -# ACTION_REFERENCE_OLD_TABLE NULL -# ACTION_REFERENCE_NEW_TABLE NULL -# ACTION_REFERENCE_OLD_ROW OLD -# ACTION_REFERENCE_NEW_ROW NEW -# CREATED NULL (0) -# SQL_MODE server SQL mode that was in effect at the time -# when the trigger was created -# (also used during trigger execution) -# DEFINER who defined the trigger -# ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval DESCRIBE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW CREATE TABLE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW COLUMNS FROM information_schema.$is_table; - - -# Note: Retrieval of information within information_schema.columns about -# information_schema.tables is in is_columns_is.test. - -# Show that several columns are always 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 - OR action_reference_new_table IS NOT NULL; - - ---echo ################################################################################## ---echo # Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information ---echo ################################################################################## -# 3.2.18.2: Ensure that the table shows the relevant information on every -# trigger on which the current user or PUBLIC has privileges. -# 3.2.18.3: Ensure that the table does not show any information on any trigger -# on which the current user and public have no privileges. -# The SUPER privilege is required for -# - creation of triggers -# - retrieval in INFORMATION_SCHEMA.TRIGGERS (affects size of result set) -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; ---error 0,ER_CANNOT_USER -DROP USER 'testuser1'@'localhost'; -CREATE USER 'testuser1'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser2'@'localhost'; -CREATE USER 'testuser2'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser3'@'localhost'; -CREATE USER 'testuser3'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser4'@'localhost'; -CREATE USER 'testuser4'@'localhost'; - -GRANT SUPER ON *.* TO 'testuser1'@'localhost'; -GRANT SUPER ON *.* TO 'testuser3'@'localhost'; -GRANT SUPER ON *.* TO 'testuser4'@'localhost'; -GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION; - -let $my_select = SELECT * FROM information_schema.triggers -WHERE trigger_name = 'trg1'; -let $my_show = SHOW TRIGGERS FROM db_datadict; ---echo # Establish connection testuser1 (user=testuser1) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser1, localhost, testuser1, , db_datadict); ---replace_result $engine_type -eval -CREATE TABLE db_datadict.t1 (f1 INT, f2 INT, f3 INT) -ENGINE = $engine_type; -CREATE TRIGGER trg1 BEFORE INSERT -ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before; -GRANT ALL ON db_datadict.t1 TO 'testuser2'@'localhost'; -GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost'; -eval $my_select; -eval $my_show; - ---echo # Establish connection testuser2 (user=testuser2) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser2, localhost, testuser2, , db_datadict); -SHOW GRANTS FOR 'testuser2'@'localhost'; ---echo # No SUPER Privilege --> no result for query -eval $my_select; -eval $my_show; - ---echo # Establish connection testuser3 (user=testuser3) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser3, localhost, testuser3, , test); -SHOW GRANTS FOR 'testuser3'@'localhost'; ---echo # SUPER Privilege + SELECT Privilege on t1 --> result for query -eval $my_select; -eval $my_show; - ---echo # Establish connection testuser4 (user=testuser4) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser4, localhost, testuser4, , test); -SHOW GRANTS FOR 'testuser4'@'localhost'; ---echo # SUPER Privilege + no SELECT Privilege on t1 --> no result for query -eval $my_select; -eval $my_show; - ---echo # Switch to connection default and close connections testuser1 - testuser4 -connection default; -disconnect testuser1; -disconnect testuser2; -disconnect testuser3; -disconnect testuser4; -eval $my_select; -eval $my_show; -DROP USER 'testuser1'@'localhost'; -DROP USER 'testuser2'@'localhost'; -DROP USER 'testuser3'@'localhost'; -DROP USER 'testuser4'@'localhost'; -DROP DATABASE db_datadict; - - ---echo ######################################################################### ---echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TRIGGERS modifications ---echo ######################################################################### -# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or -# column) automatically inserts all relevant information on that -# object into every appropriate INFORMATION_SCHEMA table. -# 3.2.1.14: Ensure that the alteration of any existing database object -# automatically updates all relevant information on that object in -# every appropriate INFORMATION_SCHEMA table. -# 3.2.1.15: Ensure that the dropping of any existing database object -# automatically deletes all relevant information on that object from -# every appropriate INFORMATION_SCHEMA table. -# FIXME: To be implemented - - ---echo ######################################################################## ---echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and ---echo # DDL on INFORMATION_SCHEMA tables are not supported ---echo ######################################################################## -# 3.2.1.3: Ensure that no user may execute an INSERT statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.5: Ensure that no user may execute a DELETE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.8: Ensure that no user may create an index on an -# INFORMATION_SCHEMA table. -# 3.2.1.9: Ensure that no user may alter the definition of an -# INFORMATION_SCHEMA table. -# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. -# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any -# other database. -# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data -# in an INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; ---replace_result $engine_type -eval -CREATE TABLE db_datadict.t1 (f1 BIGINT) -ENGINE = $engine_type; -CREATE TRIGGER db_datadict.trg1 BEFORE INSERT -ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before; - ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.triggers -SELECT * FROM information_schema.triggers; - ---error ER_DBACCESS_DENIED_ERROR -UPDATE information_schema.triggers SET trigger_schema = 'test' -WHERE table_name = 't1'; - ---error ER_DBACCESS_DENIED_ERROR -DELETE FROM information_schema.triggers WHERE trigger_name = 't1'; ---error ER_DBACCESS_DENIED_ERROR -TRUNCATE information_schema.triggers; - ---error ER_DBACCESS_DENIED_ERROR -CREATE INDEX my_idx_on_triggers ON information_schema.triggers(trigger_schema); - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.triggers DROP PRIMARY KEY; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.triggers ADD f1 INT; - ---error ER_DBACCESS_DENIED_ERROR -DROP TABLE information_schema.triggers; - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.triggers RENAME db_datadict.triggers; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers; - -# Cleanup -DROP DATABASE db_datadict; - +--source include/not_embedded.inc +--source suite/funcs_1/datadict/is_triggers.inc diff --git a/mysql-test/suite/funcs_1/t/is_triggers_embedded.test b/mysql-test/suite/funcs_1/t/is_triggers_embedded.test new file mode 100644 index 00000000000..d8e99c77bff --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_triggers_embedded.test @@ -0,0 +1,20 @@ +# suite/funcs_1/t/is_triggers_embedded.test +# +# Check the layout of information_schema.triggers and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# Variant for the embedded server +# The expected results must equal is_triggers except that all users +# have all privileges (affects some result sets). +# +# There is detailed information about this test within +# suite/funcs_1/datadict/is_triggers.inc +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +--source suite/funcs_1/datadict/is_triggers.inc diff --git a/mysql-test/suite/funcs_1/t/is_user_privileges.test b/mysql-test/suite/funcs_1/t/is_user_privileges.test index dc39ad6fe4f..1d0d3e51aae 100644 --- a/mysql-test/suite/funcs_1/t/is_user_privileges.test +++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test @@ -16,7 +16,9 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre +# This test cannot be used for the embedded server because we check here +# privileges. +--source include/not_embedded.inc let $engine_type = MEMORY; let $other_engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/t/is_views.test b/mysql-test/suite/funcs_1/t/is_views.test index 9819fe1ffe0..b8c9c114e5f 100644 --- a/mysql-test/suite/funcs_1/t/is_views.test +++ b/mysql-test/suite/funcs_1/t/is_views.test @@ -2,13 +2,12 @@ # # Check the layout of information_schema.views and the impact of # CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# Variant for the non embedded server +# The expected results must equal is_views_embedded except that +# that the privilege system works (affects some result sets). # -# Note: -# - This test should not check storage engine properties. -# - Please do not change the storage engines used within this test -# except you know that the impact is acceptable. -# Some storage engines might not support the modification of -# properties like in the following tests. +# There is detailed information about this test within +# suite/funcs_1/datadict/is_views.inc # # Author: # 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of @@ -16,290 +15,5 @@ # Create this script based on older scripts and new code. # -# --source suite/funcs_1/datadict/datadict.pre - -let $engine_type = MEMORY; -let $other_engine_type = MyISAM; - -let $is_table = VIEWS; - -# The table INFORMATION_SCHEMA.VIEWS must exist -eval SHOW TABLES FROM information_schema LIKE '$is_table'; - ---echo ####################################################################### ---echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT ---echo ####################################################################### -# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT -# statement, just as if it were an ordinary user-defined table. -# ---source suite/funcs_1/datadict/is_table_query.inc - - ---echo ######################################################################### ---echo # Testcase 3.2.13.1: INFORMATION_SCHEMA.VIEWS layout ---echo ######################################################################### -# Ensure that the INFORMATION_SCHEMA.VIEWS table has the following columns, -# in the following order: -# -# TABLE_CATALOG (always shows NULL), -# TABLE_SCHEMA (shows the database, or schema, in which an accessible -# view resides), -# TABLE_NAME (shows the name of a view accessible to the current user), -# VIEW_DEFINITION (shows the SELECT statement that makes up the -# view's definition), -# CHECK_OPTION (shows the value of the WITH CHECK OPTION clause used to define -# the view, either NONE, LOCAL or CASCADED), -# IS_UPDATABLE (shows whether the view is an updatable view), -# DEFINER (added with 5.0.14), -# SECURITY_TYPE (added with 5.0.14). -# ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval DESCRIBE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW CREATE TABLE information_schema.$is_table; ---source suite/funcs_1/datadict/datadict_bug_12777.inc -eval SHOW COLUMNS FROM information_schema.$is_table; - -# Note: Retrieval of information within information_schema.columns about -# information_schema.views is in is_columns_is.test. - -# Show that TABLE_CATALOG is always NULL. -SELECT table_catalog, table_schema, table_name -FROM information_schema.views WHERE table_catalog IS NOT NULL; - - ---echo ################################################################################ ---echo # Testcase 3.2.13.2 + 3.2.13.3: INFORMATION_SCHEMA.VIEWS accessible information ---echo ################################################################################ -# 3.2.13.2: Ensure that the table shows the relevant information on every view for -# which the current user or PUBLIC has the SHOW CREATE VIEW privilege. -# 3.2.13.3: Ensure that the table does not show any information on any views for which -# the current user and PUBLIC have no SHOW CREATE VIEW privilege. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; - ---error 0,ER_CANNOT_USER -DROP USER 'testuser1'@'localhost'; -CREATE USER 'testuser1'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'testuser2'@'localhost'; -CREATE USER 'testuser2'@'localhost'; ---error 0,ER_CANNOT_USER -DROP USER 'test_no_views'@'localhost'; -CREATE USER 'test_no_views'@'localhost'; - ---replace_result $engine_type -eval -CREATE TABLE db_datadict.t1(f1 INT, f2 INT, f3 INT) -ENGINE = $engine_type; -CREATE VIEW db_datadict.v_granted_to_1 AS SELECT * FROM db_datadict.t1; -CREATE VIEW db_datadict.v_granted_glob AS SELECT f2, f3 FROM db_datadict.t1; - -GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost'; -GRANT SELECT ON db_datadict.v_granted_to_1 TO 'testuser1'@'localhost'; -GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost'; - -let $select = SELECT * FROM information_schema.views -WHERE table_schema = 'db_datadict' ORDER BY table_name; -eval $select; - ---echo # Establish connection testuser1 (user=testuser1) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser1, localhost, testuser1, , test); -eval $select; - ---echo # Establish connection testuser2 (user=testuser2) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (testuser2, localhost, testuser2, , test); -eval $select; - ---echo # Establish connection test_no_views (user=test_no_views) ---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK -connect (test_no_views, localhost, test_no_views, , test); -eval $select; - -# Cleanup ---echo # Switch to connection default and close all other connections -connection default; -disconnect testuser1; -disconnect testuser2; -disconnect test_no_views; -DROP USER 'testuser1'@'localhost'; -DROP USER 'testuser2'@'localhost'; -DROP USER 'test_no_views'@'localhost'; -DROP DATABASE db_datadict; - ---echo ######################################################################### ---echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.VIEWS modifications ---echo ######################################################################### -# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or -# column) automatically inserts all relevant information on that -# object into every appropriate INFORMATION_SCHEMA table. -# 3.2.1.14: Ensure that the alteration of any existing database object -# automatically updates all relevant information on that object in -# every appropriate INFORMATION_SCHEMA table. -# 3.2.1.15: Ensure that the dropping of any existing database object -# automatically deletes all relevant information on that object from -# every appropriate INFORMATION_SCHEMA table. -# ---disable_warnings -DROP TABLE IF EXISTS test.t1_my_table; -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; ---replace_result $engine_type -eval -CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10)) -DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci -ENGINE = $engine_type; ---error 0,ER_CANNOT_USER -DROP USER 'testuser1'@'localhost'; -CREATE USER 'testuser1'@'localhost'; - -# Check just created VIEW -SELECT * FROM information_schema.views -WHERE table_name LIKE 't1_%'; -CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table; -SELECT * FROM information_schema.views -WHERE table_name LIKE 't1_%'; -# -# Check modification of DEFINER, SECURITY_TYPE, IS_UPDATABLE, VIEW_DEFINITION, -# CHECK_OPTION -SELECT table_name,definer FROM information_schema.views -WHERE table_name = 't1_view'; -ALTER DEFINER = 'testuser1'@'localhost' VIEW test.t1_view AS -SELECT DISTINCT f1 FROM test.t1_table; -# The next result set could suffer from -# Bug#22763 Disrepancy between SHOW CREATE VIEW and I_S.VIEWS -# because the VIEW definition is missing. -# Therefore we exclude the problematic columns from the result set. -SELECT table_name,definer,security_type FROM information_schema.views -WHERE table_name LIKE 't1_%'; -ALTER DEFINER = 'root'@'localhost' SQL SECURITY INVOKER VIEW test.t1_view AS -SELECT f1 FROM test.t1_table WITH LOCAL CHECK OPTION; -SELECT table_name,definer,security_type FROM information_schema.views -WHERE table_name LIKE 't1_%'; -# -# Check modification of TABLE_SCHEMA -SELECT table_schema,table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_schema,table_name; ---error ER_FORBID_SCHEMA_CHANGE -RENAME TABLE test.t1_view TO db_datadict.t1_view; -# Workaround for missing move to another database -DROP VIEW test.t1_view; -CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table; -SELECT table_schema,table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_schema,table_name; -# -# Check modification of TABLE_NAME -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; -RENAME TABLE db_datadict.t1_view TO db_datadict.t1_viewx; -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; -# -# Check impact of DROP VIEW -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; -DROP VIEW db_datadict.t1_viewx; -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; -CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table; -# -# Check impact of DROP base TABLE of VIEW -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; -DROP TABLE test.t1_table; -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; ---replace_result $engine_type -eval -CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10)) -DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci COMMENT = 'Initial Comment' -ENGINE = $engine_type; -# -# Check impact of DROP SCHEMA -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; -DROP DATABASE db_datadict; -SELECT table_name FROM information_schema.views -WHERE table_name LIKE 't1_%' -ORDER BY table_name; - -# Cleanup -DROP USER 'testuser1'@'localhost'; -DROP TABLE test.t1_table; - ---echo ######################################################################## ---echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and ---echo # DDL on INFORMATION_SCHEMA table are not supported ---echo ######################################################################## -# 3.2.1.3: Ensure that no user may execute an INSERT statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.5: Ensure that no user may execute a DELETE statement on any -# INFORMATION_SCHEMA table. -# 3.2.1.8: Ensure that no user may create an index on an -# INFORMATION_SCHEMA table. -# 3.2.1.9: Ensure that no user may alter the definition of an -# INFORMATION_SCHEMA table. -# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. -# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any -# other database. -# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data -# in an INFORMATION_SCHEMA table. -# ---disable_warnings -DROP DATABASE IF EXISTS db_datadict; ---enable_warnings -CREATE DATABASE db_datadict; -CREATE VIEW db_datadict.v1 AS SELECT 1; - ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.views -SELECT * FROM information_schema.views; ---error ER_DBACCESS_DENIED_ERROR -INSERT INTO information_schema.views(table_schema, table_name) -VALUES ('db2', 'v2'); - ---error ER_DBACCESS_DENIED_ERROR -UPDATE information_schema.views SET table_schema = 'test' -WHERE table_name = 't1'; - ---error ER_DBACCESS_DENIED_ERROR -DELETE FROM information_schema.views WHERE table_name = 't1'; ---error ER_DBACCESS_DENIED_ERROR -TRUNCATE information_schema.views; - ---error ER_DBACCESS_DENIED_ERROR -CREATE INDEX my_idx_on_views ON information_schema.views(table_schema); - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.views DROP PRIMARY KEY; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.views ADD f1 INT; - ---error ER_DBACCESS_DENIED_ERROR -DROP TABLE information_schema.views; - ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.views RENAME db_datadict.views; ---error ER_DBACCESS_DENIED_ERROR -ALTER TABLE information_schema.views RENAME information_schema.xviews; - -# Cleanup -DROP DATABASE db_datadict; - +--source include/not_embedded.inc +--source suite/funcs_1/datadict/is_views.inc diff --git a/mysql-test/suite/funcs_1/t/is_views_embedded.test b/mysql-test/suite/funcs_1/t/is_views_embedded.test new file mode 100644 index 00000000000..66b4f59e897 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/is_views_embedded.test @@ -0,0 +1,20 @@ +# suite/funcs_1/t/is_views_embedded.test +# +# Check the layout of information_schema.views and the impact of +# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it. +# Variant for the embedded server +# The expected results must equal is_views except that all users +# have all privileges (affects some result sets). +# +# There is detailed information about this test within +# suite/funcs_1/datadict/is_views.inc +# +# Author: +# 2008-06-06 mleich Create this this variant for the embedded server. +# + +if (`SELECT VERSION() NOT LIKE '%embedded%'`) +{ + --skip Test requires: embedded server +} +--source suite/funcs_1/datadict/is_views.inc diff --git a/mysql-test/suite/funcs_1/t/memory_trig_0102.test b/mysql-test/suite/funcs_1/t/memory_trig_0102.test index f13ca29e583..a9e4f1142d0 100644 --- a/mysql-test/suite/funcs_1/t/memory_trig_0102.test +++ b/mysql-test/suite/funcs_1/t/memory_trig_0102.test @@ -4,5 +4,6 @@ # # Set $engine_type let $engine_type= memory; +--source suite/funcs_1/include/bug28309_skip.inc --source suite/funcs_1/triggers/triggers_0102.inc diff --git a/mysql-test/suite/funcs_1/t/memory_trig_0407.test b/mysql-test/suite/funcs_1/t/memory_trig_0407.test index be87f191b2c..93efe2d0fe8 100644 --- a/mysql-test/suite/funcs_1/t/memory_trig_0407.test +++ b/mysql-test/suite/funcs_1/t/memory_trig_0407.test @@ -4,5 +4,6 @@ # # Set $engine_type let $engine_type= memory; +--source suite/funcs_1/include/bug28309_skip.inc --source suite/funcs_1/triggers/triggers_0407.inc diff --git a/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test b/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test index e604d172f75..339a5a9cd9a 100644 --- a/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test +++ b/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test @@ -4,5 +4,6 @@ # # Set $engine_type let $engine_type= memory; +--source suite/funcs_1/include/bug28309_skip.inc --source suite/funcs_1/triggers/triggers_1011ext.inc diff --git a/mysql-test/suite/funcs_1/t/memory_views.test b/mysql-test/suite/funcs_1/t/memory_views.test index b506f08cf31..9bf9af11dfa 100644 --- a/mysql-test/suite/funcs_1/t/memory_views.test +++ b/mysql-test/suite/funcs_1/t/memory_views.test @@ -4,6 +4,7 @@ # # Set $engine_type let $engine_type= memory; +--source suite/funcs_1/include/bug28309_skip.inc # Create some objects needed in many testcases USE test; diff --git a/mysql-test/suite/funcs_1/triggers/trig_frkey.inc b/mysql-test/suite/funcs_1/triggers/trig_frkey.inc index 5d6b6a72b1e..5aba368f531 100644 --- a/mysql-test/suite/funcs_1/triggers/trig_frkey.inc +++ b/mysql-test/suite/funcs_1/triggers/trig_frkey.inc @@ -1,50 +1,59 @@ ################################################################# -# This file inclde tests that address the foreign key cases of +# This file include tests that address the foreign key cases of # the following requirements since they are specific to innodb. # Other test cases for these requirements are included in the -# triggers_master.test file. +# triggers_*.inc files. ################################################################# --disable_abort_on_error -#Section x.x.x.1 +# Section x.x.x.1 # Test case: Verifing that a trigger that activates a primary key results in # the primary key acting correctly on the foreign key let $message= Testcase x.x.x.1:; --source include/show_msg.inc - --disable_warnings - DROP TABLE IF EXISTS t0, t1, t2; - --enable_warnings +--disable_warnings +DROP TABLE IF EXISTS t0, t1, t2; +--enable_warnings - eval CREATE TABLE t0 (col1 char(50)) ENGINE=$engine_type; - eval CREATE TABLE t1 (id INT NOT NULL, col1 char(50), - PRIMARY KEY (id)) ENGINE=$engine_type; - eval CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT, - INDEX par_ind (f_id), col1 char(50), - FOREIGN KEY (f_id) REFERENCES t1(id) - ON DELETE SET NULL) ENGINE=$engine_type; +--replace_result $engine_type +eval +CREATE TABLE t0 (col1 CHAR(50)) +ENGINE = $engine_type; +--replace_result $engine_type +eval +CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id)) +ENGINE = $engine_type; +--replace_result $engine_type +eval +CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT, + INDEX par_ind (f_id), col1 CHAR(50), + FOREIGN KEY (f_id) REFERENCES t1(id) ON DELETE SET NULL) +ENGINE = $engine_type; - insert into t1 values (1,'Department A'); - insert into t1 values (2,'Department B'); - insert into t1 values (3,'Department C'); - insert into t2 values (1,2,'Emp 1'); - insert into t2 values (2,2,'Emp 2'); - insert into t2 values (3,2,'Emp 3'); +INSERT INTO t1 VALUES (1,'Department A'); +INSERT INTO t1 VALUES (2,'Department B'); +INSERT INTO t1 VALUES (3,'Department C'); +INSERT INTO t2 VALUES (1,2,'Emp 1'); +INSERT INTO t2 VALUES (2,2,'Emp 2'); +INSERT INTO t2 VALUES (3,2,'Emp 3'); - create trigger trig after insert on t0 for each row - delete from t1 where col1=new.col1; +CREATE TRIGGER trig AFTER INSERT ON t0 FOR EACH ROW +DELETE FROM t1 WHERE col1 = new.col1; - select * from t2; -lock tables t0 write, t1 write; - insert into t0 values ('Department B'); -unlock tables; - select * from t2; +--sorted_result +SELECT * FROM t2; +LOCK TABLES t0 WRITE, t1 WRITE; +INSERT INTO t0 VALUES ('Department B'); +UNLOCK TABLES; +--sorted_result +SELECT * FROM t2; # Cleanup - drop trigger trig; - drop table t2, t1; +DROP TRIGGER trig; +DROP TABLE t2, t1; #Section x.x.x.2 @@ -53,41 +62,47 @@ unlock tables; let $message= Testcase x.x.x.2:; --source include/show_msg.inc - --disable_warnings - DROP TABLE IF EXISTS t1, t2; - --enable_warnings +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings - eval CREATE TABLE t1 (id INT NOT NULL, col1 char(50), - PRIMARY KEY (id)) ENGINE=$engine_type; - eval CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT, - INDEX par_ind (f_id), col1 char(50), - FOREIGN KEY (f_id) REFERENCES t1(id) - ON UPDATE CASCADE) ENGINE=$engine_type; +--replace_result $engine_type +eval +CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id)) +ENGINE = $engine_type; +--replace_result $engine_type +eval +CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT, + INDEX par_ind (f_id), col1 CHAR(50), + FOREIGN KEY (f_id) REFERENCES t1(id) ON UPDATE CASCADE) +ENGINE = $engine_type; - insert into t1 values (1,'Department A'); - insert into t1 values (2,'Department B'); - insert into t1 values (3,'Department C'); - insert into t2 values (1,2,'Emp 1'); - insert into t2 values (2,3,'Emp 2'); +INSERT INTO t1 VALUES (1,'Department A'); +INSERT INTO t1 VALUES (2,'Department B'); +INSERT INTO t1 VALUES (3,'Department C'); +INSERT INTO t2 VALUES (1,2,'Emp 1'); +INSERT INTO t2 VALUES (2,3,'Emp 2'); - --error 1452 - insert into t2 values (3,4,'Emp 3'); +--error ER_NO_REFERENCED_ROW_2 +insert into t2 VALUES (3,4,'Emp 3'); - create trigger tr_t2 before insert on t2 for each row - insert into t1 values(new.f_id, concat('New Department ', new.f_id)); +CREATE TRIGGER tr_t2 BEFORE INSERT ON t2 FOR EACH ROW +INSERT INTO t1 VALUES(new.f_id, CONCAT('New Department ', new.f_id)); -lock tables t1 write, t2 write; - insert into t2 values (3,4,'Emp 3'); -unlock tables; +LOCK TABLES t1 WRITE, t2 WRITE; +INSERT INTO t2 VALUES (3,4,'Emp 3'); +UNLOCK TABLES; - select * from t1; - select * from t2; +--sorted_result +SELECT * FROM t1; +--sorted_result +SELECT * FROM t2; # Cleanup - drop trigger tr_t2; - drop table t2, t1, t0; +DROP TRIGGER tr_t2; +DROP TABLE t2, t1, t0; -let $message= Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test); ---source include/show_msg.inc - +--echo +--echo Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test) +--echo ------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03.inc b/mysql-test/suite/funcs_1/triggers/triggers_03.inc index b0b98bf27e5..d0bfc5e9c0e 100644 --- a/mysql-test/suite/funcs_1/triggers/triggers_03.inc +++ b/mysql-test/suite/funcs_1/triggers/triggers_03.inc @@ -5,6 +5,10 @@ # (test case numbering refer to requirement document TP v1.1) #====================================================================== +# This test cannot be used for the embedded server because we check here +# privilgeges. +--source include/not_embedded.inc + USE test; --source suite/funcs_1/include/tb3.inc diff --git a/mysql-test/suite/funcs_1/views/func_view.inc b/mysql-test/suite/funcs_1/views/func_view.inc index fee9fe190b2..709560cdf99 100644 --- a/mysql-test/suite/funcs_1/views/func_view.inc +++ b/mysql-test/suite/funcs_1/views/func_view.inc @@ -92,7 +92,7 @@ # ./mysql-test-run.pl --socket=var/tmp/master.sock --start-dirty # 3. Issue the statements needed by using "mysql" or "mysqltest". # -# Maybe an internal routine of this test fails. Please ask me (ML) or +# Maybe an internal routine of this test fails. Please ask me (mleich) or # enable the logging of auxiliary queries and try to analyze the # problem. # @@ -343,7 +343,7 @@ INSERT INTO t1_values SET # fv1.inc sets t1_selects.disable_result to 'No' and the effect will be, # that the result set will be logged. # -# If you do have the time to check the result sets do the insert of the +# If you do not have the time to check the result sets do the insert of the # SELECT with function via: # eval SET @my_select = # ''; @@ -406,11 +406,11 @@ eval INSERT INTO t1_values SET select_id = @select_id, # 1. Cast Functions and Operators # 1.1 CAST # -# Note(ML): I guess the CAST routines are used in many other functions. -# Therefore check also nearly all "ugly" variants like -# CAST( AS DECIMAL) here. +# Note(mleich): I guess the CAST routines are used in many other functions. +# Therefore check also nearly all "ugly" variants like +# CAST( AS DECIMAL) here. # -# suite/funcs_1/views/fv_cast.inc contains +# suite/funcs_1/views/fv_cast.inc contains # SELECT CAST($col_type AS $target_type), ... # # @@ -771,7 +771,7 @@ $col_type, id FROM t1_values'; # # 2.2.1 IF(expr1,expr2,expr3) with expr1 = # -# Note(ML): Strings, which do not contain a number -> FALSE +# Note(mleich): Strings, which do not contain a number -> FALSE # # suite/funcs_1/views/fv_if1.inc contains # SELECT IF($col_type, 'IS TRUE', 'IS NOT TRUE'), ... @@ -818,9 +818,10 @@ let $col_type= my_year; # suite/funcs_1/views/fv_if2.inc contains # SELECT IF($col_type IS NULL, 'IS NULL', 'IS NOT NULL'), ... # -# Note(ML): July 2005 IF($col_type IS NULL, ...) is mapped to a VIEW definition -# create ... view ... as -# select if(isnull(`test`.`t1`.`f1`),_latin1'IS NULL', +# Note(mleich): July 2005 +# IF($col_type IS NULL, ...) is mapped to a VIEW definition +# create ... view ... as +# select if(isnull(`test`.`t1`.`f1`),_latin1'IS NULL', # _latin1'IS NOT NULL'),... # # Bug#11689 success on Create view .. IF(col1 IS NULL,...), col2 ; but SELECT fails diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc index b6628070705..bc475c6807c 100644 --- a/mysql-test/suite/funcs_1/views/views_master.inc +++ b/mysql-test/suite/funcs_1/views/views_master.inc @@ -3998,7 +3998,7 @@ DESCRIBE v1; SELECT * FROM t1 order by f1, f2; SELECT * FROM v1 order by 2; # Some statements for comparison -# - the ugly SQRT('DEF) as constant +# - the ugly SQRT('DEF') as constant SELECT SQRT('DEF'); # - Will a VIEW based on the same definition show the same result ? CREATE VIEW v2 AS SELECT SQRT('DEF'); From 6d2f2873c010734e3066c1945b4d6a9445c26701 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Tue, 17 Jun 2008 09:31:29 +0200 Subject: [PATCH 016/352] Bug#36492: make dist and make install fails Ignore BitKeeper SCCS folders in make-dist --- mysql-test/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 0dee970cd58..0c4a708dd14 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -67,7 +67,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(distdir)/std_data/ndb_backup50_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(distdir)/std_data/ndb_backup50_data_le - $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1 + $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/*.txt $(distdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib -rm -rf `find $(distdir)/suite -type d -name SCCS` @@ -106,7 +106,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_be $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_le - $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(DESTDIR)$(testdir)/std_data/funcs_1 + $(INSTALL_DATA) $(srcdir)/std_data/funcs_1/*.txt $(DESTDIR)$(testdir)/std_data/funcs_1 $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib for f in `(cd $(srcdir); find suite -type f | grep -v SCCS)`; \ do \ From 3345a71545317772af702a86b5f6d97b7ecf08a4 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 17 Jun 2008 12:41:06 +0200 Subject: [PATCH 017/352] Bug#35931 Index search of partitioned MyISAM table returns erroneous results Used the wrong function when fixing 30480 which lead to no stop on end_key resulting in duplicate results from index scan Includes test cases for the duplicates 37327 and 37329, Duplicate rows and bad performance/High Handler_read_next values Recommit after merge issues --- mysql-test/r/partition.result | 204 +++++++++++++++++++++++++++++++++- mysql-test/t/partition.test | 138 ++++++++++++++++++++++- sql/ha_partition.cc | 4 +- 3 files changed, 342 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index b13010f8471..d34fad02832 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,4 +1,206 @@ -drop table if exists t1; +drop table if exists t1, t2; +CREATE TABLE t1 ( +a INT NOT NULL, +b MEDIUMINT NOT NULL, +c INT NOT NULL, +KEY b (b) +) ENGINE=MyISAM +PARTITION BY LIST (a) ( +PARTITION p0 VALUES IN (1) +); +INSERT INTO t1 VALUES (1,1,0), (1,1,1), (1,1,2), (1,1,53), (1,1,4), (1,1,5), +(1,1,6), (1,1,7), (1,1,8), (1,1,9), (1,1,10), (1,1,11), (1,1,12), (1,1,13), +(1,1,14), (1,1,15), (1,1,16), (1,1,67), (1,1,18), (1,1,19), (1,1,20), (1,1,21), +(1,1,22), (1,1,23), (1,1,24), (1,1,75), (1,1,26), (1,1,27), (1,1,128), +(1,1,79), (1,1,30), (1,1,31), (1,1,32), (1,1,33), (1,1,34), (1,1,85), (1,1,36), +(1,1,37), (1,1,38), (1,1,39), (1,1,40), (1,1,241), (1,1,42), (1,1,43), +(1,1,44), (1,1,45), (1,1,46), (1,1,147), (1,1,48), (1,1,49), (1,2,0), (1,2,1), +(1,2,2), (1,2,3), (1,2,4), (1,2,5), (1,2,6), (1,2,7), (1,2,8), (1,2,9), +(1,2,10), (1,2,11), (1,2,12), (1,2,13), (1,2,14), (1,2,15), (1,2,16), (1,2,17), +(1,2,18), (1,2,19), (1,2,20), (1,2,21), (1,2,22), (1,2,23), (1,2,24), (1,2,25), +(1,2,26), (1,2,27), (1,2,28), (1,2,29), (1,2,30), (1,2,31), (1,2,32), (1,2,33), +(1,2,34), (1,2,35), (1,2,36), (1,2,37), (1,2,38), (1,2,39), (1,2,40), (1,2,41), +(1,2,42), (1,2,43), (1,2,44), (1,2,45), (1,2,46), (1,2,47), (1,2,48), (1,2,49), +(1,6,0), (1,6,1), (1,6,2), (1,6,3), (1,6,4), (1,6,5), (1,6,6), (1,6,7), +(1,6,8), (1,6,9), (1,6,10), (1,6,11), (1,6,12), (1,6,13), (1,6,14), (1,6,15), +(1,6,16), (1,6,17), (1,6,18), (1,6,19), (1,6,20), (1,6,21), (1,6,22), (1,6,23), +(1,6,24), (1,6,25), (1,6,26), (1,6,27), (1,6,28), (1,6,29), (1,6,30), (1,6,31), +(1,6,32), (1,6,33), (1,6,34), (1,6,35), (1,6,36), (1,6,37), (1,6,38), (1,6,39), +(1,6,40), (1,6,41), (1,6,42), (1,6,43), (1,6,44), (1,6,45), (1,6,46), (1,6,47), +(1,6,48), (1,6,49), (1,7,0), (1,7,1), (1,7,2), (1,7,3), (1,7,4), (1,7,5), +(1,7,6), (1,7,7), (1,7,8), (1,7,9), (1,7,10), (1,7,11), (1,7,12), (1,7,13), +(1,7,14), (1,7,15), (1,7,16), (1,7,17), (1,7,18), (1,7,19), (1,7,20), (1,7,21), +(1,7,22), (1,7,23), (1,7,24), (1,7,25), (1,7,26), (1,7,27), (1,7,28), (1,7,29), +(1,7,30), (1,7,31), (1,7,32), (1,7,33), (1,7,34), (1,7,35), (1,7,38), (1,7,39), +(1,7,90), (1,7,41), (1,7,43), (1,7,48), (1,7,49), (1,9,0), (1,9,1), (1,9,2), +(1,9,3), (1,9,4), (1,9,5), (1,9,6), (1,9,7), (1,9,8), (1,9,9), (1,9,10), +(1,9,11), (1,9,12), (1,9,13), (1,9,14), (1,9,15), (1,9,16), (1,9,17), (1,9,18), +(1,9,19), (1,9,20), (1,9,21), (1,9,22), (1,9,23), (1,9,24), (1,9,25), (1,9,26), +(1,9,29), (1,9,32), (1,9,35), (1,9,38), (1,10,0), (1,10,1), (1,10,2), (1,10,3), +(1,10,4), (1,10,5), (1,10,6), (1,10,7), (1,10,8), (1,10,9), (1,10,10), +(1,10,11), (1,10,13), (1,10,14), (1,10,15), (1,10,16), (1,10,17), (1,10,18), +(1,10,22), (1,10,24), (1,10,25), (1,10,26), (1,10,28), (1,10,131), (1,10,33), +(1,10,84), (1,10,35), (1,10,40), (1,10,42), (1,10,49), (1,11,0), (1,11,1), +(1,11,2), (1,11,3), (1,11,4), (1,11,5), (1,11,6), (1,11,7), (1,11,8), (1,11,9), +(1,11,10), (1,11,11), (1,11,12), (1,11,13), (1,11,14), (1,11,15), (1,11,16), +(1,11,17), (1,11,18), (1,11,19), (1,11,20), (1,11,21), (1,11,22), (1,11,23), +(1,11,24), (1,11,25), (1,11,26), (1,11,27), (1,11,28), (1,11,30), (1,11,31), +(1,11,32), (1,11,33), (1,11,34), (1,11,35), (1,11,37), (1,11,39), (1,11,40), +(1,11,42), (1,11,44), (1,11,45), (1,11,47), (1,11,48), (1,14,104), (1,14,58), +(1,14,12), (1,14,13), (1,14,15), (1,14,16), (1,14,17), (1,14,34), (1,15,0), +(1,15,1), (1,15,2), (1,15,3), (1,15,4), (1,15,5), (1,15,7), (1,15,9), +(1,15,15), (1,15,27), (1,15,49), (1,16,0), (1,16,1), (1,16,3), (1,17,4), +(1,19,1); +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +COUNT(*) +24 +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SUM(c) +400 +ALTER TABLE t1 DROP INDEX b; +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +COUNT(*) +24 +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SUM(c) +400 +ALTER TABLE t1 ENGINE = Memory; +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +COUNT(*) +24 +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SUM(c) +400 +ALTER TABLE t1 ADD INDEX b USING HASH (b); +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +COUNT(*) +24 +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SUM(c) +400 +DROP TABLE t1; +CREATE TABLE `t1` ( +`c1` int(11) DEFAULT NULL, +KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE `t2` ( +`c1` int(11) DEFAULT NULL, +KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; +INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 NULL range c1 c1 5 NULL 4 Using where; Using index +FLUSH STATUS; +SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); +c1 +11 +12 +18 +19 +SHOW STATUS LIKE 'Handler_read_%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 2 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 a range c1 c1 5 NULL 4 Using where; Using index +FLUSH STATUS; +SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); +c1 +11 +12 +18 +19 +SHOW STATUS LIKE 'Handler_read_%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 2 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1,t2; +CREATE TABLE `t1` ( +`c1` int(11) DEFAULT NULL, +KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +CREATE TABLE `t2` ( +`c1` int(11) DEFAULT NULL, +KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; +INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 NULL range c1 c1 5 NULL 2 Using where; Using index +FLUSH STATUS; +SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5); +c1 +3 +4 +SHOW STATUS LIKE 'Handler_read_%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_next 2 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 a range c1 c1 5 NULL 2 Using where; Using index +FLUSH STATUS; +SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5); +c1 +3 +4 +SHOW STATUS LIKE 'Handler_read_%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_next 2 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 NULL range c1 c1 5 NULL 2 Using where; Using index +FLUSH STATUS; +SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15); +c1 +13 +14 +SHOW STATUS LIKE 'Handler_read_%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_next 2 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15); +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 a range c1 c1 5 NULL 2 Using where; Using index +FLUSH STATUS; +SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15); +c1 +13 +14 +SHOW STATUS LIKE 'Handler_read_%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_next 2 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1,t2; create table t1 (a int) partition by list ((a/3)*10 div 1) (partition p0 values in (0), partition p1 values in (1)); ERROR HY000: This partition function is not allowed diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index c4e447988db..669da7ee993 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -11,9 +11,145 @@ --source include/have_partition.inc --disable_warnings -drop table if exists t1; +drop table if exists t1, t2; --enable_warnings +# +# Bug35931: Index search may return duplicates +# +CREATE TABLE t1 ( + a INT NOT NULL, + b MEDIUMINT NOT NULL, + c INT NOT NULL, + KEY b (b) +) ENGINE=MyISAM +PARTITION BY LIST (a) ( + PARTITION p0 VALUES IN (1) +); +INSERT INTO t1 VALUES (1,1,0), (1,1,1), (1,1,2), (1,1,53), (1,1,4), (1,1,5), +(1,1,6), (1,1,7), (1,1,8), (1,1,9), (1,1,10), (1,1,11), (1,1,12), (1,1,13), +(1,1,14), (1,1,15), (1,1,16), (1,1,67), (1,1,18), (1,1,19), (1,1,20), (1,1,21), +(1,1,22), (1,1,23), (1,1,24), (1,1,75), (1,1,26), (1,1,27), (1,1,128), +(1,1,79), (1,1,30), (1,1,31), (1,1,32), (1,1,33), (1,1,34), (1,1,85), (1,1,36), +(1,1,37), (1,1,38), (1,1,39), (1,1,40), (1,1,241), (1,1,42), (1,1,43), +(1,1,44), (1,1,45), (1,1,46), (1,1,147), (1,1,48), (1,1,49), (1,2,0), (1,2,1), +(1,2,2), (1,2,3), (1,2,4), (1,2,5), (1,2,6), (1,2,7), (1,2,8), (1,2,9), +(1,2,10), (1,2,11), (1,2,12), (1,2,13), (1,2,14), (1,2,15), (1,2,16), (1,2,17), +(1,2,18), (1,2,19), (1,2,20), (1,2,21), (1,2,22), (1,2,23), (1,2,24), (1,2,25), +(1,2,26), (1,2,27), (1,2,28), (1,2,29), (1,2,30), (1,2,31), (1,2,32), (1,2,33), +(1,2,34), (1,2,35), (1,2,36), (1,2,37), (1,2,38), (1,2,39), (1,2,40), (1,2,41), +(1,2,42), (1,2,43), (1,2,44), (1,2,45), (1,2,46), (1,2,47), (1,2,48), (1,2,49), +(1,6,0), (1,6,1), (1,6,2), (1,6,3), (1,6,4), (1,6,5), (1,6,6), (1,6,7), +(1,6,8), (1,6,9), (1,6,10), (1,6,11), (1,6,12), (1,6,13), (1,6,14), (1,6,15), +(1,6,16), (1,6,17), (1,6,18), (1,6,19), (1,6,20), (1,6,21), (1,6,22), (1,6,23), +(1,6,24), (1,6,25), (1,6,26), (1,6,27), (1,6,28), (1,6,29), (1,6,30), (1,6,31), +(1,6,32), (1,6,33), (1,6,34), (1,6,35), (1,6,36), (1,6,37), (1,6,38), (1,6,39), +(1,6,40), (1,6,41), (1,6,42), (1,6,43), (1,6,44), (1,6,45), (1,6,46), (1,6,47), +(1,6,48), (1,6,49), (1,7,0), (1,7,1), (1,7,2), (1,7,3), (1,7,4), (1,7,5), +(1,7,6), (1,7,7), (1,7,8), (1,7,9), (1,7,10), (1,7,11), (1,7,12), (1,7,13), +(1,7,14), (1,7,15), (1,7,16), (1,7,17), (1,7,18), (1,7,19), (1,7,20), (1,7,21), +(1,7,22), (1,7,23), (1,7,24), (1,7,25), (1,7,26), (1,7,27), (1,7,28), (1,7,29), + (1,7,30), (1,7,31), (1,7,32), (1,7,33), (1,7,34), (1,7,35), (1,7,38), (1,7,39), +(1,7,90), (1,7,41), (1,7,43), (1,7,48), (1,7,49), (1,9,0), (1,9,1), (1,9,2), +(1,9,3), (1,9,4), (1,9,5), (1,9,6), (1,9,7), (1,9,8), (1,9,9), (1,9,10), +(1,9,11), (1,9,12), (1,9,13), (1,9,14), (1,9,15), (1,9,16), (1,9,17), (1,9,18), +(1,9,19), (1,9,20), (1,9,21), (1,9,22), (1,9,23), (1,9,24), (1,9,25), (1,9,26), +(1,9,29), (1,9,32), (1,9,35), (1,9,38), (1,10,0), (1,10,1), (1,10,2), (1,10,3), +(1,10,4), (1,10,5), (1,10,6), (1,10,7), (1,10,8), (1,10,9), (1,10,10), +(1,10,11), (1,10,13), (1,10,14), (1,10,15), (1,10,16), (1,10,17), (1,10,18), +(1,10,22), (1,10,24), (1,10,25), (1,10,26), (1,10,28), (1,10,131), (1,10,33), +(1,10,84), (1,10,35), (1,10,40), (1,10,42), (1,10,49), (1,11,0), (1,11,1), +(1,11,2), (1,11,3), (1,11,4), (1,11,5), (1,11,6), (1,11,7), (1,11,8), (1,11,9), +(1,11,10), (1,11,11), (1,11,12), (1,11,13), (1,11,14), (1,11,15), (1,11,16), +(1,11,17), (1,11,18), (1,11,19), (1,11,20), (1,11,21), (1,11,22), (1,11,23), +(1,11,24), (1,11,25), (1,11,26), (1,11,27), (1,11,28), (1,11,30), (1,11,31), +(1,11,32), (1,11,33), (1,11,34), (1,11,35), (1,11,37), (1,11,39), (1,11,40), +(1,11,42), (1,11,44), (1,11,45), (1,11,47), (1,11,48), (1,14,104), (1,14,58), +(1,14,12), (1,14,13), (1,14,15), (1,14,16), (1,14,17), (1,14,34), (1,15,0), +(1,15,1), (1,15,2), (1,15,3), (1,15,4), (1,15,5), (1,15,7), (1,15,9), +(1,15,15), (1,15,27), (1,15,49), (1,16,0), (1,16,1), (1,16,3), (1,17,4), +(1,19,1); +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +ALTER TABLE t1 DROP INDEX b; +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +ALTER TABLE t1 ENGINE = Memory; +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +ALTER TABLE t1 ADD INDEX b USING HASH (b); +SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 ); +DROP TABLE t1; + +# Bug#37327 Range scan on partitioned table returns duplicate rows +# (Duplicate of Bug#35931) +CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL, + KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE `t2` ( + `c1` int(11) DEFAULT NULL, + KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; + +INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); + +EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); + +FLUSH STATUS; +SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); +SHOW STATUS LIKE 'Handler_read_%'; + +EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); + +FLUSH STATUS; +SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20); +SHOW STATUS LIKE 'Handler_read_%'; +DROP TABLE t1,t2; + +# Bug#37329 Range scan on partitioned tables shows higher Handler_read_next +# (marked as duplicate of Bug#35931) +CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL, + KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE `t2` ( + `c1` int(11) DEFAULT NULL, + KEY `c1` (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; + +INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); + +EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5); + +FLUSH STATUS; +SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5); +SHOW STATUS LIKE 'Handler_read_%'; + +EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5); + +FLUSH STATUS; +SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5); +SHOW STATUS LIKE 'Handler_read_%'; + +EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15); + +FLUSH STATUS; +SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15); +SHOW STATUS LIKE 'Handler_read_%'; + +EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15); + +FLUSH STATUS; +SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15); +SHOW STATUS LIKE 'Handler_read_%'; +DROP TABLE t1,t2; + --error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (a int) partition by list ((a/3)*10 div 1) (partition p0 values in (0), partition p1 values in (1)); diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 2e0bb090ad2..3a78e6601f0 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4045,7 +4045,7 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same) } else if (!(error= file->index_next(buf))) { - if (!(file->ha_table_flags() & HA_READ_ORDER) || + if (!(file->index_flags(active_index, 0, 1) & HA_READ_ORDER) || compare_key(end_range) <= 0) { m_last_part= m_part_spec.start_part; @@ -4123,7 +4123,7 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf) } if (!error) { - if (!(file->ha_table_flags() & HA_READ_ORDER) || + if (!(file->index_flags(active_index, 0, 1) & HA_READ_ORDER) || compare_key(end_range) <= 0) { m_last_part= i; From 2f472dff75dfa6c4522043ea062262bf49d7c140 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Tue, 17 Jun 2008 17:57:04 +0530 Subject: [PATCH 018/352] WL#4380 added a rule that use gcc to generate preprocessor output (gcc -E) that can be then compared to a already generated output using the diff utility. Ran make test on the repository to verify changes. --- Makefile.am | 57 + configure.in | 21 +- include/mysql.h.pp | 674 +++ include/mysql/plugin.h.pp | 139 + include/mysql_h.ic | 1166 ---- sql/mysql_priv.h.pp | 10978 ++++++++++++++++++++++++++++++++++++ 6 files changed, 11849 insertions(+), 1186 deletions(-) create mode 100644 include/mysql.h.pp create mode 100644 include/mysql/plugin.h.pp delete mode 100644 include/mysql_h.ic create mode 100644 sql/mysql_priv.h.pp diff --git a/Makefile.am b/Makefile.am index 55f54476212..44f82c300cf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -231,5 +231,62 @@ test-full-qa: test-binlog-statement test-ext test-fast-view \ test-fast-cursor test-unit +# +# Headers which need to be checked for abi/api compatibility +# + +PREPROCESSOR_C_HEADER=$(top_srcdir)/include/mysql/plugin.h \ + $(top_srcdir)/sql/mysql_priv.h \ + $(top_srcdir)/include/mysql.h + +# +# Rule for checking that the abi/api has not changed. +# +# The following steps are followed in the rule below +# +# 1) Generate preprocessor output for the files that need to +# be tested for abi/api changes. use -nostdinc to prevent +# generation of preprocessor output for system headers. This +# results in messages in stderr saying that these headers +# were not found. Redirect the stderr output to /dev/null +# to prevent seeing these messages. +# 2) sed the output to remove blank lines and lines that begin +# with # (The header information is retained to enable easy +# analysis of abi diffs at a later stage). +# 3) diff the generated file and the canons (.pp files already in +# the repository). +# 4) delete the .out file that is generated. +# +# If the diff fails, the generated file is not removed. This will +# be useful for analysis of ABI differences (e.g. using a visual +# diff tool). +# +# A ABI change that causes a build to fail will always be accompanied +# by new canons (.out files). The .out files that are not removed will +# be replaced as the new .pp files. +# +# e.g. If include/mysql/plugin.h has an ABI change then this rule would +# leave a include/mysql/plugin.out file. +# +# A developer with a justified API change will then do a +# mv include/mysql/plugin.out include/mysql/plugin.pp +# to replace the old canons with the new ones. +# + +abi_check: $(PREPROCESSOR_C_HEADER) + set -ex; \ + for file in $(PREPROCESSOR_C_HEADER); do \ + @CC@ -E -nostdinc -dI \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/include/mysql \ + -I$(top_srcdir)/sql \ + $$file 2>/dev/null | \ + @SED@ -e '/^# /d' \ + -e '/^[ ]*$$/d' > $$file.out; \ + @DIFF@ $$file.pp $$file.out; \ + @RM@ $$file.out; \ + done + touch $@ + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/configure.in b/configure.in index af23b6035eb..33266a35b33 100644 --- a/configure.in +++ b/configure.in @@ -419,6 +419,7 @@ AC_PATH_PROG(SED, sed, sed) AC_PATH_PROG(CMP, cmp, cmp) AC_PATH_PROG(CHMOD, chmod, chmod) AC_PATH_PROG(HOSTNAME, hostname, hostname) +AC_PATH_PROG(DIFF, diff, diff) # Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and # fall back to 'tar' otherwise and hope that it's a GNU tar as well AC_CHECK_PROGS(TAR, gnutar gtar tar) @@ -443,26 +444,6 @@ AC_SUBST(HOSTNAME) AC_SUBST(PERL) AC_SUBST(PERL5) -# icheck, used for ABI check -AC_PATH_PROG(ICHECK, icheck, no) -# "icheck" is also the name of a file system check program on Tru64. -# Verify the program found is really the interface checker. -if test "x$ICHECK" != "xno" -then - AC_MSG_CHECKING(if $ICHECK works as expected) - echo "int foo;" > conftest.h - $ICHECK --canonify -o conftest.ic conftest.h 2>/dev/null - if test -f "conftest.ic" - then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - ICHECK=no - fi - rm -f conftest.ic conftest.h -fi -AC_SUBST(ICHECK) - # Lock for PS AC_PATH_PROG(PS, ps, ps) AC_MSG_CHECKING("how to check if pid exists") diff --git a/include/mysql.h.pp b/include/mysql.h.pp new file mode 100644 index 00000000000..633cde41130 --- /dev/null +++ b/include/mysql.h.pp @@ -0,0 +1,674 @@ +#include +typedef char my_bool; +typedef int my_socket; +#include "mysql_version.h" +#include "mysql_com.h" +enum enum_server_command +{ + COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, + COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, + COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, + COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, + COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, + COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, + COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, + COM_END +}; +struct st_vio; +typedef struct st_vio Vio; +typedef struct st_net { + Vio *vio; + unsigned char *buff,*buff_end,*write_pos,*read_pos; + my_socket fd; + unsigned long remain_in_buf,length, buf_length, where_b; + unsigned long max_packet,max_packet_size; + unsigned int pkt_nr,compress_pkt_nr; + unsigned int write_timeout, read_timeout, retry_count; + int fcntl; + unsigned int *return_status; + unsigned char reading_or_writing; + char save_char; + my_bool unused0; + my_bool unused; + my_bool compress; + my_bool unused1; + unsigned char *query_cache_query; + unsigned int last_errno; + unsigned char error; + my_bool unused2; + my_bool return_errno; + char last_error[512]; + char sqlstate[5 +1]; + void *extension; +} NET; +enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, + MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, + MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, + MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, + MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, + MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, + MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, + MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, + MYSQL_TYPE_BIT, + MYSQL_TYPE_NEWDECIMAL=246, + MYSQL_TYPE_ENUM=247, + MYSQL_TYPE_SET=248, + MYSQL_TYPE_TINY_BLOB=249, + MYSQL_TYPE_MEDIUM_BLOB=250, + MYSQL_TYPE_LONG_BLOB=251, + MYSQL_TYPE_BLOB=252, + MYSQL_TYPE_VAR_STRING=253, + MYSQL_TYPE_STRING=254, + MYSQL_TYPE_GEOMETRY=255 +}; +enum mysql_enum_shutdown_level { + SHUTDOWN_DEFAULT = 0, + SHUTDOWN_WAIT_CONNECTIONS= (unsigned char)(1 << 0), + SHUTDOWN_WAIT_TRANSACTIONS= (unsigned char)(1 << 1), + SHUTDOWN_WAIT_UPDATES= (unsigned char)(1 << 3), + SHUTDOWN_WAIT_ALL_BUFFERS= ((unsigned char)(1 << 3) << 1), + SHUTDOWN_WAIT_CRITICAL_BUFFERS= ((unsigned char)(1 << 3) << 1) + 1, + KILL_QUERY= 254, + KILL_CONNECTION= 255 +}; +enum enum_cursor_type +{ + CURSOR_TYPE_NO_CURSOR= 0, + CURSOR_TYPE_READ_ONLY= 1, + CURSOR_TYPE_FOR_UPDATE= 2, + CURSOR_TYPE_SCROLLABLE= 4 +}; +enum enum_mysql_set_option +{ + MYSQL_OPTION_MULTI_STATEMENTS_ON, + MYSQL_OPTION_MULTI_STATEMENTS_OFF +}; +my_bool my_net_init(NET *net, Vio* vio); +void my_net_local_init(NET *net); +void net_end(NET *net); + void net_clear(NET *net, my_bool clear_buffer); +my_bool net_realloc(NET *net, size_t length); +my_bool net_flush(NET *net); +my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); +my_bool net_write_command(NET *net,unsigned char command, + const unsigned char *header, size_t head_len, + const unsigned char *packet, size_t len); +int net_real_write(NET *net,const unsigned char *packet, size_t len); +unsigned long my_net_read(NET *net); +struct sockaddr; +int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, + unsigned int timeout); +struct rand_struct { + unsigned long seed1,seed2,max_value; + double max_value_dbl; +}; +enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, + DECIMAL_RESULT}; +typedef struct st_udf_args +{ + unsigned int arg_count; + enum Item_result *arg_type; + char **args; + unsigned long *lengths; + char *maybe_null; + char **attributes; + unsigned long *attribute_lengths; + void *extension; +} UDF_ARGS; +typedef struct st_udf_init +{ + my_bool maybe_null; + unsigned int decimals; + unsigned long max_length; + char *ptr; + my_bool const_item; + void *extension; +} UDF_INIT; +void randominit(struct rand_struct *, unsigned long seed1, + unsigned long seed2); +double my_rnd(struct rand_struct *); +void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); +void hash_password(unsigned long *to, const char *password, unsigned int password_len); +void make_scrambled_password_323(char *to, const char *password); +void scramble_323(char *to, const char *message, const char *password); +my_bool check_scramble_323(const char *, const char *message, + unsigned long *salt); +void get_salt_from_password_323(unsigned long *res, const char *password); +void make_password_from_salt_323(char *to, const unsigned long *salt); +void make_scrambled_password(char *to, const char *password); +void scramble(char *to, const char *message, const char *password); +my_bool check_scramble(const char *reply, const char *message, + const unsigned char *hash_stage2); +void get_salt_from_password(unsigned char *res, const char *password); +void make_password_from_salt(char *to, const unsigned char *hash_stage2); +char *octet2hex(char *to, const char *str, unsigned int len); +char *get_tty_password(const char *opt_message); +const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); +my_bool my_thread_init(void); +void my_thread_end(void); +#include "mysql_time.h" +enum enum_mysql_timestamp_type +{ + MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, + MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 +}; +typedef struct st_mysql_time +{ + unsigned int year, month, day, hour, minute, second; + unsigned long second_part; + my_bool neg; + enum enum_mysql_timestamp_type time_type; +} MYSQL_TIME; +#include "my_list.h" +typedef struct st_list { + struct st_list *prev,*next; + void *data; +} LIST; +typedef int (*list_walk_action)(void *,void *); +extern LIST *list_add(LIST *root,LIST *element); +extern LIST *list_delete(LIST *root,LIST *element); +extern LIST *list_cons(void *data,LIST *root); +extern LIST *list_reverse(LIST *root); +extern void list_free(LIST *root,unsigned int free_data); +extern unsigned int list_length(LIST *); +extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); +extern unsigned int mysql_port; +extern char *mysql_unix_port; +typedef struct st_mysql_field { + char *name; + char *org_name; + char *table; + char *org_table; + char *db; + char *catalog; + char *def; + unsigned long length; + unsigned long max_length; + unsigned int name_length; + unsigned int org_name_length; + unsigned int table_length; + unsigned int org_table_length; + unsigned int db_length; + unsigned int catalog_length; + unsigned int def_length; + unsigned int flags; + unsigned int decimals; + unsigned int charsetnr; + enum enum_field_types type; + void *extension; +} MYSQL_FIELD; +typedef char **MYSQL_ROW; +typedef unsigned int MYSQL_FIELD_OFFSET; +typedef unsigned long long my_ulonglong; +#include "typelib.h" +#include "my_alloc.h" +typedef struct st_used_mem +{ + struct st_used_mem *next; + unsigned int left; + unsigned int size; +} USED_MEM; +typedef struct st_mem_root +{ + USED_MEM *free; + USED_MEM *used; + USED_MEM *pre_alloc; + size_t min_malloc; + size_t block_size; + unsigned int block_num; + unsigned int first_block_usage; + void (*error_handler)(void); +} MEM_ROOT; +typedef struct st_typelib { + unsigned int count; + const char *name; + const char **type_names; + unsigned int *type_lengths; +} TYPELIB; +extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); +extern int find_type_or_exit(const char *x, TYPELIB *typelib, + const char *option); +extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); +extern const char *get_type(TYPELIB *typelib,unsigned int nr); +extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); +extern TYPELIB sql_protocol_typelib; +typedef struct st_mysql_rows { + struct st_mysql_rows *next; + MYSQL_ROW data; + unsigned long length; +} MYSQL_ROWS; +typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; +#include "my_alloc.h" +typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; +typedef struct st_mysql_data { + MYSQL_ROWS *data; + struct embedded_query_result *embedded_info; + MEM_ROOT alloc; + my_ulonglong rows; + unsigned int fields; + void *extension; +} MYSQL_DATA; +enum mysql_option +{ + MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, + MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, + MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, + MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, + MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, + MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, + MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, + MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, + MYSQL_OPT_SSL_VERIFY_SERVER_CERT +}; +struct st_mysql_options { + unsigned int connect_timeout, read_timeout, write_timeout; + unsigned int port, protocol; + unsigned long client_flag; + char *host,*user,*password,*unix_socket,*db; + struct st_dynamic_array *init_commands; + char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; + char *ssl_key; + char *ssl_cert; + char *ssl_ca; + char *ssl_capath; + char *ssl_cipher; + char *shared_memory_base_name; + unsigned long max_allowed_packet; + my_bool use_ssl; + my_bool compress,named_pipe; + my_bool rpl_probe; + my_bool rpl_parse; + my_bool no_master_reads; + my_bool separate_thread; + enum mysql_option methods_to_use; + char *client_ip; + my_bool secure_auth; + my_bool report_data_truncation; + int (*local_infile_init)(void **, const char *, void *); + int (*local_infile_read)(void *, char *, unsigned int); + void (*local_infile_end)(void *); + int (*local_infile_error)(void *, char *, unsigned int); + void *local_infile_userdata; + void *extension; +}; +enum mysql_status +{ + MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT +}; +enum mysql_protocol_type +{ + MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, + MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY +}; +enum mysql_rpl_type +{ + MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN +}; +typedef struct character_set +{ + unsigned int number; + unsigned int state; + const char *csname; + const char *name; + const char *comment; + const char *dir; + unsigned int mbminlen; + unsigned int mbmaxlen; +} MY_CHARSET_INFO; +struct st_mysql_methods; +struct st_mysql_stmt; +typedef struct st_mysql +{ + NET net; + unsigned char *connector_fd; + char *host,*user,*passwd,*unix_socket,*server_version,*host_info; + char *info, *db; + struct charset_info_st *charset; + MYSQL_FIELD *fields; + MEM_ROOT field_alloc; + my_ulonglong affected_rows; + my_ulonglong insert_id; + my_ulonglong extra_info; + unsigned long thread_id; + unsigned long packet_length; + unsigned int port; + unsigned long client_flag,server_capabilities; + unsigned int protocol_version; + unsigned int field_count; + unsigned int server_status; + unsigned int server_language; + unsigned int warning_count; + struct st_mysql_options options; + enum mysql_status status; + my_bool free_me; + my_bool reconnect; + char scramble[20 +1]; + my_bool rpl_pivot; + struct st_mysql* master, *next_slave; + struct st_mysql* last_used_slave; + struct st_mysql* last_used_con; + LIST *stmts; + const struct st_mysql_methods *methods; + void *thd; + my_bool *unbuffered_fetch_owner; + char *info_buffer; + void *extension; +} MYSQL; +typedef struct st_mysql_res { + my_ulonglong row_count; + MYSQL_FIELD *fields; + MYSQL_DATA *data; + MYSQL_ROWS *data_cursor; + unsigned long *lengths; + MYSQL *handle; + const struct st_mysql_methods *methods; + MYSQL_ROW row; + MYSQL_ROW current_row; + MEM_ROOT field_alloc; + unsigned int field_count, current_field; + my_bool eof; + my_bool unbuffered_fetch_cancelled; + void *extension; +} MYSQL_RES; +typedef struct st_mysql_manager +{ + NET net; + char *host, *user, *passwd; + char *net_buf, *net_buf_pos, *net_data_end; + unsigned int port; + int cmd_status; + int last_errno; + int net_buf_size; + my_bool free_me; + my_bool eof; + char last_error[256]; + void *extension; +} MYSQL_MANAGER; +typedef struct st_mysql_parameters +{ + unsigned long *p_max_allowed_packet; + unsigned long *p_net_buffer_length; + void *extension; +} MYSQL_PARAMETERS; +int mysql_server_init(int argc, char **argv, char **groups); +void mysql_server_end(void); +MYSQL_PARAMETERS * mysql_get_parameters(void); +my_bool mysql_thread_init(void); +void mysql_thread_end(void); +my_ulonglong mysql_num_rows(MYSQL_RES *res); +unsigned int mysql_num_fields(MYSQL_RES *res); +my_bool mysql_eof(MYSQL_RES *res); +MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES *res, + unsigned int fieldnr); +MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES *res); +MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES *res); +MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *res); +unsigned int mysql_field_count(MYSQL *mysql); +my_ulonglong mysql_affected_rows(MYSQL *mysql); +my_ulonglong mysql_insert_id(MYSQL *mysql); +unsigned int mysql_errno(MYSQL *mysql); +const char * mysql_error(MYSQL *mysql); +const char * mysql_sqlstate(MYSQL *mysql); +unsigned int mysql_warning_count(MYSQL *mysql); +const char * mysql_info(MYSQL *mysql); +unsigned long mysql_thread_id(MYSQL *mysql); +const char * mysql_character_set_name(MYSQL *mysql); +int mysql_set_character_set(MYSQL *mysql, const char *csname); +MYSQL * mysql_init(MYSQL *mysql); +my_bool mysql_ssl_set(MYSQL *mysql, const char *key, + const char *cert, const char *ca, + const char *capath, const char *cipher); +const char * mysql_get_ssl_cipher(MYSQL *mysql); +my_bool mysql_change_user(MYSQL *mysql, const char *user, + const char *passwd, const char *db); +MYSQL * mysql_real_connect(MYSQL *mysql, const char *host, + const char *user, + const char *passwd, + const char *db, + unsigned int port, + const char *unix_socket, + unsigned long clientflag); +int mysql_select_db(MYSQL *mysql, const char *db); +int mysql_query(MYSQL *mysql, const char *q); +int mysql_send_query(MYSQL *mysql, const char *q, + unsigned long length); +int mysql_real_query(MYSQL *mysql, const char *q, + unsigned long length); +MYSQL_RES * mysql_store_result(MYSQL *mysql); +MYSQL_RES * mysql_use_result(MYSQL *mysql); +my_bool mysql_master_query(MYSQL *mysql, const char *q, + unsigned long length); +my_bool mysql_master_send_query(MYSQL *mysql, const char *q, + unsigned long length); +my_bool mysql_slave_query(MYSQL *mysql, const char *q, + unsigned long length); +my_bool mysql_slave_send_query(MYSQL *mysql, const char *q, + unsigned long length); +void mysql_get_character_set_info(MYSQL *mysql, + MY_CHARSET_INFO *charset); +void +mysql_set_local_infile_handler(MYSQL *mysql, + int (*local_infile_init)(void **, const char *, + void *), + int (*local_infile_read)(void *, char *, + unsigned int), + void (*local_infile_end)(void *), + int (*local_infile_error)(void *, char*, + unsigned int), + void *); +void +mysql_set_local_infile_default(MYSQL *mysql); +void mysql_enable_rpl_parse(MYSQL* mysql); +void mysql_disable_rpl_parse(MYSQL* mysql); +int mysql_rpl_parse_enabled(MYSQL* mysql); +void mysql_enable_reads_from_master(MYSQL* mysql); +void mysql_disable_reads_from_master(MYSQL* mysql); +my_bool mysql_reads_from_master_enabled(MYSQL* mysql); +enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len); +my_bool mysql_rpl_probe(MYSQL* mysql); +int mysql_set_master(MYSQL* mysql, const char* host, + unsigned int port, + const char* user, + const char* passwd); +int mysql_add_slave(MYSQL* mysql, const char* host, + unsigned int port, + const char* user, + const char* passwd); +int mysql_shutdown(MYSQL *mysql, + enum mysql_enum_shutdown_level + shutdown_level); +int mysql_dump_debug_info(MYSQL *mysql); +int mysql_refresh(MYSQL *mysql, + unsigned int refresh_options); +int mysql_kill(MYSQL *mysql,unsigned long pid); +int mysql_set_server_option(MYSQL *mysql, + enum enum_mysql_set_option + option); +int mysql_ping(MYSQL *mysql); +const char * mysql_stat(MYSQL *mysql); +const char * mysql_get_server_info(MYSQL *mysql); +const char * mysql_get_client_info(void); +unsigned long mysql_get_client_version(void); +const char * mysql_get_host_info(MYSQL *mysql); +unsigned long mysql_get_server_version(MYSQL *mysql); +unsigned int mysql_get_proto_info(MYSQL *mysql); +MYSQL_RES * mysql_list_dbs(MYSQL *mysql,const char *wild); +MYSQL_RES * mysql_list_tables(MYSQL *mysql,const char *wild); +MYSQL_RES * mysql_list_processes(MYSQL *mysql); +int mysql_options(MYSQL *mysql,enum mysql_option option, + const void *arg); +void mysql_free_result(MYSQL_RES *result); +void mysql_data_seek(MYSQL_RES *result, + my_ulonglong offset); +MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES *result, + MYSQL_ROW_OFFSET offset); +MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES *result, + MYSQL_FIELD_OFFSET offset); +MYSQL_ROW mysql_fetch_row(MYSQL_RES *result); +unsigned long * mysql_fetch_lengths(MYSQL_RES *result); +MYSQL_FIELD * mysql_fetch_field(MYSQL_RES *result); +MYSQL_RES * mysql_list_fields(MYSQL *mysql, const char *table, + const char *wild); +unsigned long mysql_escape_string(char *to,const char *from, + unsigned long from_length); +unsigned long mysql_hex_string(char *to,const char *from, + unsigned long from_length); +unsigned long mysql_real_escape_string(MYSQL *mysql, + char *to,const char *from, + unsigned long length); +void mysql_debug(const char *debug); +void myodbc_remove_escape(MYSQL *mysql,char *name); +unsigned int mysql_thread_safe(void); +my_bool mysql_embedded(void); +MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con); +MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con, + const char* host, + const char* user, + const char* passwd, + unsigned int port); +void mysql_manager_close(MYSQL_MANAGER* con); +int mysql_manager_command(MYSQL_MANAGER* con, + const char* cmd, int cmd_len); +int mysql_manager_fetch_line(MYSQL_MANAGER* con, + char* res_buf, + int res_buf_size); +my_bool mysql_read_query_result(MYSQL *mysql); +enum enum_mysql_stmt_state +{ + MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, + MYSQL_STMT_FETCH_DONE +}; +typedef struct st_mysql_bind +{ + unsigned long *length; + my_bool *is_null; + void *buffer; + my_bool *error; + unsigned char *row_ptr; + void (*store_param_func)(NET *net, struct st_mysql_bind *param); + void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, + unsigned char **row); + void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, + unsigned char **row); + unsigned long buffer_length; + unsigned long offset; + unsigned long length_value; + unsigned int param_number; + unsigned int pack_length; + enum enum_field_types buffer_type; + my_bool error_value; + my_bool is_unsigned; + my_bool long_data_used; + my_bool is_null_value; + void *extension; +} MYSQL_BIND; +typedef struct st_mysql_stmt +{ + MEM_ROOT mem_root; + LIST list; + MYSQL *mysql; + MYSQL_BIND *params; + MYSQL_BIND *bind; + MYSQL_FIELD *fields; + MYSQL_DATA result; + MYSQL_ROWS *data_cursor; + int (*read_row_func)(struct st_mysql_stmt *stmt, + unsigned char **row); + my_ulonglong affected_rows; + my_ulonglong insert_id; + unsigned long stmt_id; + unsigned long flags; + unsigned long prefetch_rows; + unsigned int server_status; + unsigned int last_errno; + unsigned int param_count; + unsigned int field_count; + enum enum_mysql_stmt_state state; + char last_error[512]; + char sqlstate[5 +1]; + my_bool send_types_to_server; + my_bool bind_param_done; + unsigned char bind_result_done; + my_bool unbuffered_fetch_cancelled; + my_bool update_max_length; + void *extension; +} MYSQL_STMT; +enum enum_stmt_attr_type +{ + STMT_ATTR_UPDATE_MAX_LENGTH, + STMT_ATTR_CURSOR_TYPE, + STMT_ATTR_PREFETCH_ROWS +}; +typedef struct st_mysql_methods +{ + my_bool (*read_query_result)(MYSQL *mysql); + my_bool (*advanced_command)(MYSQL *mysql, + enum enum_server_command command, + const unsigned char *header, + unsigned long header_length, + const unsigned char *arg, + unsigned long arg_length, + my_bool skip_check, + MYSQL_STMT *stmt); + MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, + unsigned int fields); + MYSQL_RES * (*use_result)(MYSQL *mysql); + void (*fetch_lengths)(unsigned long *to, + MYSQL_ROW column, unsigned int field_count); + void (*flush_use_result)(MYSQL *mysql); + MYSQL_FIELD * (*list_fields)(MYSQL *mysql); + my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); + int (*stmt_execute)(MYSQL_STMT *stmt); + int (*read_binary_rows)(MYSQL_STMT *stmt); + int (*unbuffered_fetch)(MYSQL *mysql, char **row); + void (*free_embedded_thd)(MYSQL *mysql); + const char *(*read_statistics)(MYSQL *mysql); + my_bool (*next_result)(MYSQL *mysql); + int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd); + int (*read_rows_from_cursor)(MYSQL_STMT *stmt); +} MYSQL_METHODS; +MYSQL_STMT * mysql_stmt_init(MYSQL *mysql); +int mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, + unsigned long length); +int mysql_stmt_execute(MYSQL_STMT *stmt); +int mysql_stmt_fetch(MYSQL_STMT *stmt); +int mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, + unsigned int column, + unsigned long offset); +int mysql_stmt_store_result(MYSQL_STMT *stmt); +unsigned long mysql_stmt_param_count(MYSQL_STMT * stmt); +my_bool mysql_stmt_attr_set(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + const void *attr); +my_bool mysql_stmt_attr_get(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + void *attr); +my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +my_bool mysql_stmt_close(MYSQL_STMT * stmt); +my_bool mysql_stmt_reset(MYSQL_STMT * stmt); +my_bool mysql_stmt_free_result(MYSQL_STMT *stmt); +my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, + unsigned int param_number, + const char *data, + unsigned long length); +MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT *stmt); +MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT *stmt); +unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); +const char * mysql_stmt_error(MYSQL_STMT * stmt); +const char * mysql_stmt_sqlstate(MYSQL_STMT * stmt); +MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT *stmt, + MYSQL_ROW_OFFSET offset); +MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT *stmt); +void mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); +my_ulonglong mysql_stmt_num_rows(MYSQL_STMT *stmt); +my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT *stmt); +my_ulonglong mysql_stmt_insert_id(MYSQL_STMT *stmt); +unsigned int mysql_stmt_field_count(MYSQL_STMT *stmt); +my_bool mysql_commit(MYSQL * mysql); +my_bool mysql_rollback(MYSQL * mysql); +my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode); +my_bool mysql_more_results(MYSQL *mysql); +int mysql_next_result(MYSQL *mysql); +void mysql_close(MYSQL *sock); diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp new file mode 100644 index 00000000000..50511f515ab --- /dev/null +++ b/include/mysql/plugin.h.pp @@ -0,0 +1,139 @@ +struct st_mysql_lex_string +{ + char *str; + unsigned int length; +}; +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_xid { + long formatID; + long gtrid_length; + long bqual_length; + char data[128]; +}; +typedef struct st_mysql_xid MYSQL_XID; +enum enum_mysql_show_type +{ + SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, + SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, + SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE +}; +struct st_mysql_show_var { + const char *name; + char *value; + enum enum_mysql_show_type type; +}; +typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *); +struct st_mysql_sys_var; +struct st_mysql_value; +typedef int (*mysql_var_check_func)(void* thd, + struct st_mysql_sys_var *var, + void *save, struct st_mysql_value *value); +typedef void (*mysql_var_update_func)(void* thd, + struct st_mysql_sys_var *var, + void *var_ptr, const void *save); +struct st_mysql_plugin +{ + int type; + void *info; + const char *name; + const char *author; + const char *descr; + int license; + int (*init)(void *); + int (*deinit)(void *); + unsigned int version; + struct st_mysql_show_var *status_vars; + struct st_mysql_sys_var **system_vars; + void * __reserved1; +}; +enum enum_ftparser_mode +{ + MYSQL_FTPARSER_SIMPLE_MODE= 0, + MYSQL_FTPARSER_WITH_STOPWORDS= 1, + MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 +}; +enum enum_ft_token_type +{ + FT_TOKEN_EOF= 0, + FT_TOKEN_WORD= 1, + FT_TOKEN_LEFT_PAREN= 2, + FT_TOKEN_RIGHT_PAREN= 3, + FT_TOKEN_STOPWORD= 4 +}; +typedef struct st_mysql_ftparser_boolean_info +{ + enum enum_ft_token_type type; + int yesno; + int weight_adjust; + char wasign; + char trunc; + char prev; + char *quot; +} MYSQL_FTPARSER_BOOLEAN_INFO; +typedef struct st_mysql_ftparser_param +{ + int (*mysql_parse)(struct st_mysql_ftparser_param *, + char *doc, int doc_len); + int (*mysql_add_word)(struct st_mysql_ftparser_param *, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); + void *ftparser_state; + void *mysql_ftparam; + struct charset_info_st *cs; + char *doc; + int length; + int flags; + enum enum_ftparser_mode mode; +} MYSQL_FTPARSER_PARAM; +struct st_mysql_ftparser +{ + int interface_version; + int (*parse)(MYSQL_FTPARSER_PARAM *param); + int (*init)(MYSQL_FTPARSER_PARAM *param); + int (*deinit)(MYSQL_FTPARSER_PARAM *param); +}; +struct st_mysql_storage_engine +{ + int interface_version; +}; +struct handlerton; +struct st_mysql_daemon +{ + int interface_version; +}; +struct st_mysql_information_schema +{ + int interface_version; +}; +struct st_mysql_value +{ + int (*value_type)(struct st_mysql_value *); + const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); + int (*val_real)(struct st_mysql_value *, double *realbuf); + int (*val_int)(struct st_mysql_value *, long long *intbuf); +}; +int thd_in_lock_tables(const void* thd); +int thd_tablespace_op(const void* thd); +long long thd_test_options(const void* thd, long long test_options); +int thd_sql_command(const void* thd); +const char *thd_proc_info(void* thd, const char *info); +void **thd_ha_data(const void* thd, const struct handlerton *hton); +int thd_tx_isolation(const void* thd); +char *thd_security_context(void* thd, char *buffer, unsigned int length, + unsigned int max_query_len); +void thd_inc_row_count(void* thd); +int mysql_tmpfile(const char *prefix); +int thd_killed(const void* thd); +unsigned long thd_get_thread_id(const void* thd); +void *thd_alloc(void* thd, unsigned int size); +void *thd_calloc(void* thd, unsigned int size); +char *thd_strdup(void* thd, const char *str); +char *thd_strmake(void* thd, const char *str, unsigned int size); +void *thd_memdup(void* thd, const void* str, unsigned int size); +MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); +void thd_get_xid(const void* thd, MYSQL_XID *xid); +void mysql_query_cache_invalidate4(void* thd, + const char *key, unsigned int key_length, + int using_trx); diff --git a/include/mysql_h.ic b/include/mysql_h.ic deleted file mode 100644 index 832678a106b..00000000000 --- a/include/mysql_h.ic +++ /dev/null @@ -1,1166 +0,0 @@ -struct character_set; -struct rand_struct; -struct st_list; -struct st_mem_root; -struct st_mysql; -struct st_mysql_bind; -struct st_mysql_daemon; -struct st_mysql_data; -struct st_mysql_field; -struct st_mysql_ftparser; -struct st_mysql_ftparser_boolean_info; -struct st_mysql_ftparser_param; -struct st_mysql_information_schema; -struct st_mysql_lex_string; -struct st_mysql_manager; -struct st_mysql_methods; -struct st_mysql_options; -struct st_mysql_parameters; -struct st_mysql_plugin; -struct st_mysql_res; -struct st_mysql_rows; -struct st_mysql_show_var; -struct st_mysql_stmt; -struct st_mysql_storage_engine; -struct st_mysql_time; -struct st_mysql_value; -struct st_mysql_xid; -struct st_net; -struct st_typelib; -struct st_udf_args; -struct st_udf_init; -struct st_used_mem; -enum Item_result; -enum enum_cursor_type; -enum enum_field_types; -enum enum_ft_token_type; -enum enum_ftparser_mode; -enum enum_mysql_set_option; -enum enum_mysql_show_type; -enum enum_mysql_stmt_state; -enum enum_mysql_timestamp_type; -enum enum_server_command; -enum enum_stmt_attr_type; -enum mysql_enum_shutdown_level; -enum mysql_option; -enum mysql_protocol_type; -enum mysql_rpl_type; -enum mysql_status; -# 139 "mysql.h" -typedef struct st_mysql_rows MYSQL_ROWS; -# 23 "my_list.h" -typedef struct st_list LIST; -# 34 "my_alloc.h" -typedef struct st_mem_root MEM_ROOT; -# 258 "mysql.h" -typedef struct st_mysql MYSQL; -# 654 "mysql.h" -typedef struct st_mysql_bind MYSQL_BIND; -# 95 "mysql.h" -typedef struct st_mysql_field MYSQL_FIELD; -# 120 "mysql.h" -typedef unsigned int MYSQL_FIELD_OFFSET; -# 35 "mysql/plugin.h" -typedef struct st_mysql_lex_string MYSQL_LEX_STRING; -# 348 "mysql.h" -typedef struct st_mysql_manager MYSQL_MANAGER; -# 363 "mysql.h" -typedef struct st_mysql_parameters MYSQL_PARAMETERS; -# 316 "mysql.h" -typedef struct st_mysql_res MYSQL_RES; -# 119 "mysql.h" -typedef char * * MYSQL_ROW; -# 145 "mysql.h" -typedef MYSQL_ROWS * MYSQL_ROW_OFFSET; -# 683 "mysql.h" -typedef struct st_mysql_stmt MYSQL_STMT; -# 52 "mysql/plugin.h" -typedef struct st_mysql_xid MYSQL_XID; -# 243 "mysql.h" -typedef struct character_set MY_CHARSET_INFO; -# 188 "mysql_com.h" -typedef struct st_net NET; -# 22 "typelib.h" -typedef struct st_typelib TYPELIB; -# 178 "mysql_com.h" -typedef struct st_vio Vio; -# 28 "my_list.h" -typedef int (* list_walk_action)(void *, void *); -# 51 "mysql.h" -typedef char my_bool; -# 65 "mysql.h" -typedef int my_socket; -# 128 "mysql.h" -typedef unsigned long long int my_ulonglong; -# 214 "/usr/lib/gcc/i486-linux-gnu/4.1.3/include/stddef.h" -typedef unsigned int size_t; -# 149 "mysql.h" -typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; -# 150 "mysql.h" -typedef struct st_mysql_data MYSQL_DATA; -# 495 "mysql/plugin.h" -typedef struct st_mysql_ftparser_boolean_info MYSQL_FTPARSER_BOOLEAN_INFO; -# 557 "mysql/plugin.h" -typedef struct st_mysql_ftparser_param MYSQL_FTPARSER_PARAM; -# 753 "mysql.h" -typedef struct st_mysql_methods MYSQL_METHODS; -# 47 "mysql_time.h" -typedef struct st_mysql_time MYSQL_TIME; -# 383 "mysql_com.h" -typedef struct st_udf_args UDF_ARGS; -# 397 "mysql_com.h" -typedef struct st_udf_init UDF_INIT; -# 26 "my_alloc.h" -typedef struct st_used_mem USED_MEM; -# 123 "mysql/plugin.h" -typedef int (* mysql_show_var_func)(void *, struct st_mysql_show_var *, char *); -# 170 "mysql/plugin.h" -typedef int (* mysql_var_check_func)(void * thd, struct st_mysql_sys_var * var, void * save, struct st_mysql_value * value); -# 188 "mysql/plugin.h" -typedef void (* mysql_var_update_func)(void * thd, struct st_mysql_sys_var * var, void * var_ptr, void * save); -# 243 "mysql.h" -struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) character_set - { - unsigned int number; - unsigned int state; - char const * csname; - char const * name; - char const * comment; - char const * dir; - unsigned int mbminlen; - unsigned int mbmaxlen; - }; -# 369 "mysql_com.h" -struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct - { - unsigned long int seed1; - unsigned long int seed2; - unsigned long int max_value; - double max_value_dbl; - }; -# 23 "my_list.h" -struct __attribute__((aligned(__alignof__(void *)))) st_list - { - struct st_list * prev; - struct st_list * next; - void * data; - }; -# 34 "my_alloc.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_mem_root - { - USED_MEM * free; - USED_MEM * used; - USED_MEM * pre_alloc; - size_t min_malloc; - size_t block_size; - unsigned int block_num; - unsigned int first_block_usage; - void (* error_handler)(void); - }; -# 258 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql - { - NET net; - unsigned char * connector_fd; - char * host; - char * user; - char * passwd; - char * unix_socket; - char * server_version; - char * host_info; - char * info; - char * db; - struct charset_info_st * charset; - MYSQL_FIELD * fields; - MEM_ROOT field_alloc; - my_ulonglong affected_rows; - my_ulonglong insert_id; - my_ulonglong extra_info; - unsigned long int thread_id; - unsigned long int packet_length; - unsigned int port; - unsigned long int client_flag; - unsigned long int server_capabilities; - unsigned int protocol_version; - unsigned int field_count; - unsigned int server_status; - unsigned int server_language; - unsigned int warning_count; - struct st_mysql_options options; - enum mysql_status status; - my_bool free_me; - my_bool reconnect; - char scramble[(20 + 1)]; - my_bool rpl_pivot; - struct st_mysql * master; - struct st_mysql * next_slave; - struct st_mysql * last_used_slave; - struct st_mysql * last_used_con; - LIST * stmts; - struct st_mysql_methods const * methods; - void * thd; - my_bool * unbuffered_fetch_owner; - char * info_buffer; - void * extension; - }; -# 654 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_bind - { - unsigned long int * length; - my_bool * is_null; - void * buffer; - my_bool * error; - unsigned char * row_ptr; - void (* store_param_func)(NET * net, struct st_mysql_bind * param); - void (* fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row); - void (* skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, unsigned char * * row); - unsigned long int buffer_length; - unsigned long int offset; - unsigned long int length_value; - unsigned int param_number; - unsigned int pack_length; - enum enum_field_types buffer_type; - my_bool error_value; - my_bool is_unsigned; - my_bool long_data_used; - my_bool is_null_value; - void * extension; - }; -# 628 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(int)))) st_mysql_daemon - { - int interface_version; - }; -# 150 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_data - { - MYSQL_ROWS * data; - struct embedded_query_result * embedded_info; - MEM_ROOT alloc; - my_ulonglong rows; - unsigned int fields; - void * extension; - }; -# 95 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_field - { - char * name; - char * org_name; - char * table; - char * org_table; - char * db; - char * catalog; - char * def; - unsigned long int length; - unsigned long int max_length; - unsigned int name_length; - unsigned int org_name_length; - unsigned int table_length; - unsigned int org_table_length; - unsigned int db_length; - unsigned int catalog_length; - unsigned int def_length; - unsigned int flags; - unsigned int decimals; - unsigned int charsetnr; - enum enum_field_types type; - void * extension; - }; -# 581 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_ftparser - { - int interface_version; - int (* parse)(MYSQL_FTPARSER_PARAM * param); - int (* init)(MYSQL_FTPARSER_PARAM * param); - int (* deinit)(MYSQL_FTPARSER_PARAM * param); - }; -# 495 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_ftparser_boolean_info - { - enum enum_ft_token_type type; - int yesno; - int weight_adjust; - char wasign; - char trunc; - char prev; - char * quot; - }; -# 557 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(int)))) st_mysql_ftparser_param - { - int (* mysql_parse)(struct st_mysql_ftparser_param *, char * doc, int); - int (* mysql_add_word)(struct st_mysql_ftparser_param *, char * word, int, MYSQL_FTPARSER_BOOLEAN_INFO * boolean_info); - void * ftparser_state; - void * mysql_ftparam; - struct charset_info_st * cs; - char * doc; - int length; - int flags; - enum enum_ftparser_mode mode; - }; -# 638 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(int)))) st_mysql_information_schema - { - int interface_version; - }; -# 29 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_mysql_lex_string - { - char * str; - unsigned int length; - }; -# 348 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_manager - { - NET net; - char * host; - char * user; - char * passwd; - char * net_buf; - char * net_buf_pos; - char * net_data_end; - unsigned int port; - int cmd_status; - int last_errno; - int net_buf_size; - my_bool free_me; - my_bool eof; - char last_error[256]; - void * extension; - }; -# 753 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)))) st_mysql_methods - { - my_bool (* read_query_result)(MYSQL * mysql); - my_bool (* advanced_command)(MYSQL * mysql, enum enum_server_command, unsigned char const * header, unsigned long int, unsigned char const * arg, unsigned long int, my_bool, MYSQL_STMT * stmt); - MYSQL_DATA * (* read_rows)(MYSQL * mysql, MYSQL_FIELD * mysql_fields, unsigned int); - MYSQL_RES * (* use_result)(MYSQL * mysql); - void (* fetch_lengths)(unsigned long int * to, MYSQL_ROW, unsigned int); - void (* flush_use_result)(MYSQL * mysql); - MYSQL_FIELD * (* list_fields)(MYSQL * mysql); - my_bool (* read_prepare_result)(MYSQL * mysql, MYSQL_STMT * stmt); - int (* stmt_execute)(MYSQL_STMT * stmt); - int (* read_binary_rows)(MYSQL_STMT * stmt); - int (* unbuffered_fetch)(MYSQL * mysql, char * * row); - void (* free_embedded_thd)(MYSQL * mysql); - char const * (* read_statistics)(MYSQL * mysql); - my_bool (* next_result)(MYSQL * mysql); - int (* read_change_user_result)(MYSQL * mysql, char * buff, char const * passwd); - int (* read_rows_from_cursor)(MYSQL_STMT * stmt); - }; -# 173 "mysql.h" -struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_mysql_options - { - unsigned int connect_timeout; - unsigned int read_timeout; - unsigned int write_timeout; - unsigned int port; - unsigned int protocol; - unsigned long int client_flag; - char * host; - char * user; - char * password; - char * unix_socket; - char * db; - struct st_dynamic_array * init_commands; - char * my_cnf_file; - char * my_cnf_group; - char * charset_dir; - char * charset_name; - char * ssl_key; - char * ssl_cert; - char * ssl_ca; - char * ssl_capath; - char * ssl_cipher; - char * shared_memory_base_name; - unsigned long int max_allowed_packet; - my_bool use_ssl; - my_bool compress; - my_bool named_pipe; - my_bool rpl_probe; - my_bool rpl_parse; - my_bool no_master_reads; - my_bool separate_thread; - enum mysql_option methods_to_use; - char * client_ip; - my_bool secure_auth; - my_bool report_data_truncation; - int (* local_infile_init)(void * *, char const *, void *); - int (* local_infile_read)(void *, char *, unsigned int); - void (* local_infile_end)(void); - int (* local_infile_error)(void *, char *, unsigned int); - void * local_infile_userdata; - void * extension; - }; -# 363 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)))) st_mysql_parameters - { - unsigned long int * p_max_allowed_packet; - unsigned long int * p_net_buffer_length; - void * extension; - }; -# 384 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(int)), aligned(__alignof__(void *)))) st_mysql_plugin - { - int type; - void * info; - char const * name; - char const * author; - char const * descr; - int license; - int (* init)(void); - int (* deinit)(void); - unsigned int version; - struct st_mysql_show_var * status_vars; - struct st_mysql_sys_var * * system_vars; - void * __reserved1; - }; -# 316 "mysql.h" -struct __attribute__((aligned(__alignof__(unsigned long long int)), aligned(__alignof__(void *)))) st_mysql_res - { - my_ulonglong row_count; - MYSQL_FIELD * fields; - MYSQL_DATA * data; - MYSQL_ROWS * data_cursor; - unsigned long int * lengths; - MYSQL * handle; - struct st_mysql_methods const * methods; - MYSQL_ROW row; - MYSQL_ROW current_row; - MEM_ROOT field_alloc; - unsigned int field_count; - unsigned int current_field; - my_bool eof; - my_bool unbuffered_fetch_cancelled; - void * extension; - }; -# 139 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_rows - { - struct st_mysql_rows * next; - MYSQL_ROW data; - unsigned long int length; - }; -# 116 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(void *)))) st_mysql_show_var - { - char const * name; - char * value; - enum enum_mysql_show_type type; - }; -# 683 "mysql.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long long int)))) st_mysql_stmt - { - MEM_ROOT mem_root; - LIST list; - MYSQL * mysql; - MYSQL_BIND * params; - MYSQL_BIND * bind; - MYSQL_FIELD * fields; - MYSQL_DATA result; - MYSQL_ROWS * data_cursor; - int (* read_row_func)(struct st_mysql_stmt * stmt, unsigned char * * row); - my_ulonglong affected_rows; - my_ulonglong insert_id; - unsigned long int stmt_id; - unsigned long int flags; - unsigned long int prefetch_rows; - unsigned int server_status; - unsigned int last_errno; - unsigned int param_count; - unsigned int field_count; - enum enum_mysql_stmt_state state; - char last_error[512]; - char sqlstate[(5 + 1)]; - my_bool send_types_to_server; - my_bool bind_param_done; - unsigned char bind_result_done; - my_bool unbuffered_fetch_cancelled; - my_bool update_max_length; - void * extension; - }; -# 616 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(int)))) st_mysql_storage_engine - { - int interface_version; - }; -# 47 "mysql_time.h" -struct __attribute__((aligned(__alignof__(unsigned long int)))) st_mysql_time - { - unsigned int year; - unsigned int month; - unsigned int day; - unsigned int hour; - unsigned int minute; - unsigned int second; - unsigned long int second_part; - my_bool neg; - enum enum_mysql_timestamp_type time_type; - }; -# 658 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(void *)))) st_mysql_value - { - int (* value_type)(struct st_mysql_value *); - char const * (* val_str)(struct st_mysql_value *, char * buffer, int * length); - int (* val_real)(struct st_mysql_value *, double * realbuf); - int (* val_int)(struct st_mysql_value *, long long int * intbuf); - }; -# 46 "mysql/plugin.h" -struct __attribute__((aligned(__alignof__(long int)))) st_mysql_xid - { - long int formatID; - long int gtrid_length; - long int bqual_length; - char data[128]; - }; -# 188 "mysql_com.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_net - { - Vio * vio; - unsigned char * buff; - unsigned char * buff_end; - unsigned char * write_pos; - unsigned char * read_pos; - my_socket fd; - unsigned long int remain_in_buf; - unsigned long int length; - unsigned long int buf_length; - unsigned long int where_b; - unsigned long int max_packet; - unsigned long int max_packet_size; - unsigned int pkt_nr; - unsigned int compress_pkt_nr; - unsigned int write_timeout; - unsigned int read_timeout; - unsigned int retry_count; - int fcntl; - unsigned int * return_status; - unsigned char reading_or_writing; - char save_char; - my_bool unused0; - my_bool unused; - my_bool compress; - my_bool unused1; - unsigned char * query_cache_query; - unsigned int last_errno; - unsigned char error; - my_bool unused2; - my_bool return_errno; - char last_error[512]; - char sqlstate[(5 + 1)]; - void * extension; - }; -# 22 "typelib.h" -struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_typelib - { - unsigned int count; - char const * name; - char const * * type_names; - unsigned int * type_lengths; - }; -# 383 "mysql_com.h" -struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args - { - unsigned int arg_count; - enum Item_result * arg_type; - char * * args; - unsigned long int * lengths; - char * maybe_null; - char * * attributes; - unsigned long int * attribute_lengths; - void * extension; - }; -# 397 "mysql_com.h" -struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init - { - my_bool maybe_null; - unsigned int decimals; - unsigned long int max_length; - char * ptr; - my_bool const_item; - void * extension; - }; -# 26 "my_alloc.h" -struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned int)))) st_used_mem - { - struct st_used_mem * next; - unsigned int left; - unsigned int size; - }; -# 380 "mysql_com.h" -enum Item_result - { - STRING_RESULT = 0, - REAL_RESULT = 1, - INT_RESULT = 2, - ROW_RESULT = 3, - DECIMAL_RESULT = 4, - }; -# 321 "mysql_com.h" -enum enum_cursor_type - { - CURSOR_TYPE_NO_CURSOR = 0, - CURSOR_TYPE_READ_ONLY = 1, - CURSOR_TYPE_FOR_UPDATE = 2, - CURSOR_TYPE_SCROLLABLE = 4, - }; -# 234 "mysql_com.h" -enum enum_field_types - { - MYSQL_TYPE_DECIMAL = 0, - MYSQL_TYPE_TINY = 1, - MYSQL_TYPE_SHORT = 2, - MYSQL_TYPE_LONG = 3, - MYSQL_TYPE_FLOAT = 4, - MYSQL_TYPE_DOUBLE = 5, - MYSQL_TYPE_NULL = 6, - MYSQL_TYPE_TIMESTAMP = 7, - MYSQL_TYPE_LONGLONG = 8, - MYSQL_TYPE_INT24 = 9, - MYSQL_TYPE_DATE = 10, - MYSQL_TYPE_TIME = 11, - MYSQL_TYPE_DATETIME = 12, - MYSQL_TYPE_YEAR = 13, - MYSQL_TYPE_NEWDATE = 14, - MYSQL_TYPE_VARCHAR = 15, - MYSQL_TYPE_BIT = 16, - MYSQL_TYPE_NEWDECIMAL = 246, - MYSQL_TYPE_ENUM = 247, - MYSQL_TYPE_SET = 248, - MYSQL_TYPE_TINY_BLOB = 249, - MYSQL_TYPE_MEDIUM_BLOB = 250, - MYSQL_TYPE_LONG_BLOB = 251, - MYSQL_TYPE_BLOB = 252, - MYSQL_TYPE_VAR_STRING = 253, - MYSQL_TYPE_STRING = 254, - MYSQL_TYPE_GEOMETRY = 255, - }; -# 455 "mysql/plugin.h" -enum enum_ft_token_type - { - FT_TOKEN_EOF = 0, - FT_TOKEN_WORD = 1, - FT_TOKEN_LEFT_PAREN = 2, - FT_TOKEN_RIGHT_PAREN = 3, - FT_TOKEN_STOPWORD = 4, - }; -# 407 "mysql/plugin.h" -enum enum_ftparser_mode - { - MYSQL_FTPARSER_SIMPLE_MODE = 0, - MYSQL_FTPARSER_WITH_STOPWORDS = 1, - MYSQL_FTPARSER_FULL_BOOLEAN_INFO = 2, - }; -# 331 "mysql_com.h" -enum enum_mysql_set_option - { - MYSQL_OPTION_MULTI_STATEMENTS_ON = 0, - MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1, - }; -# 109 "mysql/plugin.h" -enum enum_mysql_show_type - { - SHOW_UNDEF = 0, - SHOW_BOOL = 1, - SHOW_INT = 2, - SHOW_LONG = 3, - SHOW_LONGLONG = 4, - SHOW_CHAR = 5, - SHOW_CHAR_PTR = 6, - SHOW_ARRAY = 7, - SHOW_FUNC = 8, - SHOW_DOUBLE = 9, - }; -# 584 "mysql.h" -enum enum_mysql_stmt_state - { - MYSQL_STMT_INIT_DONE = 1, - MYSQL_STMT_PREPARE_DONE = 2, - MYSQL_STMT_EXECUTE_DONE = 3, - MYSQL_STMT_FETCH_DONE = 4, - }; -# 28 "mysql_time.h" -enum enum_mysql_timestamp_type - { - MYSQL_TIMESTAMP_NONE = -(2), - MYSQL_TIMESTAMP_ERROR = -(1), - MYSQL_TIMESTAMP_DATE = 0, - MYSQL_TIMESTAMP_DATETIME = 1, - MYSQL_TIMESTAMP_TIME = 2, - }; -# 55 "mysql_com.h" -enum enum_server_command - { - COM_SLEEP = 0, - COM_QUIT = 1, - COM_INIT_DB = 2, - COM_QUERY = 3, - COM_FIELD_LIST = 4, - COM_CREATE_DB = 5, - COM_DROP_DB = 6, - COM_REFRESH = 7, - COM_SHUTDOWN = 8, - COM_STATISTICS = 9, - COM_PROCESS_INFO = 10, - COM_CONNECT = 11, - COM_PROCESS_KILL = 12, - COM_DEBUG = 13, - COM_PING = 14, - COM_TIME = 15, - COM_DELAYED_INSERT = 16, - COM_CHANGE_USER = 17, - COM_BINLOG_DUMP = 18, - COM_TABLE_DUMP = 19, - COM_CONNECT_OUT = 20, - COM_REGISTER_SLAVE = 21, - COM_STMT_PREPARE = 22, - COM_STMT_EXECUTE = 23, - COM_STMT_SEND_LONG_DATA = 24, - COM_STMT_CLOSE = 25, - COM_STMT_RESET = 26, - COM_SET_OPTION = 27, - COM_STMT_FETCH = 28, - COM_DAEMON = 29, - COM_END = 30, - }; -# 730 "mysql.h" -enum enum_stmt_attr_type - { - STMT_ATTR_UPDATE_MAX_LENGTH = 0, - STMT_ATTR_CURSOR_TYPE = 1, - STMT_ATTR_PREFETCH_ROWS = 2, - }; -# 296 "mysql_com.h" -enum mysql_enum_shutdown_level - { - SHUTDOWN_DEFAULT = 0, - SHUTDOWN_WAIT_CONNECTIONS = (unsigned char)((1 << 0)), - SHUTDOWN_WAIT_TRANSACTIONS = (unsigned char)((1 << 1)), - SHUTDOWN_WAIT_UPDATES = (unsigned char)((1 << 3)), - SHUTDOWN_WAIT_ALL_BUFFERS = ((unsigned char)((1 << 3)) << 1), - SHUTDOWN_WAIT_CRITICAL_BUFFERS = (((unsigned char)((1 << 3)) << 1) + 1), - KILL_CONNECTION = 255, - }; -# 160 "mysql.h" -enum mysql_option - { - MYSQL_OPT_CONNECT_TIMEOUT = 0, - MYSQL_OPT_COMPRESS = 1, - MYSQL_OPT_NAMED_PIPE = 2, - MYSQL_INIT_COMMAND = 3, - MYSQL_READ_DEFAULT_FILE = 4, - MYSQL_READ_DEFAULT_GROUP = 5, - MYSQL_SET_CHARSET_DIR = 6, - MYSQL_SET_CHARSET_NAME = 7, - MYSQL_OPT_LOCAL_INFILE = 8, - MYSQL_OPT_PROTOCOL = 9, - MYSQL_SHARED_MEMORY_BASE_NAME = 10, - MYSQL_OPT_READ_TIMEOUT = 11, - MYSQL_OPT_WRITE_TIMEOUT = 12, - MYSQL_OPT_USE_RESULT = 13, - MYSQL_OPT_USE_REMOTE_CONNECTION = 14, - MYSQL_OPT_USE_EMBEDDED_CONNECTION = 15, - MYSQL_OPT_GUESS_CONNECTION = 16, - MYSQL_SET_CLIENT_IP = 17, - MYSQL_SECURE_AUTH = 18, - MYSQL_REPORT_DATA_TRUNCATION = 19, - MYSQL_OPT_RECONNECT = 20, - MYSQL_OPT_SSL_VERIFY_SERVER_CERT = 21, - }; -# 228 "mysql.h" -enum mysql_protocol_type - { - MYSQL_PROTOCOL_DEFAULT = 0, - MYSQL_PROTOCOL_TCP = 1, - MYSQL_PROTOCOL_SOCKET = 2, - MYSQL_PROTOCOL_PIPE = 3, - MYSQL_PROTOCOL_MEMORY = 4, - }; -# 238 "mysql.h" -enum mysql_rpl_type - { - MYSQL_RPL_MASTER = 0, - MYSQL_RPL_SLAVE = 1, - MYSQL_RPL_ADMIN = 2, - }; -# 223 "mysql.h" -enum mysql_status - { - MYSQL_STATUS_READY = 0, - MYSQL_STATUS_GET_RESULT = 1, - MYSQL_STATUS_USE_RESULT = 2, - }; -# 441 "mysql_com.h" -extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2); -# 434 "mysql_com.h" -extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt); -# 35 "typelib.h" -extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from); -# 429 "mysql_com.h" -extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st); -# 32 "typelib.h" -extern int find_type(char * x, TYPELIB const * typelib, unsigned int); -# 30 "typelib.h" -extern int find_type_or_exit(char const * x, TYPELIB * typelib, char const * option); -# 29 "typelib.h" -extern my_ulonglong find_typeset(char * x, TYPELIB * typelib, int * error_position); -# 443 "mysql_com.h" -extern void get_salt_from_password(unsigned char * res, char const * password); -# 436 "mysql_com.h" -extern void get_salt_from_password_323(unsigned long int * res, char const * password); -# 449 "mysql_com.h" -extern char * get_tty_password(char const * opt_message); -# 34 "typelib.h" -extern char const * get_type(TYPELIB * typelib, unsigned int); -# 431 "mysql_com.h" -extern void hash_password(unsigned long int * to, char const * password, unsigned int); -# 30 "my_list.h" -extern LIST * list_add(LIST * root, LIST * element); -# 32 "my_list.h" -extern LIST * list_cons(void * data, LIST * root); -# 31 "my_list.h" -extern LIST * list_delete(LIST * root, LIST * element); -# 34 "my_list.h" -extern void list_free(LIST * root, unsigned int); -# 35 "my_list.h" -extern unsigned int list_length(LIST *); -# 33 "my_list.h" -extern LIST * list_reverse(LIST * root); -# 36 "my_list.h" -extern int list_walk(LIST *, list_walk_action, unsigned char * argument); -# 444 "mysql_com.h" -extern void make_password_from_salt(char * to, unsigned char const * hash_stage2); -# 437 "mysql_com.h" -extern void make_password_from_salt_323(char * to, unsigned long int const * salt); -# 439 "mysql_com.h" -extern void make_scrambled_password(char * to, char const * password); -# 432 "mysql_com.h" -extern void make_scrambled_password_323(char * to, char const * password); -# 33 "typelib.h" -extern void make_type(char * to, unsigned int, TYPELIB * typelib); -# 366 "mysql_com.h" -extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int); -# 343 "mysql_com.h" -extern my_bool my_net_init(NET * net, Vio * vio); -# 344 "mysql_com.h" -extern void my_net_local_init(NET * net); -# 354 "mysql_com.h" -extern unsigned long int my_net_read(NET * net); -# 349 "mysql_com.h" -extern my_bool my_net_write(NET * net, unsigned char const * packet, size_t); -# 428 "mysql_com.h" -extern double my_rnd(struct rand_struct *); -# 455 "mysql_com.h" -extern void my_thread_end(void); -# 454 "mysql_com.h" -extern my_bool my_thread_init(void); -# 560 "mysql.h" -extern void myodbc_remove_escape(MYSQL * mysql, char * name); -# 512 "mysql.h" -extern int mysql_add_slave(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd); -# 421 "mysql.h" -extern my_ulonglong mysql_affected_rows(MYSQL * mysql); -# 826 "mysql.h" -extern my_bool mysql_autocommit(MYSQL * mysql, my_bool); -# 437 "mysql.h" -extern my_bool mysql_change_user(MYSQL * mysql, char const * user, char const * passwd, char const * db); -# 429 "mysql.h" -extern char const * mysql_character_set_name(MYSQL * mysql); -# 829 "mysql.h" -extern void mysql_close(MYSQL * sock); -# 824 "mysql.h" -extern my_bool mysql_commit(MYSQL * mysql); -# 541 "mysql.h" -extern void mysql_data_seek(MYSQL_RES * result, my_ulonglong); -# 559 "mysql.h" -extern void mysql_debug(char const * debug); -# 498 "mysql.h" -extern void mysql_disable_reads_from_master(MYSQL * mysql); -# 492 "mysql.h" -extern void mysql_disable_rpl_parse(MYSQL * mysql); -# 520 "mysql.h" -extern int mysql_dump_debug_info(MYSQL * mysql); -# 562 "mysql.h" -extern my_bool mysql_embedded(void); -# 497 "mysql.h" -extern void mysql_enable_reads_from_master(MYSQL * mysql); -# 491 "mysql.h" -extern void mysql_enable_rpl_parse(MYSQL * mysql); -# 413 "mysql.h" -extern my_bool mysql_eof(MYSQL_RES * res); -# 423 "mysql.h" -extern unsigned int mysql_errno(MYSQL * mysql); -# 450 "mysql_com.h" -extern char const * mysql_errno_to_sqlstate(unsigned int); -# 424 "mysql.h" -extern char const * mysql_error(MYSQL * mysql); -# 552 "mysql.h" -extern unsigned long int mysql_escape_string(char * to, char const * from, unsigned long int); -# 549 "mysql.h" -extern MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * result); -# 414 "mysql.h" -extern MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res, unsigned int); -# 416 "mysql.h" -extern MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES * res); -# 548 "mysql.h" -extern unsigned long int * mysql_fetch_lengths(MYSQL_RES * result); -# 547 "mysql.h" -extern MYSQL_ROW mysql_fetch_row(MYSQL_RES * result); -# 420 "mysql.h" -extern unsigned int mysql_field_count(MYSQL * mysql); -# 545 "mysql.h" -extern MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES * result, MYSQL_FIELD_OFFSET); -# 418 "mysql.h" -extern MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES * res); -# 540 "mysql.h" -extern void mysql_free_result(MYSQL_RES * result); -# 465 "mysql.h" -extern void mysql_get_character_set_info(MYSQL * mysql, MY_CHARSET_INFO * charset); -# 530 "mysql.h" -extern char const * mysql_get_client_info(void); -# 531 "mysql.h" -extern unsigned long int mysql_get_client_version(void); -# 532 "mysql.h" -extern char const * mysql_get_host_info(MYSQL * mysql); -# 395 "mysql.h" -extern MYSQL_PARAMETERS * mysql_get_parameters(void); -# 534 "mysql.h" -extern unsigned int mysql_get_proto_info(MYSQL * mysql); -# 529 "mysql.h" -extern char const * mysql_get_server_info(MYSQL * mysql); -# 533 "mysql.h" -extern unsigned long int mysql_get_server_version(MYSQL * mysql); -# 436 "mysql.h" -extern char const * mysql_get_ssl_cipher(MYSQL * mysql); -# 554 "mysql.h" -extern unsigned long int mysql_hex_string(char * to, char const * from, unsigned long int); -# 427 "mysql.h" -extern char const * mysql_info(MYSQL * mysql); -# 432 "mysql.h" -extern MYSQL * mysql_init(MYSQL * mysql); -# 422 "mysql.h" -extern my_ulonglong mysql_insert_id(MYSQL * mysql); -# 523 "mysql.h" -extern int mysql_kill(MYSQL * mysql, unsigned long int); -# 535 "mysql.h" -extern MYSQL_RES * mysql_list_dbs(MYSQL * mysql, char const * wild); -# 550 "mysql.h" -extern MYSQL_RES * mysql_list_fields(MYSQL * mysql, char const * table, char const * wild); -# 537 "mysql.h" -extern MYSQL_RES * mysql_list_processes(MYSQL * mysql); -# 536 "mysql.h" -extern MYSQL_RES * mysql_list_tables(MYSQL * mysql, char const * wild); -# 569 "mysql.h" -extern void mysql_manager_close(MYSQL_MANAGER * con); -# 570 "mysql.h" -extern int mysql_manager_command(MYSQL_MANAGER * con, char const * cmd, int); -# 564 "mysql.h" -extern MYSQL_MANAGER * mysql_manager_connect(MYSQL_MANAGER * con, char const * host, char const * user, char const * passwd, unsigned int); -# 572 "mysql.h" -extern int mysql_manager_fetch_line(MYSQL_MANAGER * con, char * res_buf, int); -# 563 "mysql.h" -extern MYSQL_MANAGER * mysql_manager_init(MYSQL_MANAGER * con); -# 456 "mysql.h" -extern my_bool mysql_master_query(MYSQL * mysql, char const * q, unsigned long int); -# 458 "mysql.h" -extern my_bool mysql_master_send_query(MYSQL * mysql, char const * q, unsigned long int); -# 827 "mysql.h" -extern my_bool mysql_more_results(MYSQL * mysql); -# 828 "mysql.h" -extern int mysql_next_result(MYSQL * mysql); -# 412 "mysql.h" -extern unsigned int mysql_num_fields(MYSQL_RES * res); -# 411 "mysql.h" -extern my_ulonglong mysql_num_rows(MYSQL_RES * res); -# 538 "mysql.h" -extern int mysql_options(MYSQL * mysql, enum mysql_option, void const * arg); -# 527 "mysql.h" -extern int mysql_ping(MYSQL * mysql); -# 76 "mysql.h" -extern unsigned int mysql_port; -# 447 "mysql.h" -extern int mysql_query(MYSQL * mysql, char const * q); -# 780 "mysql/plugin.h" -extern void mysql_query_cache_invalidate4(void * thd, char const * key, unsigned int, int); -# 575 "mysql.h" -extern my_bool mysql_read_query_result(MYSQL * mysql); -# 500 "mysql.h" -extern my_bool mysql_reads_from_master_enabled(MYSQL * mysql); -# 439 "mysql.h" -extern MYSQL * mysql_real_connect(MYSQL * mysql, char const * host, char const * user, char const * passwd, char const * db, unsigned int, char const * unix_socket, unsigned long int); -# 556 "mysql.h" -extern unsigned long int mysql_real_escape_string(MYSQL * mysql, char * to, char const * from, unsigned long int); -# 450 "mysql.h" -extern int mysql_real_query(MYSQL * mysql, char const * q, unsigned long int); -# 521 "mysql.h" -extern int mysql_refresh(MYSQL * mysql, unsigned int); -# 825 "mysql.h" -extern my_bool mysql_rollback(MYSQL * mysql); -# 543 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES * result, MYSQL_ROW_OFFSET); -# 417 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES * res); -# 494 "mysql.h" -extern int mysql_rpl_parse_enabled(MYSQL * mysql); -# 505 "mysql.h" -extern my_bool mysql_rpl_probe(MYSQL * mysql); -# 502 "mysql.h" -extern enum mysql_rpl_type mysql_rpl_query_type(char const * q, int); -# 446 "mysql.h" -extern int mysql_select_db(MYSQL * mysql, char const * db); -# 448 "mysql.h" -extern int mysql_send_query(MYSQL * mysql, char const * q, unsigned long int); -# 381 "mysql.h" -extern void mysql_server_end(void); -# 380 "mysql.h" -extern int mysql_server_init(int, char * * argv, char * * groups); -# 430 "mysql.h" -extern int mysql_set_character_set(MYSQL * mysql, char const * csname); -# 483 "mysql.h" -extern void mysql_set_local_infile_default(MYSQL * mysql); -# 472 "mysql.h" -extern void mysql_set_local_infile_handler(MYSQL * mysql, int (* local_infile_init)(void * *, char const *, void *), int (* local_infile_read)(void *, char *, unsigned int), void (* local_infile_end)(void), int (* local_infile_error)(void *, char *, unsigned int), void *); -# 508 "mysql.h" -extern int mysql_set_master(MYSQL * mysql, char const * host, unsigned int, char const * user, char const * passwd); -# 524 "mysql.h" -extern int mysql_set_server_option(MYSQL * mysql, enum enum_mysql_set_option); -# 517 "mysql.h" -extern int mysql_shutdown(MYSQL * mysql, enum mysql_enum_shutdown_level); -# 461 "mysql.h" -extern my_bool mysql_slave_query(MYSQL * mysql, char const * q, unsigned long int); -# 463 "mysql.h" -extern my_bool mysql_slave_send_query(MYSQL * mysql, char const * q, unsigned long int); -# 425 "mysql.h" -extern char const * mysql_sqlstate(MYSQL * mysql); -# 433 "mysql.h" -extern my_bool mysql_ssl_set(MYSQL * mysql, char const * key, char const * cert, char const * ca, char const * capath, char const * cipher); -# 528 "mysql.h" -extern char const * mysql_stat(MYSQL * mysql); -# 820 "mysql.h" -extern my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT * stmt); -# 798 "mysql.h" -extern my_bool mysql_stmt_attr_get(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void * attr); -# 795 "mysql.h" -extern my_bool mysql_stmt_attr_set(MYSQL_STMT * stmt, enum enum_stmt_attr_type, void const * attr); -# 801 "mysql.h" -extern my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -# 802 "mysql.h" -extern my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -# 803 "mysql.h" -extern my_bool mysql_stmt_close(MYSQL_STMT * stmt); -# 818 "mysql.h" -extern void mysql_stmt_data_seek(MYSQL_STMT * stmt, my_ulonglong); -# 812 "mysql.h" -extern unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); -# 813 "mysql.h" -extern char const * mysql_stmt_error(MYSQL_STMT * stmt); -# 788 "mysql.h" -extern int mysql_stmt_execute(MYSQL_STMT * stmt); -# 789 "mysql.h" -extern int mysql_stmt_fetch(MYSQL_STMT * stmt); -# 790 "mysql.h" -extern int mysql_stmt_fetch_column(MYSQL_STMT * stmt, MYSQL_BIND * bind_arg, unsigned int, unsigned long int); -# 822 "mysql.h" -extern unsigned int mysql_stmt_field_count(MYSQL_STMT * stmt); -# 805 "mysql.h" -extern my_bool mysql_stmt_free_result(MYSQL_STMT * stmt); -# 785 "mysql.h" -extern MYSQL_STMT * mysql_stmt_init(MYSQL * mysql); -# 821 "mysql.h" -extern my_ulonglong mysql_stmt_insert_id(MYSQL_STMT * stmt); -# 819 "mysql.h" -extern my_ulonglong mysql_stmt_num_rows(MYSQL_STMT * stmt); -# 794 "mysql.h" -extern unsigned long int mysql_stmt_param_count(MYSQL_STMT * stmt); -# 811 "mysql.h" -extern MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT * stmt); -# 786 "mysql.h" -extern int mysql_stmt_prepare(MYSQL_STMT * stmt, char const * query, unsigned long int); -# 804 "mysql.h" -extern my_bool mysql_stmt_reset(MYSQL_STMT * stmt); -# 810 "mysql.h" -extern MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT * stmt); -# 815 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT * stmt, MYSQL_ROW_OFFSET); -# 817 "mysql.h" -extern MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT * stmt); -# 806 "mysql.h" -extern my_bool mysql_stmt_send_long_data(MYSQL_STMT * stmt, unsigned int, char const * data, unsigned long int); -# 814 "mysql.h" -extern char const * mysql_stmt_sqlstate(MYSQL_STMT * stmt); -# 793 "mysql.h" -extern int mysql_stmt_store_result(MYSQL_STMT * stmt); -# 452 "mysql.h" -extern MYSQL_RES * mysql_store_result(MYSQL * mysql); -# 404 "mysql.h" -extern void mysql_thread_end(void); -# 428 "mysql.h" -extern unsigned long int mysql_thread_id(MYSQL * mysql); -# 403 "mysql.h" -extern my_bool mysql_thread_init(void); -# 561 "mysql.h" -extern unsigned int mysql_thread_safe(void); -# 699 "mysql/plugin.h" -extern int mysql_tmpfile(char const * prefix); -# 77 "mysql.h" -extern char * mysql_unix_port; -# 453 "mysql.h" -extern MYSQL_RES * mysql_use_result(MYSQL * mysql); -# 426 "mysql.h" -extern unsigned int mysql_warning_count(MYSQL * mysql); -# 346 "mysql_com.h" -extern void net_clear(NET * net, my_bool); -# 345 "mysql_com.h" -extern void net_end(NET * net); -# 348 "mysql_com.h" -extern my_bool net_flush(NET * net); -# 353 "mysql_com.h" -extern int net_real_write(NET * net, unsigned char const * packet, size_t); -# 347 "mysql_com.h" -extern my_bool net_realloc(NET * net, size_t); -# 350 "mysql_com.h" -extern my_bool net_write_command(NET * net, unsigned char, unsigned char const * header, size_t, unsigned char const * packet, size_t); -# 445 "mysql_com.h" -extern char * octet2hex(char * to, char const * str, unsigned int); -# 426 "mysql_com.h" -extern void randominit(struct rand_struct *, unsigned long int, unsigned long int); -# 440 "mysql_com.h" -extern void scramble(char * to, char const * message, char const * password); -# 433 "mysql_com.h" -extern void scramble_323(char * to, char const * message, char const * password); -# 37 "typelib.h" -extern TYPELIB sql_protocol_typelib; -# 729 "mysql/plugin.h" -extern void * thd_alloc(void * thd, unsigned int); -# 733 "mysql/plugin.h" -extern void * thd_calloc(void * thd, unsigned int); -# 770 "mysql/plugin.h" -extern void thd_get_xid(void const * thd, MYSQL_XID * xid); -# 680 "mysql/plugin.h" -extern void * * thd_ha_data(void const * thd, struct handlerton const * hton); -# 675 "mysql/plugin.h" -extern int thd_in_lock_tables(void const * thd); -# 685 "mysql/plugin.h" -extern void thd_inc_row_count(void); -# 715 "mysql/plugin.h" -extern int thd_killed(void const * thd); -# 760 "mysql/plugin.h" -extern MYSQL_LEX_STRING * thd_make_lex_string(void * thd, MYSQL_LEX_STRING * lex_str, char const * str, unsigned int, int); -# 745 "mysql/plugin.h" -extern void * thd_memdup(void * thd, void const * str, unsigned int); -# 679 "mysql/plugin.h" -extern char const * thd_proc_info(void * thd, char const * info); -# 682 "mysql/plugin.h" -extern char * thd_security_context(void * thd, char * buffer, unsigned int, unsigned int); -# 678 "mysql/plugin.h" -extern int thd_sql_command(void const * thd); -# 737 "mysql/plugin.h" -extern char * thd_strdup(void * thd, char const * str); -# 741 "mysql/plugin.h" -extern char * thd_strmake(void * thd, char const * str, unsigned int); -# 676 "mysql/plugin.h" -extern int thd_tablespace_op(void const * thd); -# 677 "mysql/plugin.h" -extern long long int thd_test_options(void const * thd, long long int); -# 681 "mysql/plugin.h" -extern int thd_tx_isolation(void const * thd); diff --git a/sql/mysql_priv.h.pp b/sql/mysql_priv.h.pp new file mode 100644 index 00000000000..8bb31f64587 --- /dev/null +++ b/sql/mysql_priv.h.pp @@ -0,0 +1,10978 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +int __cxa_pure_virtual () __attribute__ ((weak)); +#include +struct _db_code_state_; +extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword); +extern int _db_strict_keyword_(const char *keyword); +extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len); +extern int _db_explain_init_(char *buf, size_t len); +extern void _db_setjmp_(void); +extern void _db_longjmp_(void); +extern void _db_process_(const char *name); +extern void _db_push_(const char *control); +extern void _db_pop_(void); +extern void _db_set_(struct _db_code_state_ *cs, const char *control); +extern void _db_set_init_(const char *control); +extern void _db_enter_(const char *_func_,const char *_file_,uint _line_, + const char **_sfunc_,const char **_sfile_, + uint *_slevel_, char ***); +extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_, + uint *_slevel_); +extern void _db_pargs_(uint _line_,const char *keyword); +extern void _db_doprnt_ (const char *format,...) + __attribute__((format(printf, 1, 2))); +extern void _db_dump_(uint _line_,const char *keyword, + const unsigned char *memory, size_t length); +extern void _db_end_(void); +extern void _db_lock_file_(void); +extern void _db_unlock_file_(void); +extern FILE *_db_fp_(void); +typedef int File; +typedef int my_socket; +typedef void (*sig_return)(); +typedef char pchar; +typedef char puchar; +typedef char pbool; +typedef short pshort; +typedef float pfloat; +typedef int (*qsort_cmp)(const void *,const void *); +typedef int (*qsort_cmp2)(void*, const void *,const void *); +#include +typedef socklen_t size_socket; +typedef long my_ptrdiff_t; +typedef unsigned char uchar; +typedef signed char int8; +typedef unsigned char uint8; +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned int uint32; +typedef unsigned long long int ulonglong; +typedef long long int longlong; +typedef longlong int64; +typedef ulonglong uint64; +typedef unsigned long long my_ulonglong; +typedef int intptr; +typedef ulonglong my_off_t; +typedef off_t os_off_t; +typedef uint8 int7; +typedef short int15; +typedef int myf; +typedef char my_bool; +typedef char bool; +typedef union { + double v; + long m[2]; +} doubleget_union; +#include +#include +#include +#include +#include +#include +#include +extern int my_pthread_getprio(pthread_t thread_id); +typedef void *(* pthread_handler)(void *); +extern void my_pthread_setprio(pthread_t thread_id,int prior); +extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority); +typedef struct st_safe_mutex_t +{ + pthread_mutex_t global,mutex; + const char *file; + uint line,count; + pthread_t thread; +} safe_mutex_t; +int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr, + const char *file, uint line); +int safe_mutex_lock(safe_mutex_t *mp, my_bool try_lock, const char *file, uint line); +int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line); +int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); +int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, + uint line); +int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, + struct timespec *abstime, const char *file, uint line); +void safe_mutex_global_init(void); +void safe_mutex_end(FILE *file); +typedef ulong my_thread_id; +extern my_bool my_thread_global_init(void); +extern void my_thread_global_end(void); +extern my_bool my_thread_init(void); +extern void my_thread_end(void); +extern const char *my_thread_name(void); +extern my_thread_id my_thread_dbug_id(void); +extern int pthread_no_free(void *); +extern int pthread_dummy(int); +struct st_my_thread_var +{ + int thr_errno; + pthread_cond_t suspend; + pthread_mutex_t mutex; + pthread_mutex_t * volatile current_mutex; + pthread_cond_t * volatile current_cond; + pthread_t pthread_self; + my_thread_id id; + int cmp_length; + int volatile abort; + my_bool init; + struct st_my_thread_var *next,**prev; + void *opt_info; + void *dbug; + char name[10 +1]; +}; +extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); +extern uint my_thread_end_wait_time; +extern uint thd_lib_detected; +#include +#include +typedef struct unicase_info_st +{ + uint16 toupper; + uint16 tolower; + uint16 sort; +} MY_UNICASE_INFO; +extern MY_UNICASE_INFO *my_unicase_default[256]; +extern MY_UNICASE_INFO *my_unicase_turkish[256]; +typedef struct uni_ctype_st +{ + uchar pctype; + uchar *ctype; +} MY_UNI_CTYPE; +extern MY_UNI_CTYPE my_uni_ctype[256]; +typedef struct my_uni_idx_st +{ + uint16 from; + uint16 to; + uchar *tab; +} MY_UNI_IDX; +typedef struct +{ + uint beg; + uint end; + uint mb_len; +} my_match_t; +enum my_lex_states +{ + MY_LEX_START, MY_LEX_CHAR, MY_LEX_IDENT, + MY_LEX_IDENT_SEP, MY_LEX_IDENT_START, + MY_LEX_REAL, MY_LEX_HEX_NUMBER, MY_LEX_BIN_NUMBER, + MY_LEX_CMP_OP, MY_LEX_LONG_CMP_OP, MY_LEX_STRING, MY_LEX_COMMENT, MY_LEX_END, + MY_LEX_OPERATOR_OR_IDENT, MY_LEX_NUMBER_IDENT, MY_LEX_INT_OR_REAL, + MY_LEX_REAL_OR_POINT, MY_LEX_BOOL, MY_LEX_EOL, MY_LEX_ESCAPE, + MY_LEX_LONG_COMMENT, MY_LEX_END_LONG_COMMENT, MY_LEX_SEMICOLON, + MY_LEX_SET_VAR, MY_LEX_USER_END, MY_LEX_HOSTNAME, MY_LEX_SKIP, + MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR, + MY_LEX_IDENT_OR_KEYWORD, + MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR, + MY_LEX_STRING_OR_DELIMITER +}; +struct charset_info_st; +typedef struct my_collation_handler_st +{ + my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); + int (*strnncoll)(struct charset_info_st *, + const uchar *, size_t, const uchar *, size_t, my_bool); + int (*strnncollsp)(struct charset_info_st *, + const uchar *, size_t, const uchar *, size_t, + my_bool diff_if_only_endspace_difference); + size_t (*strnxfrm)(struct charset_info_st *, + uchar *, size_t, const uchar *, size_t); + size_t (*strnxfrmlen)(struct charset_info_st *, size_t); + my_bool (*like_range)(struct charset_info_st *, + const char *s, size_t s_length, + pchar w_prefix, pchar w_one, pchar w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_len, size_t *max_len); + int (*wildcmp)(struct charset_info_st *, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape,int w_one, int w_many); + int (*strcasecmp)(struct charset_info_st *, const char *, const char *); + uint (*instr)(struct charset_info_st *, + const char *b, size_t b_length, + const char *s, size_t s_length, + my_match_t *match, uint nmatch); + void (*hash_sort)(struct charset_info_st *cs, const uchar *key, size_t len, + ulong *nr1, ulong *nr2); + my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, size_t len); +} MY_COLLATION_HANDLER; +extern MY_COLLATION_HANDLER my_collation_mb_bin_handler; +extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler; +extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler; +extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; +typedef int (*my_charset_conv_mb_wc)(struct charset_info_st *, ulong *, + const uchar *, const uchar *); +typedef int (*my_charset_conv_wc_mb)(struct charset_info_st *, ulong, + uchar *, uchar *); +typedef size_t (*my_charset_conv_case)(struct charset_info_st *, + char *, size_t, char *, size_t); +typedef struct my_charset_handler_st +{ + my_bool (*init)(struct charset_info_st *, void *(*alloc)(size_t)); + uint (*ismbchar)(struct charset_info_st *, const char *, const char *); + uint (*mbcharlen)(struct charset_info_st *, uint c); + size_t (*numchars)(struct charset_info_st *, const char *b, const char *e); + size_t (*charpos)(struct charset_info_st *, const char *b, const char *e, + size_t pos); + size_t (*well_formed_len)(struct charset_info_st *, + const char *b,const char *e, + size_t nchars, int *error); + size_t (*lengthsp)(struct charset_info_st *, const char *ptr, size_t length); + size_t (*numcells)(struct charset_info_st *, const char *b, const char *e); + my_charset_conv_mb_wc mb_wc; + my_charset_conv_wc_mb wc_mb; + int (*ctype)(struct charset_info_st *cs, int *ctype, + const uchar *s, const uchar *e); + size_t (*caseup_str)(struct charset_info_st *, char *); + size_t (*casedn_str)(struct charset_info_st *, char *); + my_charset_conv_case caseup; + my_charset_conv_case casedn; + size_t (*snprintf)(struct charset_info_st *, char *to, size_t n, + const char *fmt, + ...) __attribute__((format(printf, 4, 5))); + size_t (*long10_to_str)(struct charset_info_st *, char *to, size_t n, + int radix, long int val); + size_t (*longlong10_to_str)(struct charset_info_st *, char *to, size_t n, + int radix, longlong val); + void (*fill)(struct charset_info_st *, char *to, size_t len, int fill); + long (*strntol)(struct charset_info_st *, const char *s, size_t l, + int base, char **e, int *err); + ulong (*strntoul)(struct charset_info_st *, const char *s, size_t l, + int base, char **e, int *err); + longlong (*strntoll)(struct charset_info_st *, const char *s, size_t l, + int base, char **e, int *err); + ulonglong (*strntoull)(struct charset_info_st *, const char *s, size_t l, + int base, char **e, int *err); + double (*strntod)(struct charset_info_st *, char *s, size_t l, char **e, + int *err); + longlong (*strtoll10)(struct charset_info_st *cs, + const char *nptr, char **endptr, int *error); + ulonglong (*strntoull10rnd)(struct charset_info_st *cs, + const char *str, size_t length, + int unsigned_fl, + char **endptr, int *error); + size_t (*scan)(struct charset_info_st *, const char *b, const char *e, + int sq); +} MY_CHARSET_HANDLER; +extern MY_CHARSET_HANDLER my_charset_8bit_handler; +extern MY_CHARSET_HANDLER my_charset_ucs2_handler; +typedef struct charset_info_st +{ + uint number; + uint primary_number; + uint binary_number; + uint state; + const char *csname; + const char *name; + const char *comment; + const char *tailoring; + uchar *ctype; + uchar *to_lower; + uchar *to_upper; + uchar *sort_order; + uint16 *contractions; + uint16 **sort_order_big; + uint16 *tab_to_uni; + MY_UNI_IDX *tab_from_uni; + MY_UNICASE_INFO **caseinfo; + uchar *state_map; + uchar *ident_map; + uint strxfrm_multiply; + uchar caseup_multiply; + uchar casedn_multiply; + uint mbminlen; + uint mbmaxlen; + uint16 min_sort_char; + uint16 max_sort_char; + uchar pad_char; + my_bool escape_with_backslash_is_dangerous; + MY_CHARSET_HANDLER *cset; + MY_COLLATION_HANDLER *coll; +} CHARSET_INFO; +extern CHARSET_INFO my_charset_bin; +extern CHARSET_INFO my_charset_big5_chinese_ci; +extern CHARSET_INFO my_charset_big5_bin; +extern CHARSET_INFO my_charset_cp932_japanese_ci; +extern CHARSET_INFO my_charset_cp932_bin; +extern CHARSET_INFO my_charset_eucjpms_japanese_ci; +extern CHARSET_INFO my_charset_eucjpms_bin; +extern CHARSET_INFO my_charset_euckr_korean_ci; +extern CHARSET_INFO my_charset_euckr_bin; +extern CHARSET_INFO my_charset_gb2312_chinese_ci; +extern CHARSET_INFO my_charset_gb2312_bin; +extern CHARSET_INFO my_charset_gbk_chinese_ci; +extern CHARSET_INFO my_charset_gbk_bin; +extern CHARSET_INFO my_charset_latin1; +extern CHARSET_INFO my_charset_latin1_german2_ci; +extern CHARSET_INFO my_charset_latin1_bin; +extern CHARSET_INFO my_charset_latin2_czech_ci; +extern CHARSET_INFO my_charset_sjis_japanese_ci; +extern CHARSET_INFO my_charset_sjis_bin; +extern CHARSET_INFO my_charset_tis620_thai_ci; +extern CHARSET_INFO my_charset_tis620_bin; +extern CHARSET_INFO my_charset_ucs2_general_ci; +extern CHARSET_INFO my_charset_ucs2_bin; +extern CHARSET_INFO my_charset_ucs2_unicode_ci; +extern CHARSET_INFO my_charset_ujis_japanese_ci; +extern CHARSET_INFO my_charset_ujis_bin; +extern CHARSET_INFO my_charset_utf8_general_ci; +extern CHARSET_INFO my_charset_utf8_unicode_ci; +extern CHARSET_INFO my_charset_utf8_bin; +extern CHARSET_INFO my_charset_cp1250_czech_ci; +extern CHARSET_INFO my_charset_filename; +extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t, + const uchar *, size_t); +size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t); +extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t, + const uchar *, size_t, my_bool); +extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t, + const uchar *, size_t, + my_bool diff_if_only_endspace_difference); +extern void my_hash_sort_simple(CHARSET_INFO *cs, + const uchar *key, size_t len, + ulong *nr1, ulong *nr2); +extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length); +extern uint my_instr_simple(struct charset_info_st *, + const char *b, size_t b_length, + const char *s, size_t s_length, + my_match_t *match, uint nmatch); +extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *); +extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *); +extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); +int my_mb_wc_8bit(CHARSET_INFO *cs,ulong *wc, const uchar *s,const uchar *e); +int my_wc_mb_8bit(CHARSET_INFO *cs,ulong wc, uchar *s, uchar *e); +int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *); +int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *); +size_t my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq); +size_t my_snprintf_8bit(struct charset_info_st *, char *to, size_t n, + const char *fmt, ...) + __attribute__((format(printf, 4, 5))); +long my_strntol_8bit(CHARSET_INFO *, const char *s, size_t l, int base, + char **e, int *err); +ulong my_strntoul_8bit(CHARSET_INFO *, const char *s, size_t l, int base, + char **e, int *err); +longlong my_strntoll_8bit(CHARSET_INFO *, const char *s, size_t l, int base, + char **e, int *err); +ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, size_t l, int base, + char **e, int *err); +double my_strntod_8bit(CHARSET_INFO *, char *s, size_t l,char **e, + int *err); +size_t my_long10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix, + long int val); +size_t my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, size_t l, int radix, + longlong val); +longlong my_strtoll10_8bit(CHARSET_INFO *cs, + const char *nptr, char **endptr, int *error); +longlong my_strtoll10_ucs2(CHARSET_INFO *cs, + const char *nptr, char **endptr, int *error); +ulonglong my_strntoull10rnd_8bit(CHARSET_INFO *cs, + const char *str, size_t length, int + unsigned_fl, char **endptr, int *error); +ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, + const char *str, size_t length, + int unsigned_fl, char **endptr, int *error); +void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill); +my_bool my_like_range_simple(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); +my_bool my_like_range_mb(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); +my_bool my_like_range_ucs2(CHARSET_INFO *cs, + const char *ptr, size_t ptr_length, + pbool escape, pbool w_one, pbool w_many, + size_t res_length, + char *min_str, char *max_str, + size_t *min_length, size_t *max_length); +int my_wildcmp_8bit(CHARSET_INFO *, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many); +int my_wildcmp_bin(CHARSET_INFO *, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many); +size_t my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e); +size_t my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e); +size_t my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, size_t pos); +size_t my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, + size_t pos, int *error); +uint my_mbcharlen_8bit(CHARSET_INFO *, uint c); +extern size_t my_caseup_str_mb(CHARSET_INFO *, char *); +extern size_t my_casedn_str_mb(CHARSET_INFO *, char *); +extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *); +int my_wildcmp_mb(CHARSET_INFO *, + const char *str,const char *str_end, + const char *wildstr,const char *wildend, + int escape, int w_one, int w_many); +size_t my_numchars_mb(CHARSET_INFO *, const char *b, const char *e); +size_t my_numcells_mb(CHARSET_INFO *, const char *b, const char *e); +size_t my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, size_t pos); +size_t my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, + size_t pos, int *error); +uint my_instr_mb(struct charset_info_st *, + const char *b, size_t b_length, + const char *s, size_t s_length, + my_match_t *match, uint nmatch); +int my_wildcmp_unicode(CHARSET_INFO *cs, + const char *str, const char *str_end, + const char *wildstr, const char *wildend, + int escape, int w_one, int w_many, + MY_UNICASE_INFO **weights); +extern my_bool my_parse_charset_xml(const char *bug, size_t len, + int (*add)(CHARSET_INFO *cs)); +extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, + pchar c); +my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len); +my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len); +uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len); +my_bool my_charset_is_ascii_based(CHARSET_INFO *cs); +my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs); +#include +#include +#include "my_alloc.h" +typedef struct st_used_mem +{ + struct st_used_mem *next; + unsigned int left; + unsigned int size; +} USED_MEM; +typedef struct st_mem_root +{ + USED_MEM *free; + USED_MEM *used; + USED_MEM *pre_alloc; + size_t min_malloc; + size_t block_size; + unsigned int block_num; + unsigned int first_block_usage; + void (*error_handler)(void); +} MEM_ROOT; +typedef struct st_typelib { + unsigned int count; + const char *name; + const char **type_names; + unsigned int *type_lengths; +} TYPELIB; +extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); +extern int find_type_or_exit(const char *x, TYPELIB *typelib, + const char *option); +extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); +extern const char *get_type(TYPELIB *typelib,unsigned int nr); +extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); +extern TYPELIB sql_protocol_typelib; +extern void *my_malloc(size_t Size,myf MyFlags); +extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags); +extern void my_no_flags_free(void *ptr); +extern void *my_memdup(const void *from,size_t length,myf MyFlags); +extern char *my_strdup(const char *from,myf MyFlags); +extern char *my_strndup(const char *from, size_t length, + myf MyFlags); +extern uint my_get_large_page_size(void); +extern uchar * my_large_malloc(size_t size, myf my_flags); +extern void my_large_free(uchar * ptr, myf my_flags); +extern int errno; +extern char errbuff[(2)][(256)]; +extern char *home_dir; +extern const char *my_progname; +extern char curr_dir[]; +extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); +extern int (*fatal_error_handler_hook)(uint my_err, const char *str, + myf MyFlags); +extern uint my_file_limit; +extern ulong my_thread_stack_size; +extern my_bool my_use_large_pages; +extern uint my_large_page_size; +extern CHARSET_INFO *default_charset_info; +extern CHARSET_INFO *all_charsets[256]; +extern CHARSET_INFO compiled_charsets[]; +extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; +extern ulong my_file_total_opened; +extern uint mysys_usage_id; +extern my_bool my_init_done; +extern void (*my_sigtstp_cleanup)(void), + (*my_sigtstp_restart)(void), + (*my_abort_hook)(int); +extern int my_umask, + my_umask_dir, + my_recived_signals, + my_safe_to_handle_signal, + my_dont_interrupt; +extern my_bool mysys_uses_curses, my_use_symdir; +extern ulong sf_malloc_cur_memory, sf_malloc_max_memory; +extern ulong my_default_record_cache_size; +extern my_bool my_disable_locking, my_disable_async_io, + my_disable_flush_key_blocks, my_disable_symlinks; +extern char wild_many,wild_one,wild_prefix; +extern const char *charsets_dir; +extern char *my_defaults_extra_file; +extern const char *my_defaults_group_suffix; +extern const char *my_defaults_file; +extern my_bool timed_mutexes; +typedef struct wild_file_pack +{ + uint wilds; + uint not_pos; + char * *wild; +} WF_PACK; +enum loglevel { + ERROR_LEVEL, + WARNING_LEVEL, + INFORMATION_LEVEL +}; +enum cache_type +{ + TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE, + SEQ_READ_APPEND , + READ_FIFO, READ_NET,WRITE_NET}; +enum flush_type +{ + FLUSH_KEEP, + FLUSH_RELEASE, + FLUSH_IGNORE_CHANGED, + FLUSH_FORCE_WRITE +}; +typedef struct st_record_cache +{ + File file; + int rc_seek,error,inited; + uint rc_length,read_length,reclength; + my_off_t rc_record_pos,end_of_file; + uchar *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos; + enum cache_type type; +} RECORD_CACHE; +enum file_type +{ + UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN, + FILE_BY_MKSTEMP, FILE_BY_DUP +}; +struct st_my_file_info +{ + char * name; + enum file_type type; +}; +extern struct st_my_file_info *my_file_info; +typedef struct st_dynamic_array +{ + uchar *buffer; + uint elements,max_element; + uint alloc_increment; + uint size_of_element; +} DYNAMIC_ARRAY; +typedef struct st_my_tmpdir +{ + DYNAMIC_ARRAY full_list; + char **list; + uint cur, max; + pthread_mutex_t mutex; +} MY_TMPDIR; +typedef struct st_dynamic_string +{ + char *str; + size_t length,max_length,alloc_increment; +} DYNAMIC_STRING; +struct st_io_cache; +typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); +typedef struct st_io_cache_share +{ + pthread_mutex_t mutex; + pthread_cond_t cond; + pthread_cond_t cond_writer; + my_off_t pos_in_file; + struct st_io_cache *source_cache; + uchar *buffer; + uchar *read_end; + int running_threads; + int total_threads; + int error; +} IO_CACHE_SHARE; +typedef struct st_io_cache +{ + my_off_t pos_in_file; + my_off_t end_of_file; + uchar *read_pos; + uchar *read_end; + uchar *buffer; + uchar *request_pos; + uchar *write_buffer; + uchar *append_read_pos; + uchar *write_pos; + uchar *write_end; + uchar **current_pos, **current_end; + pthread_mutex_t append_buffer_lock; + IO_CACHE_SHARE *share; + int (*read_function)(struct st_io_cache *,uchar *,size_t); + int (*write_function)(struct st_io_cache *,const uchar *,size_t); + enum cache_type type; + IO_CACHE_CALLBACK pre_read; + IO_CACHE_CALLBACK post_read; + IO_CACHE_CALLBACK pre_close; + ulong disk_writes; + void* arg; + char *file_name; + char *dir,*prefix; + File file; + int seek_not_done,error; + size_t buffer_length; + size_t read_length; + myf myflags; + my_bool alloced_buffer; +} IO_CACHE; +typedef int (*qsort2_cmp)(const void *, const void *, const void *); +int my_b_copy_to_file(IO_CACHE *cache, FILE *file); +my_off_t my_b_append_tell(IO_CACHE* info); +my_off_t my_b_safe_tell(IO_CACHE* info); +typedef uint32 ha_checksum; +typedef int (*Process_option_func)(void *ctx, const char *group_name, + const char *option); +#include +extern int my_copy(const char *from,const char *to,myf MyFlags); +extern int my_append(const char *from,const char *to,myf MyFlags); +extern int my_delete(const char *name,myf MyFlags); +extern int my_getwd(char * buf,size_t size,myf MyFlags); +extern int my_setwd(const char *dir,myf MyFlags); +extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags); +extern void *my_once_alloc(size_t Size,myf MyFlags); +extern void my_once_free(void); +extern char *my_once_strdup(const char *src,myf myflags); +extern void *my_once_memdup(const void *src, size_t len, myf myflags); +extern File my_open(const char *FileName,int Flags,myf MyFlags); +extern File my_register_filename(File fd, const char *FileName, + enum file_type type_of_file, + uint error_message_number, myf MyFlags); +extern File my_create(const char *FileName,int CreateFlags, + int AccessFlags, myf MyFlags); +extern int my_close(File Filedes,myf MyFlags); +extern File my_dup(File file, myf MyFlags); +extern int my_mkdir(const char *dir, int Flags, myf MyFlags); +extern int my_readlink(char *to, const char *filename, myf MyFlags); +extern int my_realpath(char *to, const char *filename, myf MyFlags); +extern File my_create_with_symlink(const char *linkname, const char *filename, + int createflags, int access_flags, + myf MyFlags); +extern int my_delete_with_symlink(const char *name, myf MyFlags); +extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags); +extern int my_symlink(const char *content, const char *linkname, myf MyFlags); +extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags); +extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset, + myf MyFlags); +extern int my_rename(const char *from,const char *to,myf MyFlags); +extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags); +extern my_off_t my_tell(File fd,myf MyFlags); +extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count, + myf MyFlags); +extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count, + my_off_t offset,myf MyFlags); +extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags); +extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count, + myf MyFlags); +extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); +extern my_off_t my_ftell(FILE *stream,myf MyFlags); +extern void *_mymalloc(size_t uSize,const char *sFile, + uint uLine, myf MyFlag); +extern void *_myrealloc(void *pPtr,size_t uSize,const char *sFile, + uint uLine, myf MyFlag); +extern void * my_multi_malloc (myf MyFlags, ...); +extern void _myfree(void *pPtr,const char *sFile,uint uLine, myf MyFlag); +extern int _sanity(const char *sFile, uint uLine); +extern void *_my_memdup(const void *from, size_t length, + const char *sFile, uint uLine,myf MyFlag); +extern char * _my_strdup(const char *from, const char *sFile, uint uLine, + myf MyFlag); +extern char *_my_strndup(const char *from, size_t length, + const char *sFile, uint uLine, + myf MyFlag); +extern void *my_memmem(const void *haystack, size_t haystacklen, + const void *needle, size_t needlelen); +extern int check_if_legal_filename(const char *path); +extern int check_if_legal_tablename(const char *path); +extern void init_glob_errs(void); +extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); +extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); +extern int my_fclose(FILE *fd,myf MyFlags); +extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags); +extern int my_sync(File fd, myf my_flags); +extern int my_sync_dir(const char *dir_name, myf my_flags); +extern int my_sync_dir_by_file(const char *file_name, myf my_flags); +extern int my_error (int nr,myf MyFlags, ...); +extern int my_printf_error (uint my_err, const char *format, myf MyFlags, ...) + __attribute__((format(printf, 2, 4))); +extern int my_error_register(const char **errmsgs, int first, int last); +extern const char **my_error_unregister(int first, int last); +extern int my_message(uint my_err, const char *str,myf MyFlags); +extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags); +extern int my_message_curses(uint my_err, const char *str,myf MyFlags); +extern my_bool my_init(void); +extern void my_end(int infoflag); +extern int my_redel(const char *from, const char *to, int MyFlags); +extern int my_copystat(const char *from, const char *to, int MyFlags); +extern char * my_filename(File fd); +extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist); +extern char *my_tmpdir(MY_TMPDIR *tmpdir); +extern void free_tmpdir(MY_TMPDIR *tmpdir); +extern void my_remember_signal(int signal_number,void (*func)(int)); +extern size_t dirname_part(char * to,const char *name, size_t *to_res_length); +extern size_t dirname_length(const char *name); +extern int test_if_hard_path(const char *dir_name); +extern my_bool has_path(const char *name); +extern char *convert_dirname(char *to, const char *from, const char *from_end); +extern void to_unix_path(char * name); +extern char * fn_ext(const char *name); +extern char * fn_same(char * toname,const char *name,int flag); +extern char * fn_format(char * to,const char *name,const char *dir, + const char *form, uint flag); +extern size_t strlength(const char *str); +extern void pack_dirname(char * to,const char *from); +extern size_t unpack_dirname(char * to,const char *from); +extern size_t cleanup_dirname(char * to,const char *from); +extern size_t system_filename(char * to,const char *from); +extern size_t unpack_filename(char * to,const char *from); +extern char * intern_filename(char * to,const char *from); +extern char * directory_file_name(char * dst, const char *src); +extern int pack_filename(char * to, const char *name, size_t max_length); +extern char * my_path(char * to,const char *progname, + const char *own_pathname_part); +extern char * my_load_path(char * to, const char *path, + const char *own_path_prefix); +extern int wild_compare(const char *str,const char *wildstr, + pbool str_is_pattern); +extern WF_PACK *wf_comp(char * str); +extern int wf_test(struct wild_file_pack *wf_pack,const char *name); +extern void wf_end(struct wild_file_pack *buffer); +extern size_t strip_sp(char * str); +extern my_bool array_append_string_unique(const char *str, + const char **array, size_t size); +extern void get_date(char * to,int timeflag,time_t use_time); +extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr, + pbool remove_garbage); +extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file, + size_t reclength,enum cache_type type, + pbool use_async_io); +extern int read_cache_record(RECORD_CACHE *info,uchar *to); +extern int end_record_cache(RECORD_CACHE *info); +extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, + const uchar *record,size_t length); +extern int flush_write_cache(RECORD_CACHE *info); +extern long my_clock(void); +extern void sigtstp_handler(int signal_number); +extern void handle_recived_signals(void); +extern void my_set_alarm_variable(int signo); +extern void my_string_ptr_sort(uchar *base,uint items,size_t size); +extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, + size_t size_of_element,uchar *buffer[]); +extern void my_qsort(void *base_ptr, size_t total_elems, size_t size, + qsort_cmp cmp); +extern void my_qsort2(void *base_ptr, size_t total_elems, size_t size, + qsort2_cmp cmp, void *cmp_argument); +extern qsort2_cmp get_ptr_compare(size_t); +void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos); +my_off_t my_get_ptr(uchar *ptr, size_t pack_length); +extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize, + enum cache_type type,my_off_t seek_offset, + pbool use_async_io, myf cache_myflags); +extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, + my_off_t seek_offset,pbool use_async_io, + pbool clear_cache); +extern void setup_io_cache(IO_CACHE* info); +extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); +extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count); +extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, + IO_CACHE *write_cache, uint num_threads); +extern void remove_io_thread(IO_CACHE *info); +extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count); +extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count); +extern int _my_b_get(IO_CACHE *info); +extern int _my_b_async_read(IO_CACHE *info,uchar *Buffer,size_t Count); +extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count); +extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count); +extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count); +extern int my_block_write(IO_CACHE *info, const uchar *Buffer, + size_t Count, my_off_t pos); +extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock); +extern int end_io_cache(IO_CACHE *info); +extern size_t my_b_fill(IO_CACHE *info); +extern void my_b_seek(IO_CACHE *info,my_off_t pos); +extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length); +extern my_off_t my_b_filelength(IO_CACHE *info); +extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...); +extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap); +extern my_bool open_cached_file(IO_CACHE *cache,const char *dir, + const char *prefix, size_t cache_size, + myf cache_myflags); +extern my_bool real_open_cached_file(IO_CACHE *cache); +extern void close_cached_file(IO_CACHE *cache); +File create_temp_file(char *to, const char *dir, const char *pfx, + int mode, myf MyFlags); +extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size, + void *init_buffer, uint init_alloc, + uint alloc_increment + ); +extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, + uint init_alloc,uint alloc_increment + ); +extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element); +extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); +extern uchar *pop_dynamic(DYNAMIC_ARRAY*); +extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index); +extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements); +extern void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index); +extern void delete_dynamic(DYNAMIC_ARRAY *array); +extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); +extern void freeze_size(DYNAMIC_ARRAY *array); +extern int get_index_dynamic(DYNAMIC_ARRAY *array, uchar * element); +extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, + size_t init_alloc,size_t alloc_increment); +extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append); +my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, + size_t length); +extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, + ...); +extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); +extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size); +extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); +extern void dynstr_free(DYNAMIC_STRING *str); +extern void init_alloc_root(MEM_ROOT *mem_root, size_t block_size, + size_t pre_alloc_size); +extern void *alloc_root(MEM_ROOT *mem_root, size_t Size); +extern void *multi_alloc_root(MEM_ROOT *mem_root, ...); +extern void free_root(MEM_ROOT *root, myf MyFLAGS); +extern void set_prealloc_root(MEM_ROOT *root, char *ptr); +extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, + size_t prealloc_size); +extern char *strdup_root(MEM_ROOT *root,const char *str); +extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len); +extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len); +extern int get_defaults_options(int argc, char **argv, + char **defaults, char **extra_defaults, + char **group_suffix); +extern int load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv); +extern int modify_defaults_file(const char *file_location, const char *option, + const char *option_value, + const char *section_name, int remove_option); +extern int my_search_option_files(const char *conf_file, int *argc, + char ***argv, uint *args_used, + Process_option_func func, void *func_ctx); +extern void free_defaults(char **argv); +extern void my_print_default_files(const char *conf_file); +extern void print_defaults(const char *conf_file, const char **groups); +extern my_bool my_compress(uchar *, size_t *, size_t *); +extern my_bool my_uncompress(uchar *, size_t , size_t *); +extern uchar *my_compress_alloc(const uchar *packet, size_t *len, + size_t *complen); +extern int packfrm(uchar *, size_t, uchar **, size_t *); +extern int unpackfrm(uchar **, size_t *, const uchar *); +extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem, + size_t count); +extern void my_sleep(ulong m_seconds); +extern ulong crc32(ulong crc, const uchar *buf, uint len); +extern uint my_set_max_open_files(uint files); +void my_free_open_file_info(void); +extern time_t my_time(myf flags); +extern ulonglong my_getsystime(void); +extern ulonglong my_micro_time(); +extern ulonglong my_micro_time_and_time(time_t *time_arg); +time_t my_time_possible_from_micro(ulonglong microtime); +extern my_bool my_gethwaddr(uchar *to); +extern int my_getncpus(); +#include +int my_msync(int, void *, size_t, int); +extern uint get_charset_number(const char *cs_name, uint cs_flags); +extern uint get_collation_number(const char *name); +extern const char *get_charset_name(uint cs_number); +extern CHARSET_INFO *get_charset(uint cs_number, myf flags); +extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags); +extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, + uint cs_flags, myf my_flags); +extern my_bool resolve_charset(const char *cs_name, + CHARSET_INFO *default_cs, + CHARSET_INFO **cs); +extern my_bool resolve_collation(const char *cl_name, + CHARSET_INFO *default_cl, + CHARSET_INFO **cl); +extern void free_charsets(void); +extern char *get_charsets_dir(char *buf); +extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2); +extern my_bool init_compiled_charsets(myf flags); +extern void add_compiled_collation(CHARSET_INFO *cs); +extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info, + char *to, size_t to_length, + const char *from, size_t length); +extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, + char *to, size_t to_length, + const char *from, size_t length); +extern void thd_increment_bytes_sent(ulong length); +extern void thd_increment_bytes_received(ulong length); +extern void thd_increment_net_big_packet_count(ulong length); +#include +#include "my_global.h" +#include "mysql_time.h" +enum enum_mysql_timestamp_type +{ + MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, + MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 +}; +typedef struct st_mysql_time +{ + unsigned int year, month, day, hour, minute, second; + unsigned long second_part; + my_bool neg; + enum enum_mysql_timestamp_type time_type; +} MYSQL_TIME; +extern ulonglong log_10_int[20]; +extern uchar days_in_month[]; +typedef long my_time_t; +my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, + ulong flags, int *was_cut); +enum enum_mysql_timestamp_type +str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, + uint flags, int *was_cut); +longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, + uint flags, int *was_cut); +ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *); +ulonglong TIME_to_ulonglong(const MYSQL_TIME *); +my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, + int *warning); +int check_time_range(struct st_mysql_time *, int *warning); +long calc_daynr(uint year,uint month,uint day); +uint calc_days_in_year(uint year); +uint year_2000_handling(uint year); +void my_init_time(void); +static inline my_bool validate_timestamp_range(const MYSQL_TIME *t) +{ + if ((t->year > 2038 || t->year < (1900 + 70 - 1)) || + (t->year == 2038 && (t->month > 1 || t->day > 19)) || + (t->year == (1900 + 70 - 1) && (t->month < 12 || t->day < 31))) + return (0); + return (1); +} +my_time_t +my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, + my_bool *in_dst_time_gap); +void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); +int my_time_to_str(const MYSQL_TIME *l_time, char *to); +int my_date_to_str(const MYSQL_TIME *l_time, char *to); +int my_datetime_to_str(const MYSQL_TIME *l_time, char *to); +int my_TIME_to_str(const MYSQL_TIME *l_time, char *to); +enum interval_type +{ + INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_WEEK, INTERVAL_DAY, + INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND, INTERVAL_MICROSECOND, + INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE, + INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND, + INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND, + INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND, INTERVAL_LAST +}; +#include +#include +#include +#include +#include +#include +extern void *(*my_str_malloc)(size_t); +extern void (*my_str_free)(void *); +extern char *stpcpy(char *, const char *); +extern char _dig_vec_upper[]; +extern char _dig_vec_lower[]; +extern const double log_10[309]; +extern void bmove512(uchar *dst,const uchar *src,size_t len); +extern void bmove_upp(uchar *dst,const uchar *src,size_t len); +extern void bchange(uchar *dst,size_t old_len,const uchar *src, + size_t new_len,size_t tot_len); +extern void strappend(char *s,size_t len,pchar fill); +extern char *strend(const char *s); +extern char *strcend(const char *, pchar); +extern char *strfield(char *src,int fields,int chars,int blanks, + int tabch); +extern char *strfill(char * s,size_t len,pchar fill); +extern size_t strinstr(const char *str,const char *search); +extern size_t r_strinstr(const char *str, size_t from, const char *search); +extern char *strkey(char *dst,char *head,char *tail,char *flags); +extern char *strmake(char *dst,const char *src,size_t length); +extern char *strnmov(char *dst,const char *src,size_t n); +extern char *strsuff(const char *src,const char *suffix); +extern char *strcont(const char *src,const char *set); +extern char *strxcat (char *dst,const char *src, ...); +extern char *strxmov (char *dst,const char *src, ...); +extern char *strxcpy (char *dst,const char *src, ...); +extern char *strxncat (char *dst,size_t len, const char *src, ...); +extern char *strxnmov (char *dst,size_t len, const char *src, ...); +extern char *strxncpy (char *dst,size_t len, const char *src, ...); +extern int is_prefix(const char *, const char *); +double my_strtod(const char *str, char **end, int *error); +double my_atof(const char *nptr); +extern char *llstr(longlong value,char *buff); +extern char *ullstr(longlong value,char *buff); +extern char *int2str(long val, char *dst, int radix, int upcase); +extern char *int10_to_str(long val,char *dst,int radix); +extern char *str2int(const char *src,int radix,long lower,long upper, + long *val); +longlong my_strtoll10(const char *nptr, char **endptr, int *error); +extern char *longlong2str(longlong val,char *dst,int radix); +extern char *longlong10_to_str(longlong val,char *dst,int radix); +extern size_t my_vsnprintf(char *str, size_t n, + const char *format, va_list ap); +extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...) + __attribute__((format(printf, 3, 4))); +struct st_mysql_lex_string +{ + char *str; + size_t length; +}; +typedef struct st_mysql_lex_string LEX_STRING; +#include +typedef uchar *(*hash_get_key)(const uchar *,size_t*,my_bool); +typedef void (*hash_free_key)(void *); +typedef struct st_hash { + size_t key_offset,key_length; + size_t blength; + ulong records; + uint flags; + DYNAMIC_ARRAY array; + hash_get_key get_key; + void (*free)(void *); + CHARSET_INFO *charset; +} HASH; +typedef uint HASH_SEARCH_STATE; +my_bool _hash_init(HASH *hash, uint growth_size,CHARSET_INFO *charset, + ulong default_array_elements, size_t key_offset, + size_t key_length, hash_get_key get_key, + void (*free_element)(void*), uint flags ); +void hash_free(HASH *tree); +void my_hash_reset(HASH *hash); +uchar *hash_element(HASH *hash,ulong idx); +uchar *hash_search(const HASH *info, const uchar *key, size_t length); +uchar *hash_first(const HASH *info, const uchar *key, size_t length, + HASH_SEARCH_STATE *state); +uchar *hash_next(const HASH *info, const uchar *key, size_t length, + HASH_SEARCH_STATE *state); +my_bool my_hash_insert(HASH *info,const uchar *data); +my_bool hash_delete(HASH *hash,uchar *record); +my_bool hash_update(HASH *hash,uchar *record,uchar *old_key,size_t old_key_length); +void hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row); +my_bool hash_check(HASH *hash); +#include +#include +#include +#include +typedef struct st_list { + struct st_list *prev,*next; + void *data; +} LIST; +typedef int (*list_walk_action)(void *,void *); +extern LIST *list_add(LIST *root,LIST *element); +extern LIST *list_delete(LIST *root,LIST *element); +extern LIST *list_cons(void *data,LIST *root); +extern LIST *list_reverse(LIST *root); +extern void list_free(LIST *root,unsigned int free_data); +extern unsigned int list_length(LIST *); +extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); +struct st_thr_lock; +extern ulong locks_immediate,locks_waited ; +enum thr_lock_type { TL_IGNORE=-1, + TL_UNLOCK, + TL_READ, + TL_READ_WITH_SHARED_LOCKS, + TL_READ_HIGH_PRIORITY, + TL_READ_NO_INSERT, + TL_WRITE_ALLOW_WRITE, + TL_WRITE_ALLOW_READ, + TL_WRITE_CONCURRENT_INSERT, + TL_WRITE_DELAYED, + TL_WRITE_DEFAULT, + TL_WRITE_LOW_PRIORITY, + TL_WRITE, + TL_WRITE_ONLY}; +enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1, + THR_LOCK_WAIT_TIMEOUT= 2, THR_LOCK_DEADLOCK= 3 }; +extern ulong max_write_lock_count; +extern ulong table_lock_wait_timeout; +extern my_bool thr_lock_inited; +extern enum thr_lock_type thr_upgraded_concurrent_insert_lock; +typedef struct st_thr_lock_info +{ + pthread_t thread; + my_thread_id thread_id; + ulong n_cursors; +} THR_LOCK_INFO; +typedef struct st_thr_lock_owner +{ + THR_LOCK_INFO *info; +} THR_LOCK_OWNER; +typedef struct st_thr_lock_data { + THR_LOCK_OWNER *owner; + struct st_thr_lock_data *next,**prev; + struct st_thr_lock *lock; + pthread_cond_t *cond; + enum thr_lock_type type; + void *status_param; + void *debug_print_param; +} THR_LOCK_DATA; +struct st_lock_list { + THR_LOCK_DATA *data,**last; +}; +typedef struct st_thr_lock { + LIST list; + pthread_mutex_t mutex; + struct st_lock_list read_wait; + struct st_lock_list read; + struct st_lock_list write_wait; + struct st_lock_list write; + ulong write_lock_count; + uint read_no_write_count; + void (*get_status)(void*, int); + void (*copy_status)(void*,void*); + void (*update_status)(void*); + void (*restore_status)(void*); + my_bool (*check_status)(void *); +} THR_LOCK; +extern LIST *thr_lock_thread_list; +extern pthread_mutex_t THR_LOCK_lock; +my_bool init_thr_lock(void); +void thr_lock_info_init(THR_LOCK_INFO *info); +void thr_lock_init(THR_LOCK *lock); +void thr_lock_delete(THR_LOCK *lock); +void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, + void *status_param); +enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data, + THR_LOCK_OWNER *owner, + enum thr_lock_type lock_type); +void thr_unlock(THR_LOCK_DATA *data); +enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data, + uint count, THR_LOCK_OWNER *owner); +void thr_multi_unlock(THR_LOCK_DATA **data,uint count); +void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock); +my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread); +void thr_print_locks(void); +my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data); +void thr_downgrade_write_lock(THR_LOCK_DATA *data, + enum thr_lock_type new_lock_type); +my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data); +#include +#include +#include +#include +typedef struct fileinfo +{ + char *name; + struct stat *mystat; +} FILEINFO; +typedef struct st_my_dir +{ + struct fileinfo *dir_entry; + uint number_off_files; +} MY_DIR; +extern MY_DIR *my_dir(const char *path,myf MyFlags); +extern void my_dirend(MY_DIR *buffer); +extern struct stat *my_stat(const char *path, struct stat *stat_area, myf my_flags); +extern int my_fstat(int filenr, struct stat *stat_area, myf MyFlags); +#include +#include +#include +#include +enum ha_rkey_function { + HA_READ_KEY_EXACT, + HA_READ_KEY_OR_NEXT, + HA_READ_KEY_OR_PREV, + HA_READ_AFTER_KEY, + HA_READ_BEFORE_KEY, + HA_READ_PREFIX, + HA_READ_PREFIX_LAST, + HA_READ_PREFIX_LAST_OR_PREV, + HA_READ_MBR_CONTAIN, + HA_READ_MBR_INTERSECT, + HA_READ_MBR_WITHIN, + HA_READ_MBR_DISJOINT, + HA_READ_MBR_EQUAL +}; +enum ha_key_alg { + HA_KEY_ALG_UNDEF= 0, + HA_KEY_ALG_BTREE= 1, + HA_KEY_ALG_RTREE= 2, + HA_KEY_ALG_HASH= 3, + HA_KEY_ALG_FULLTEXT= 4 +}; +enum ha_storage_media { + HA_SM_DEFAULT= 0, + HA_SM_DISK= 1, + HA_SM_MEMORY= 2 +}; +enum ha_extra_function { + HA_EXTRA_NORMAL=0, + HA_EXTRA_QUICK=1, + HA_EXTRA_NOT_USED=2, + HA_EXTRA_CACHE=3, + HA_EXTRA_NO_CACHE=4, + HA_EXTRA_NO_READCHECK=5, + HA_EXTRA_READCHECK=6, + HA_EXTRA_KEYREAD=7, + HA_EXTRA_NO_KEYREAD=8, + HA_EXTRA_NO_USER_CHANGE=9, + HA_EXTRA_KEY_CACHE=10, + HA_EXTRA_NO_KEY_CACHE=11, + HA_EXTRA_WAIT_LOCK=12, + HA_EXTRA_NO_WAIT_LOCK=13, + HA_EXTRA_WRITE_CACHE=14, + HA_EXTRA_FLUSH_CACHE=15, + HA_EXTRA_NO_KEYS=16, + HA_EXTRA_KEYREAD_CHANGE_POS=17, + HA_EXTRA_REMEMBER_POS=18, + HA_EXTRA_RESTORE_POS=19, + HA_EXTRA_REINIT_CACHE=20, + HA_EXTRA_FORCE_REOPEN=21, + HA_EXTRA_FLUSH, + HA_EXTRA_NO_ROWS, + HA_EXTRA_RESET_STATE, + HA_EXTRA_IGNORE_DUP_KEY, + HA_EXTRA_NO_IGNORE_DUP_KEY, + HA_EXTRA_PREPARE_FOR_DROP, + HA_EXTRA_PREPARE_FOR_UPDATE, + HA_EXTRA_PRELOAD_BUFFER_SIZE, + HA_EXTRA_CHANGE_KEY_TO_UNIQUE, + HA_EXTRA_CHANGE_KEY_TO_DUP, + HA_EXTRA_KEYREAD_PRESERVE_FIELDS, + HA_EXTRA_MMAP, + HA_EXTRA_IGNORE_NO_KEY, + HA_EXTRA_NO_IGNORE_NO_KEY, + HA_EXTRA_MARK_AS_LOG_TABLE, + HA_EXTRA_WRITE_CAN_REPLACE, + HA_EXTRA_WRITE_CANNOT_REPLACE, + HA_EXTRA_DELETE_CANNOT_BATCH, + HA_EXTRA_UPDATE_CANNOT_BATCH, + HA_EXTRA_INSERT_WITH_UPDATE, + HA_EXTRA_PREPARE_FOR_RENAME, + HA_EXTRA_ATTACH_CHILDREN, + HA_EXTRA_DETACH_CHILDREN +}; +enum ha_panic_function { + HA_PANIC_CLOSE, + HA_PANIC_WRITE, + HA_PANIC_READ +}; +enum ha_base_keytype { + HA_KEYTYPE_END=0, + HA_KEYTYPE_TEXT=1, + HA_KEYTYPE_BINARY=2, + HA_KEYTYPE_SHORT_INT=3, + HA_KEYTYPE_LONG_INT=4, + HA_KEYTYPE_FLOAT=5, + HA_KEYTYPE_DOUBLE=6, + HA_KEYTYPE_NUM=7, + HA_KEYTYPE_USHORT_INT=8, + HA_KEYTYPE_ULONG_INT=9, + HA_KEYTYPE_LONGLONG=10, + HA_KEYTYPE_ULONGLONG=11, + HA_KEYTYPE_INT24=12, + HA_KEYTYPE_UINT24=13, + HA_KEYTYPE_INT8=14, + HA_KEYTYPE_VARTEXT1=15, + HA_KEYTYPE_VARBINARY1=16, + HA_KEYTYPE_VARTEXT2=17, + HA_KEYTYPE_VARBINARY2=18, + HA_KEYTYPE_BIT=19 +}; +typedef ulong key_part_map; +enum en_fieldtype { + FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE, + FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO, + FIELD_VARCHAR,FIELD_CHECK, + FIELD_enum_val_count +}; +enum data_file_type { + STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD +}; +typedef struct st_key_range +{ + const uchar *key; + uint length; + key_part_map keypart_map; + enum ha_rkey_function flag; +} key_range; +typedef struct st_key_multi_range +{ + key_range start_key; + key_range end_key; + char *ptr; + uint range_flag; +} KEY_MULTI_RANGE; +typedef my_off_t ha_rows; +typedef void (* invalidator_by_filename)(const char * filename); +#include +typedef struct st_queue { + uchar **root; + void *first_cmp_arg; + uint elements; + uint max_elements; + uint offset_to_key; + int max_at_top; + int (*compare)(void *, uchar *,uchar *); + uint auto_extent; +} QUEUE; +typedef int (*queue_compare)(void *,uchar *, uchar *); +int init_queue(QUEUE *queue,uint max_elements,uint offset_to_key, + pbool max_at_top, queue_compare compare, + void *first_cmp_arg); +int init_queue_ex(QUEUE *queue,uint max_elements,uint offset_to_key, + pbool max_at_top, queue_compare compare, + void *first_cmp_arg, uint auto_extent); +int reinit_queue(QUEUE *queue,uint max_elements,uint offset_to_key, + pbool max_at_top, queue_compare compare, + void *first_cmp_arg); +int resize_queue(QUEUE *queue, uint max_elements); +void delete_queue(QUEUE *queue); +void queue_insert(QUEUE *queue,uchar *element); +int queue_insert_safe(QUEUE *queue, uchar *element); +uchar *queue_remove(QUEUE *queue,uint idx); +void _downheap(QUEUE *queue,uint idx); +void queue_fix(QUEUE *queue); +#include "sql_bitmap.h" +#include +#include +typedef uint32 my_bitmap_map; +typedef struct st_bitmap +{ + my_bitmap_map *bitmap; + uint n_bits; + my_bitmap_map last_word_mask; + my_bitmap_map *last_word_ptr; + pthread_mutex_t *mutex; +} MY_BITMAP; +extern void create_last_word_mask(MY_BITMAP *map); +extern my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, + my_bool thread_safe); +extern my_bool bitmap_is_clear_all(const MY_BITMAP *map); +extern my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size); +extern my_bool bitmap_is_set_all(const MY_BITMAP *map); +extern my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2); +extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1, + const MY_BITMAP *map2); +extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit); +extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit); +extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit); +extern uint bitmap_set_next(MY_BITMAP *map); +extern uint bitmap_get_first(const MY_BITMAP *map); +extern uint bitmap_get_first_set(const MY_BITMAP *map); +extern uint bitmap_bits_set(const MY_BITMAP *map); +extern void bitmap_free(MY_BITMAP *map); +extern void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit); +extern void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size); +extern void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2); +extern void bitmap_invert(MY_BITMAP *map); +extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2); +extern uint bitmap_lock_set_next(MY_BITMAP *map); +extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit); +static inline void +bitmap_set_bit(MY_BITMAP *map,uint bit) +{ + assert(bit < (map)->n_bits); + (((uchar*)(map)->bitmap)[(bit) / 8] |= (1 << ((bit) & 7))); +} +static inline void +bitmap_flip_bit(MY_BITMAP *map,uint bit) +{ + assert(bit < (map)->n_bits); + (((uchar*)(map)->bitmap)[(bit) / 8] ^= (1 << ((bit) & 7))); +} +static inline void +bitmap_clear_bit(MY_BITMAP *map,uint bit) +{ + assert(bit < (map)->n_bits); + (((uchar*)(map)->bitmap)[(bit) / 8] &= ~ (1 << ((bit) & 7))); +} +static inline uint +bitmap_is_set(const MY_BITMAP *map,uint bit) +{ + assert(bit < (map)->n_bits); + return (uint) (((uchar*)(map)->bitmap)[(bit) / 8] & (1 << ((bit) & 7))); +} +static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) +{ + *(map1)->last_word_ptr|= (map1)->last_word_mask; + *(map2)->last_word_ptr|= (map2)->last_word_mask; + return memcmp((map1)->bitmap, (map2)->bitmap, 4*((((map1))->n_bits + 31)/32))==0; +} +template class Bitmap +{ + MY_BITMAP map; + uint32 buffer[(default_width+31)/32]; +public: + Bitmap() { init(); } + Bitmap(const Bitmap& from) { *this=from; } + explicit Bitmap(uint prefix_to_set) { init(prefix_to_set); } + void init() { bitmap_init(&map, buffer, default_width, 0); } + void init(uint prefix_to_set) { init(); set_prefix(prefix_to_set); } + uint length() const { return default_width; } + Bitmap& operator=(const Bitmap& map2) + { + init(); + memcpy(buffer, map2.buffer, sizeof(buffer)); + return *this; + } + void set_bit(uint n) { bitmap_set_bit(&map, n); } + void clear_bit(uint n) { bitmap_clear_bit(&map, n); } + void set_prefix(uint n) { bitmap_set_prefix(&map, n); } + void set_all() { (memset((&map)->bitmap, 0xFF, 4*((((&map))->n_bits + 31)/32))); } + void clear_all() { { memset((&map)->bitmap, 0, 4*((((&map))->n_bits + 31)/32)); }; } + void intersect(Bitmap& map2) { bitmap_intersect(&map, &map2.map); } + void intersect(ulonglong map2buff) + { + MY_BITMAP map2; + bitmap_init(&map2, (uint32 *)&map2buff, sizeof(ulonglong)*8, 0); + bitmap_intersect(&map, &map2); + } + void intersect_extended(ulonglong map2buff) + { + intersect(map2buff); + if (map.n_bits > sizeof(ulonglong) * 8) + bitmap_set_above(&map, sizeof(ulonglong), + ((map2buff & (1LL << (sizeof(ulonglong) * 8 - 1))) ? 1 : 0)); + } + void subtract(Bitmap& map2) { bitmap_subtract(&map, &map2.map); } + void merge(Bitmap& map2) { bitmap_union(&map, &map2.map); } + my_bool is_set(uint n) const { return bitmap_is_set(&map, n); } + my_bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); } + my_bool is_clear_all() const { return bitmap_is_clear_all(&map); } + my_bool is_set_all() const { return bitmap_is_set_all(&map); } + my_bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); } + my_bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); } + my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); } + char *print(char *buf) const + { + char *s=buf; + const uchar *e=(uchar *)buffer, *b=e+sizeof(buffer)-1; + while (!*b && b>e) + b--; + if ((*s=_dig_vec_upper[*b >> 4]) != '0') + s++; + *s++=_dig_vec_upper[*b & 15]; + while (--b>=e) + { + *s++=_dig_vec_upper[*b >> 4]; + *s++=_dig_vec_upper[*b & 15]; + } + *s=0; + return buf; + } + ulonglong to_ulonglong() const + { + if (sizeof(buffer) >= 8) + return (*((ulonglong *) (buffer))); + assert(sizeof(buffer) >= 4); + return (ulonglong) (*((uint32 *) (buffer))); + } +}; +template <> class Bitmap<64> +{ + ulonglong map; +public: + Bitmap<64>() { } + explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); } + void init() { } + void init(uint prefix_to_set) { set_prefix(prefix_to_set); } + uint length() const { return 64; } + void set_bit(uint n) { map|= ((ulonglong)1) << n; } + void clear_bit(uint n) { map&= ~(((ulonglong)1) << n); } + void set_prefix(uint n) + { + if (n >= length()) + set_all(); + else + map= (((ulonglong)1) << n)-1; + } + void set_all() { map=~(ulonglong)0; } + void clear_all() { map=(ulonglong)0; } + void intersect(Bitmap<64>& map2) { map&= map2.map; } + void intersect(ulonglong map2) { map&= map2; } + void intersect_extended(ulonglong map2) { map&= map2; } + void subtract(Bitmap<64>& map2) { map&= ~map2.map; } + void merge(Bitmap<64>& map2) { map|= map2.map; } + my_bool is_set(uint n) const { return ((map & (((ulonglong)1) << n)) ? 1 : 0); } + my_bool is_prefix(uint n) const { return map == (((ulonglong)1) << n)-1; } + my_bool is_clear_all() const { return map == (ulonglong)0; } + my_bool is_set_all() const { return map == ~(ulonglong)0; } + my_bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); } + my_bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; } + my_bool operator==(const Bitmap<64>& map2) const { return map == map2.map; } + char *print(char *buf) const { longlong2str(map,buf,16); return buf; } + ulonglong to_ulonglong() const { return map; } +}; +#include "sql_array.h" +#include +template class Dynamic_array +{ + DYNAMIC_ARRAY array; +public: + Dynamic_array(uint prealloc=16, uint increment=16) + { + init_dynamic_array2(&array,sizeof(Elem),NULL,prealloc,increment ); + } + Elem& at(int idx) + { + return *(((Elem*)array.buffer) + idx); + } + Elem *front() + { + return (Elem*)array.buffer; + } + Elem *back() + { + return ((Elem*)array.buffer) + array.elements; + } + In_C_you_should_use_my_bool_instead() append(Elem &el) + { + return (insert_dynamic(&array, (uchar*)&el)); + } + int elements() + { + return array.elements; + } + ~Dynamic_array() + { + delete_dynamic(&array); + } + typedef int (*CMP_FUNC)(const Elem *el1, const Elem *el2); + void sort(CMP_FUNC cmp_func) + { + my_qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func); + } +}; +#include "sql_plugin.h" +class sys_var; +#include +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_xid { + long formatID; + long gtrid_length; + long bqual_length; + char data[128]; +}; +typedef struct st_mysql_xid MYSQL_XID; +enum enum_mysql_show_type +{ + SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, + SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, + SHOW_ARRAY, SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG, SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_LONG_NOFLUSH, SHOW_LONGLONG_STATUS, SHOW_DOUBLE +}; +struct st_mysql_show_var { + const char *name; + char *value; + enum enum_mysql_show_type type; +}; +typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *); +struct st_mysql_sys_var; +struct st_mysql_value; +typedef int (*mysql_var_check_func)(void* thd, + struct st_mysql_sys_var *var, + void *save, struct st_mysql_value *value); +typedef void (*mysql_var_update_func)(void* thd, + struct st_mysql_sys_var *var, + void *var_ptr, const void *save); +struct st_mysql_plugin +{ + int type; + void *info; + const char *name; + const char *author; + const char *descr; + int license; + int (*init)(void *); + int (*deinit)(void *); + unsigned int version; + struct st_mysql_show_var *status_vars; + struct st_mysql_sys_var **system_vars; + void * __reserved1; +}; +enum enum_ftparser_mode +{ + MYSQL_FTPARSER_SIMPLE_MODE= 0, + MYSQL_FTPARSER_WITH_STOPWORDS= 1, + MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 +}; +enum enum_ft_token_type +{ + FT_TOKEN_EOF= 0, + FT_TOKEN_WORD= 1, + FT_TOKEN_LEFT_PAREN= 2, + FT_TOKEN_RIGHT_PAREN= 3, + FT_TOKEN_STOPWORD= 4 +}; +typedef struct st_mysql_ftparser_boolean_info +{ + enum enum_ft_token_type type; + int yesno; + int weight_adjust; + char wasign; + char trunc; + char prev; + char *quot; +} MYSQL_FTPARSER_BOOLEAN_INFO; +typedef struct st_mysql_ftparser_param +{ + int (*mysql_parse)(struct st_mysql_ftparser_param *, + char *doc, int doc_len); + int (*mysql_add_word)(struct st_mysql_ftparser_param *, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); + void *ftparser_state; + void *mysql_ftparam; + struct charset_info_st *cs; + char *doc; + int length; + int flags; + enum enum_ftparser_mode mode; +} MYSQL_FTPARSER_PARAM; +struct st_mysql_ftparser +{ + int interface_version; + int (*parse)(MYSQL_FTPARSER_PARAM *param); + int (*init)(MYSQL_FTPARSER_PARAM *param); + int (*deinit)(MYSQL_FTPARSER_PARAM *param); +}; +struct st_mysql_storage_engine +{ + int interface_version; +}; +struct handlerton; +struct st_mysql_daemon +{ + int interface_version; +}; +struct st_mysql_information_schema +{ + int interface_version; +}; +struct st_mysql_value +{ + int (*value_type)(struct st_mysql_value *); + const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); + int (*val_real)(struct st_mysql_value *, double *realbuf); + int (*val_int)(struct st_mysql_value *, long long *intbuf); +}; +int thd_in_lock_tables(const void* thd); +int thd_tablespace_op(const void* thd); +long long thd_test_options(const void* thd, long long test_options); +int thd_sql_command(const void* thd); +const char *thd_proc_info(void* thd, const char *info); +void **thd_ha_data(const void* thd, const struct handlerton *hton); +int thd_tx_isolation(const void* thd); +char *thd_security_context(void* thd, char *buffer, unsigned int length, + unsigned int max_query_len); +void thd_inc_row_count(void* thd); +int mysql_tmpfile(const char *prefix); +int thd_killed(const void* thd); +unsigned long thd_get_thread_id(const void* thd); +void *thd_alloc(void* thd, unsigned int size); +void *thd_calloc(void* thd, unsigned int size); +char *thd_strdup(void* thd, const char *str); +char *thd_strmake(void* thd, const char *str, unsigned int size); +void *thd_memdup(void* thd, const void* str, unsigned int size); +MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); +void thd_get_xid(const void* thd, MYSQL_XID *xid); +void mysql_query_cache_invalidate4(void* thd, + const char *key, unsigned int key_length, + int using_trx); +typedef enum enum_mysql_show_type SHOW_TYPE; +typedef struct st_mysql_show_var SHOW_VAR; +struct st_plugin_dl +{ + LEX_STRING dl; + void *handle; + struct st_mysql_plugin *plugins; + int version; + uint ref_count; +}; +struct st_plugin_int +{ + LEX_STRING name; + struct st_mysql_plugin *plugin; + struct st_plugin_dl *plugin_dl; + uint state; + uint ref_count; + void *data; + MEM_ROOT mem_root; + sys_var *system_vars; +}; +typedef struct st_plugin_int **plugin_ref; +typedef int (*plugin_type_init)(struct st_plugin_int *); +extern char *opt_plugin_load; +extern char *opt_plugin_dir_ptr; +extern char opt_plugin_dir[512]; +extern const LEX_STRING plugin_type_names[]; +extern int plugin_init(int *argc, char **argv, int init_flags); +extern void plugin_shutdown(void); +extern void my_print_help_inc_plugins(struct my_option *options, uint size); +extern In_C_you_should_use_my_bool_instead() plugin_is_ready(const LEX_STRING *name, int type); +extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr ); +extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, + int type ); +extern void plugin_unlock(THD *thd, plugin_ref plugin); +extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count); +extern In_C_you_should_use_my_bool_instead() mysql_install_plugin(THD *thd, const LEX_STRING *name, + const LEX_STRING *dl); +extern In_C_you_should_use_my_bool_instead() mysql_uninstall_plugin(THD *thd, const LEX_STRING *name); +extern In_C_you_should_use_my_bool_instead() plugin_register_builtin(struct st_mysql_plugin *plugin); +extern void plugin_thdvar_init(THD *thd); +extern void plugin_thdvar_cleanup(THD *thd); +typedef my_bool (plugin_foreach_func)(THD *thd, + plugin_ref plugin, + void *arg); +extern In_C_you_should_use_my_bool_instead() plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func, + int type, uint state_mask, void *arg); +#include "scheduler.h" +class THD; +class scheduler_functions +{ +public: + uint max_threads; + In_C_you_should_use_my_bool_instead() (*init)(void); + In_C_you_should_use_my_bool_instead() (*init_new_connection_thread)(void); + void (*add_connection)(THD *thd); + void (*post_kill_notification)(THD *thd); + In_C_you_should_use_my_bool_instead() (*end_thread)(THD *thd, In_C_you_should_use_my_bool_instead() cache_thread); + void (*end)(void); + scheduler_functions(); +}; +enum scheduler_types +{ + SCHEDULER_ONE_THREAD_PER_CONNECTION=0, + SCHEDULER_NO_THREADS, + SCHEDULER_POOL_OF_THREADS +}; +void one_thread_per_connection_scheduler(scheduler_functions* func); +void one_thread_scheduler(scheduler_functions* func); +enum pool_command_op +{ + NOT_IN_USE_OP= 0, NORMAL_OP= 1, CONNECT_OP, KILL_OP, DIE_OP +}; +class thd_scheduler +{}; +enum enum_query_type +{ + QT_ORDINARY, + QT_IS +}; +typedef ulonglong table_map; +typedef Bitmap<64> key_map; +typedef ulong nesting_map; +typedef ulonglong nested_join_map; +typedef ulonglong query_id_t; +extern query_id_t global_query_id; +inline query_id_t next_query_id() { return global_query_id++; } +extern const key_map key_map_empty; +extern key_map key_map_full; +extern const char *primary_key_name; +#include "mysql_com.h" +enum enum_server_command +{ + COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, + COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, + COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, + COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, + COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, + COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, + COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, + COM_END +}; +struct st_vio; +typedef struct st_vio Vio; +typedef struct st_net { + Vio *vio; + unsigned char *buff,*buff_end,*write_pos,*read_pos; + my_socket fd; + unsigned long remain_in_buf,length, buf_length, where_b; + unsigned long max_packet,max_packet_size; + unsigned int pkt_nr,compress_pkt_nr; + unsigned int write_timeout, read_timeout, retry_count; + int fcntl; + unsigned int *return_status; + unsigned char reading_or_writing; + char save_char; + my_bool unused0; + my_bool unused; + my_bool compress; + my_bool unused1; + unsigned char *query_cache_query; + unsigned int last_errno; + unsigned char error; + my_bool unused2; + my_bool return_errno; + char last_error[512]; + char sqlstate[5 +1]; + void *extension; +} NET; +enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, + MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, + MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE, + MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, + MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24, + MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, + MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR, + MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR, + MYSQL_TYPE_BIT, + MYSQL_TYPE_NEWDECIMAL=246, + MYSQL_TYPE_ENUM=247, + MYSQL_TYPE_SET=248, + MYSQL_TYPE_TINY_BLOB=249, + MYSQL_TYPE_MEDIUM_BLOB=250, + MYSQL_TYPE_LONG_BLOB=251, + MYSQL_TYPE_BLOB=252, + MYSQL_TYPE_VAR_STRING=253, + MYSQL_TYPE_STRING=254, + MYSQL_TYPE_GEOMETRY=255 +}; +enum mysql_enum_shutdown_level { + SHUTDOWN_DEFAULT = 0, + SHUTDOWN_WAIT_CONNECTIONS= (unsigned char)(1 << 0), + SHUTDOWN_WAIT_TRANSACTIONS= (unsigned char)(1 << 1), + SHUTDOWN_WAIT_UPDATES= (unsigned char)(1 << 3), + SHUTDOWN_WAIT_ALL_BUFFERS= ((unsigned char)(1 << 3) << 1), + SHUTDOWN_WAIT_CRITICAL_BUFFERS= ((unsigned char)(1 << 3) << 1) + 1, + KILL_QUERY= 254, + KILL_CONNECTION= 255 +}; +enum enum_cursor_type +{ + CURSOR_TYPE_NO_CURSOR= 0, + CURSOR_TYPE_READ_ONLY= 1, + CURSOR_TYPE_FOR_UPDATE= 2, + CURSOR_TYPE_SCROLLABLE= 4 +}; +enum enum_mysql_set_option +{ + MYSQL_OPTION_MULTI_STATEMENTS_ON, + MYSQL_OPTION_MULTI_STATEMENTS_OFF +}; +my_bool my_net_init(NET *net, Vio* vio); +void my_net_local_init(NET *net); +void net_end(NET *net); + void net_clear(NET *net, my_bool clear_buffer); +my_bool net_realloc(NET *net, size_t length); +my_bool net_flush(NET *net); +my_bool my_net_write(NET *net,const unsigned char *packet, size_t len); +my_bool net_write_command(NET *net,unsigned char command, + const unsigned char *header, size_t head_len, + const unsigned char *packet, size_t len); +int net_real_write(NET *net,const unsigned char *packet, size_t len); +unsigned long my_net_read(NET *net); +void my_net_set_write_timeout(NET *net, uint timeout); +void my_net_set_read_timeout(NET *net, uint timeout); +struct sockaddr; +int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, + unsigned int timeout); +struct rand_struct { + unsigned long seed1,seed2,max_value; + double max_value_dbl; +}; +enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, + DECIMAL_RESULT}; +typedef struct st_udf_args +{ + unsigned int arg_count; + enum Item_result *arg_type; + char **args; + unsigned long *lengths; + char *maybe_null; + char **attributes; + unsigned long *attribute_lengths; + void *extension; +} UDF_ARGS; +typedef struct st_udf_init +{ + my_bool maybe_null; + unsigned int decimals; + unsigned long max_length; + char *ptr; + my_bool const_item; + void *extension; +} UDF_INIT; +void randominit(struct rand_struct *, unsigned long seed1, + unsigned long seed2); +double my_rnd(struct rand_struct *); +void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st); +void hash_password(unsigned long *to, const char *password, unsigned int password_len); +void make_scrambled_password_323(char *to, const char *password); +void scramble_323(char *to, const char *message, const char *password); +my_bool check_scramble_323(const char *, const char *message, + unsigned long *salt); +void get_salt_from_password_323(unsigned long *res, const char *password); +void make_password_from_salt_323(char *to, const unsigned long *salt); +void make_scrambled_password(char *to, const char *password); +void scramble(char *to, const char *message, const char *password); +my_bool check_scramble(const char *reply, const char *message, + const unsigned char *hash_stage2); +void get_salt_from_password(unsigned char *res, const char *password); +void make_password_from_salt(char *to, const unsigned char *hash_stage2); +char *octet2hex(char *to, const char *str, unsigned int len); +char *get_tty_password(const char *opt_message); +const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); +my_bool my_thread_init(void); +void my_thread_end(void); +ulong net_field_length(uchar **packet); +my_ulonglong net_field_length_ll(uchar **packet); +uchar *net_store_length(uchar *pkg, ulonglong length); +#include +#include "my_net.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void my_inet_ntoa(struct in_addr in, char *buf); +struct hostent; +struct hostent *my_gethostbyname_r(const char *name, + struct hostent *result, char *buffer, + int buflen, int *h_errnop); +enum enum_vio_type +{ + VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE, + VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY +}; +Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags); +void vio_delete(Vio* vio); +int vio_close(Vio* vio); +void vio_reset(Vio* vio, enum enum_vio_type type, + my_socket sd, void * hPipe, uint flags); +size_t vio_read(Vio *vio, uchar * buf, size_t size); +size_t vio_read_buff(Vio *vio, uchar * buf, size_t size); +size_t vio_write(Vio *vio, const uchar * buf, size_t size); +int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode); +my_bool vio_is_blocking(Vio *vio); +int vio_fastsend(Vio *vio); +int vio_keepalive(Vio *vio, my_bool onoff); +my_bool vio_should_retry(Vio *vio); +my_bool vio_was_interrupted(Vio *vio); +const char* vio_description(Vio *vio); +enum enum_vio_type vio_type(Vio* vio); +int vio_errno(Vio*vio); +my_socket vio_fd(Vio*vio); +my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port); +void vio_in_addr(Vio *vio, struct in_addr *in); +my_bool vio_poll_read(Vio *vio,uint timeout); +void vio_end(void); +enum SSL_type +{ + SSL_TYPE_NOT_SPECIFIED= -1, + SSL_TYPE_NONE, + SSL_TYPE_ANY, + SSL_TYPE_X509, + SSL_TYPE_SPECIFIED +}; +struct st_vio +{ + my_socket sd; + void * hPipe; + my_bool localhost; + int fcntl_mode; + struct sockaddr_in local; + struct sockaddr_in remote; + enum enum_vio_type type; + char desc[30]; + char *read_buffer; + char *read_pos; + char *read_end; + void (*viodelete)(Vio*); + int (*vioerrno)(Vio*); + size_t (*read)(Vio*, uchar *, size_t); + size_t (*write)(Vio*, const uchar *, size_t); + int (*vioblocking)(Vio*, my_bool, my_bool *); + my_bool (*is_blocking)(Vio*); + int (*viokeepalive)(Vio*, my_bool); + int (*fastsend)(Vio*); + my_bool (*peer_addr)(Vio*, char *, uint16*); + void (*in_addr)(Vio*, struct in_addr*); + my_bool (*should_retry)(Vio*); + my_bool (*was_interrupted)(Vio*); + int (*vioclose)(Vio*); + void (*timeout)(Vio*, unsigned int which, unsigned int timeout); +}; +#include "unireg.h" +#include "mysqld_error.h" +#include "structs.h" +struct st_table; +class Field; +typedef struct st_date_time_format { + uchar positions[8]; + char time_separator; + uint flag; + LEX_STRING format; +} DATE_TIME_FORMAT; +typedef struct st_keyfile_info { + uchar ref[8]; + uchar dupp_ref[8]; + uint ref_length; + uint block_size; + File filenr; + ha_rows records; + ha_rows deleted; + ulonglong data_file_length; + ulonglong max_data_file_length; + ulonglong index_file_length; + ulonglong max_index_file_length; + ulonglong delete_length; + ulonglong auto_increment_value; + int errkey,sortkey; + time_t create_time; + time_t check_time; + time_t update_time; + ulong mean_rec_length; +} KEYFILE_INFO; +typedef struct st_key_part_info { + Field *field; + uint offset; + uint null_offset; + uint16 length; + uint16 store_length; + uint16 key_type; + uint16 fieldnr; + uint16 key_part_flag; + uint8 type; + uint8 null_bit; +} KEY_PART_INFO ; +typedef struct st_key { + uint key_length; + ulong flags; + uint key_parts; + uint extra_length; + uint usable_key_parts; + uint block_size; + enum ha_key_alg algorithm; + union + { + plugin_ref parser; + LEX_STRING *parser_name; + }; + KEY_PART_INFO *key_part; + char *name; + ulong *rec_per_key; + union { + int bdb_return_if_eq; + } handler; + struct st_table *table; +} KEY; +struct st_join_table; +typedef struct st_reginfo { + struct st_join_table *join_tab; + enum thr_lock_type lock_type; + In_C_you_should_use_my_bool_instead() not_exists_optimize; + In_C_you_should_use_my_bool_instead() impossible_range; +} REGINFO; +struct st_read_record; +class SQL_SELECT; +class THD; +class handler; +typedef struct st_read_record { + struct st_table *table; + handler *file; + struct st_table **forms; + int (*read_record)(struct st_read_record *); + THD *thd; + SQL_SELECT *select; + uint cache_records; + uint ref_length,struct_length,reclength,rec_cache_size,error_offset; + uint index; + uchar *ref_pos; + uchar *record; + uchar *rec_buf; + uchar *cache,*cache_pos,*cache_end,*read_positions; + IO_CACHE *io_cache; + In_C_you_should_use_my_bool_instead() print_error, ignore_not_found_rows; +} READ_RECORD; +typedef enum enum_mysql_timestamp_type timestamp_type; +typedef struct { + ulong year,month,day,hour; + ulonglong minute,second,second_part; + In_C_you_should_use_my_bool_instead() neg; +} INTERVAL; +typedef struct st_known_date_time_format { + const char *format_name; + const char *date_format; + const char *datetime_format; + const char *time_format; +} KNOWN_DATE_TIME_FORMAT; +enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED}; +extern const char *show_comp_option_name[]; +typedef int *(*update_var)(THD *, struct st_mysql_show_var *); +typedef struct st_lex_user { + LEX_STRING user, host, password; +} LEX_USER; +typedef struct user_resources { + uint questions; + uint updates; + uint conn_per_hour; + uint user_conn; + enum {QUERIES_PER_HOUR= 1, UPDATES_PER_HOUR= 2, CONNECTIONS_PER_HOUR= 4, + USER_CONNECTIONS= 8}; + uint specified_limits; +} USER_RESOURCES; +typedef struct user_conn { + char *user; + char *host; + ulonglong reset_utime; + uint len; + uint connections; + uint conn_per_hour, updates, questions; + USER_RESOURCES user_resources; +} USER_CONN; +class Discrete_interval { +private: + ulonglong interval_min; + ulonglong interval_values; + ulonglong interval_max; +public: + Discrete_interval *next; + void replace(ulonglong start, ulonglong val, ulonglong incr) + { + interval_min= start; + interval_values= val; + interval_max= (val == ((unsigned long long)(~0ULL))) ? val : start + val * incr; + } + Discrete_interval(ulonglong start, ulonglong val, ulonglong incr) : + next(NULL) { replace(start, val, incr); }; + Discrete_interval() : next(NULL) { replace(0, 0, 0); }; + ulonglong minimum() const { return interval_min; }; + ulonglong values() const { return interval_values; }; + ulonglong maximum() const { return interval_max; }; + In_C_you_should_use_my_bool_instead() merge_if_contiguous(ulonglong start, ulonglong val, ulonglong incr) + { + if (interval_max == start) + { + if (val == ((unsigned long long)(~0ULL))) + { + interval_values= interval_max= val; + } + else + { + interval_values+= val; + interval_max= start + val * incr; + } + return 0; + } + return 1; + }; +}; +class Discrete_intervals_list { +private: + Discrete_interval *head; + Discrete_interval *tail; + Discrete_interval *current; + uint elements; + void copy_(const Discrete_intervals_list& from) + { + for (Discrete_interval *i= from.head; i; i= i->next) + { + Discrete_interval j= *i; + append(&j); + } + } +public: + Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {}; + Discrete_intervals_list(const Discrete_intervals_list& from) + { + copy_(from); + } + void operator=(const Discrete_intervals_list& from) + { + empty(); + copy_(from); + } + void empty_no_free() + { + head= current= NULL; + elements= 0; + } + void empty() + { + for (Discrete_interval *i= head; i;) + { + Discrete_interval *next= i->next; + delete i; + i= next; + } + empty_no_free(); + } + const Discrete_interval* get_next() + { + Discrete_interval *tmp= current; + if (current != NULL) + current= current->next; + return tmp; + } + ~Discrete_intervals_list() { empty(); }; + In_C_you_should_use_my_bool_instead() append(ulonglong start, ulonglong val, ulonglong incr); + In_C_you_should_use_my_bool_instead() append(Discrete_interval *interval); + ulonglong minimum() const { return (head ? head->minimum() : 0); }; + ulonglong maximum() const { return (head ? tail->maximum() : 0); }; + uint nb_elements() const { return elements; } +}; +void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size); +void *sql_alloc(size_t); +void *sql_calloc(size_t); +char *sql_strdup(const char *str); +char *sql_strmake(const char *str, size_t len); +void *sql_memdup(const void * ptr, size_t size); +void sql_element_free(void *ptr); +char *sql_strmake_with_convert(const char *str, size_t arg_length, + CHARSET_INFO *from_cs, + size_t max_res_length, + CHARSET_INFO *to_cs, size_t *result_length); +uint kill_one_thread(THD *thd, ulong id, In_C_you_should_use_my_bool_instead() only_kill_query); +void sql_kill(THD *thd, ulong id, In_C_you_should_use_my_bool_instead() only_kill_query); +In_C_you_should_use_my_bool_instead() net_request_file(NET* net, const char* fname); +char* query_table_status(THD *thd,const char *db,const char *table_name); +extern CHARSET_INFO *system_charset_info, *files_charset_info ; +extern CHARSET_INFO *national_charset_info, *table_alias_charset; +enum Derivation +{ + DERIVATION_IGNORABLE= 5, + DERIVATION_COERCIBLE= 4, + DERIVATION_SYSCONST= 3, + DERIVATION_IMPLICIT= 2, + DERIVATION_NONE= 1, + DERIVATION_EXPLICIT= 0 +}; +typedef struct my_locale_st +{ + uint number; + const char *name; + const char *description; + const In_C_you_should_use_my_bool_instead() is_ascii; + TYPELIB *month_names; + TYPELIB *ab_month_names; + TYPELIB *day_names; + TYPELIB *ab_day_names; +} MY_LOCALE; +extern MY_LOCALE my_locale_en_US; +extern MY_LOCALE *my_locales[]; +extern MY_LOCALE *my_default_lc_time_names; +MY_LOCALE *my_locale_by_name(const char *name); +MY_LOCALE *my_locale_by_number(uint number); +class Object_creation_ctx +{ +public: + Object_creation_ctx *set_n_backup(THD *thd); + void restore_env(THD *thd, Object_creation_ctx *backup_ctx); +protected: + Object_creation_ctx() {} + virtual Object_creation_ctx *create_backup_ctx(THD *thd) const = 0; + virtual void change_env(THD *thd) const = 0; +public: + virtual ~Object_creation_ctx() + { } +}; +class Default_object_creation_ctx : public Object_creation_ctx +{ +public: + CHARSET_INFO *get_client_cs() + { + return m_client_cs; + } + CHARSET_INFO *get_connection_cl() + { + return m_connection_cl; + } +protected: + Default_object_creation_ctx(THD *thd); + Default_object_creation_ctx(CHARSET_INFO *client_cs, + CHARSET_INFO *connection_cl); +protected: + virtual Object_creation_ctx *create_backup_ctx(THD *thd) const; + virtual void change_env(THD *thd) const; +protected: + CHARSET_INFO *m_client_cs; + CHARSET_INFO *m_connection_cl; +}; +struct TABLE_LIST; +class String; +void view_store_options(THD *thd, TABLE_LIST *table, String *buff); +enum enum_parsing_place +{ + NO_MATTER, + IN_HAVING, + SELECT_LIST, + IN_WHERE, + IN_ON +}; +struct st_table; +class THD; +enum enum_check_fields +{ + CHECK_FIELD_IGNORE, + CHECK_FIELD_WARN, + CHECK_FIELD_ERROR_FOR_NULL +}; +typedef struct st_sql_list { + uint elements; + uchar *first; + uchar **next; + st_sql_list() {} + inline void empty() + { + elements=0; + first=0; + next= &first; + } + inline void link_in_list(uchar *element,uchar **next_ptr) + { + elements++; + (*next)=element; + next= next_ptr; + *next=0; + } + inline void save_and_clear(struct st_sql_list *save) + { + *save= *this; + empty(); + } + inline void push_front(struct st_sql_list *save) + { + *save->next= first; + first= save->first; + elements+= save->elements; + } + inline void push_back(struct st_sql_list *save) + { + if (save->first) + { + *next= save->first; + next= save->next; + elements+= save->elements; + } + } +} SQL_LIST; +extern pthread_key_t THR_THD; +inline THD *_current_thd(void) +{ + return ((THD*) pthread_getspecific((THR_THD))); +} +extern "C" +const char *set_thd_proc_info(THD *thd, const char *info, + const char *calling_func, + const char *calling_file, + const unsigned int calling_line); +enum enum_table_ref_type +{ + TABLE_REF_NULL= 0, + TABLE_REF_VIEW, + TABLE_REF_BASE_TABLE, + TABLE_REF_I_S_TABLE, + TABLE_REF_TMP_TABLE +}; +extern ulong server_id, concurrency; +typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key, + uint key_length, + ulonglong *engine_data); +#include "sql_string.h" +class String; +int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); +String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); +uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, + const char *from, uint32 from_length, + CHARSET_INFO *from_cs, uint *errors); +uint32 well_formed_copy_nchars(CHARSET_INFO *to_cs, + char *to, uint to_length, + CHARSET_INFO *from_cs, + const char *from, uint from_length, + uint nchars, + const char **well_formed_error_pos, + const char **cannot_convert_error_pos, + const char **from_end_pos); +size_t my_copy_with_hex_escaping(CHARSET_INFO *cs, + char *dst, size_t dstlen, + const char *src, size_t srclen); +class String +{ + char *Ptr; + uint32 str_length,Alloced_length; + In_C_you_should_use_my_bool_instead() alloced; + CHARSET_INFO *str_charset; +public: + String() + { + Ptr=0; str_length=Alloced_length=0; alloced=0; + str_charset= &my_charset_bin; + } + String(uint32 length_arg) + { + alloced=0; Alloced_length=0; (void) real_alloc(length_arg); + str_charset= &my_charset_bin; + } + String(const char *str, CHARSET_INFO *cs) + { + Ptr=(char*) str; str_length=(uint) strlen(str); Alloced_length=0; alloced=0; + str_charset=cs; + } + String(const char *str,uint32 len, CHARSET_INFO *cs) + { + Ptr=(char*) str; str_length=len; Alloced_length=0; alloced=0; + str_charset=cs; + } + String(char *str,uint32 len, CHARSET_INFO *cs) + { + Ptr=(char*) str; Alloced_length=str_length=len; alloced=0; + str_charset=cs; + } + String(const String &str) + { + Ptr=str.Ptr ; str_length=str.str_length ; + Alloced_length=str.Alloced_length; alloced=0; + str_charset=str.str_charset; + } + static void *operator new(size_t size, MEM_ROOT *mem_root) + { return (void*) alloc_root(mem_root, (uint) size); } + static void operator delete(void *ptr_arg,size_t size) + { ; } + static void operator delete(void *ptr_arg, MEM_ROOT *mem_root) + { } + ~String() { free(); } + inline void set_charset(CHARSET_INFO *charset_arg) + { str_charset= charset_arg; } + inline CHARSET_INFO *charset() const { return str_charset; } + inline uint32 length() const { return str_length;} + inline uint32 alloced_length() const { return Alloced_length;} + inline char& operator [] (uint32 i) const { return Ptr[i]; } + inline void length(uint32 len) { str_length=len ; } + inline In_C_you_should_use_my_bool_instead() is_empty() { return (str_length == 0); } + inline void mark_as_const() { Alloced_length= 0;} + inline const char *ptr() const { return Ptr; } + inline char *c_ptr() + { + if (!Ptr || Ptr[str_length]) + (void) realloc(str_length); + return Ptr; + } + inline char *c_ptr_quick() + { + if (Ptr && str_length < Alloced_length) + Ptr[str_length]=0; + return Ptr; + } + inline char *c_ptr_safe() + { + if (Ptr && str_length < Alloced_length) + Ptr[str_length]=0; + else + (void) realloc(str_length); + return Ptr; + } + void set(String &str,uint32 offset,uint32 arg_length) + { + assert(&str != this); + free(); + Ptr=(char*) str.ptr()+offset; str_length=arg_length; alloced=0; + if (str.Alloced_length) + Alloced_length=str.Alloced_length-offset; + else + Alloced_length=0; + str_charset=str.str_charset; + } + inline void set(char *str,uint32 arg_length, CHARSET_INFO *cs) + { + free(); + Ptr=(char*) str; str_length=Alloced_length=arg_length ; alloced=0; + str_charset=cs; + } + inline void set(const char *str,uint32 arg_length, CHARSET_INFO *cs) + { + free(); + Ptr=(char*) str; str_length=arg_length; Alloced_length=0 ; alloced=0; + str_charset=cs; + } + In_C_you_should_use_my_bool_instead() set_ascii(const char *str, uint32 arg_length); + inline void set_quick(char *str,uint32 arg_length, CHARSET_INFO *cs) + { + if (!alloced) + { + Ptr=(char*) str; str_length=Alloced_length=arg_length; + } + str_charset=cs; + } + In_C_you_should_use_my_bool_instead() set_int(longlong num, In_C_you_should_use_my_bool_instead() unsigned_flag, CHARSET_INFO *cs); + In_C_you_should_use_my_bool_instead() set(longlong num, CHARSET_INFO *cs) + { return set_int(num, false, cs); } + In_C_you_should_use_my_bool_instead() set(ulonglong num, CHARSET_INFO *cs) + { return set_int((longlong)num, true, cs); } + In_C_you_should_use_my_bool_instead() set_real(double num,uint decimals, CHARSET_INFO *cs); + inline void chop() + { + Ptr[str_length--]= '\0'; + } + inline void free() + { + if (alloced) + { + alloced=0; + Alloced_length=0; + ((void)(myf) (0),my_no_flags_free(Ptr)); + Ptr=0; + str_length=0; + } + } + inline In_C_you_should_use_my_bool_instead() alloc(uint32 arg_length) + { + if (arg_length < Alloced_length) + return 0; + return real_alloc(arg_length); + } + In_C_you_should_use_my_bool_instead() real_alloc(uint32 arg_length); + In_C_you_should_use_my_bool_instead() realloc(uint32 arg_length); + inline void shrink(uint32 arg_length) + { + if (arg_length < Alloced_length) + { + char *new_ptr; + if (!(new_ptr=(char*) my_realloc(Ptr,arg_length,(myf) (0)))) + { + Alloced_length = 0; + real_alloc(arg_length); + } + else + { + Ptr=new_ptr; + Alloced_length=arg_length; + } + } + } + In_C_you_should_use_my_bool_instead() is_alloced() { return alloced; } + inline String& operator = (const String &s) + { + if (&s != this) + { + assert(!s.uses_buffer_owned_by(this)); + free(); + Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length; + alloced=0; + } + return *this; + } + In_C_you_should_use_my_bool_instead() copy(); + In_C_you_should_use_my_bool_instead() copy(const String &s); + In_C_you_should_use_my_bool_instead() copy(const char *s,uint32 arg_length, CHARSET_INFO *cs); + static In_C_you_should_use_my_bool_instead() needs_conversion(uint32 arg_length, + CHARSET_INFO *cs_from, CHARSET_INFO *cs_to, + uint32 *offset); + In_C_you_should_use_my_bool_instead() copy_aligned(const char *s, uint32 arg_length, uint32 offset, + CHARSET_INFO *cs); + In_C_you_should_use_my_bool_instead() set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs); + In_C_you_should_use_my_bool_instead() copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom, + CHARSET_INFO *csto, uint *errors); + In_C_you_should_use_my_bool_instead() append(const String &s); + In_C_you_should_use_my_bool_instead() append(const char *s); + In_C_you_should_use_my_bool_instead() append(const char *s,uint32 arg_length); + In_C_you_should_use_my_bool_instead() append(const char *s,uint32 arg_length, CHARSET_INFO *cs); + In_C_you_should_use_my_bool_instead() append(IO_CACHE* file, uint32 arg_length); + In_C_you_should_use_my_bool_instead() append_with_prefill(const char *s, uint32 arg_length, + uint32 full_length, char fill_char); + int strstr(const String &search,uint32 offset=0); + int strrstr(const String &search,uint32 offset=0); + In_C_you_should_use_my_bool_instead() replace(uint32 offset,uint32 arg_length,const char *to,uint32 length); + In_C_you_should_use_my_bool_instead() replace(uint32 offset,uint32 arg_length,const String &to); + inline In_C_you_should_use_my_bool_instead() append(char chr) + { + if (str_length < Alloced_length) + { + Ptr[str_length++]=chr; + } + else + { + if (realloc(str_length+1)) + return 1; + Ptr[str_length++]=chr; + } + return 0; + } + In_C_you_should_use_my_bool_instead() fill(uint32 max_length,char fill); + void strip_sp(); + friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); + friend int stringcmp(const String *a,const String *b); + friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); + uint32 numchars(); + int charpos(int i,uint32 offset=0); + int reserve(uint32 space_needed) + { + return realloc(str_length + space_needed); + } + int reserve(uint32 space_needed, uint32 grow_by); + void q_append(const char c) + { + Ptr[str_length++] = c; + } + void q_append(const uint32 n) + { + *((long *) (Ptr + str_length))= (long) (n); + str_length += 4; + } + void q_append(double d) + { + do { *((long *) (Ptr + str_length)) = ((doubleget_union *)&(d))->m[0]; *(((long *) (Ptr + str_length))+1) = ((doubleget_union *)&(d))->m[1]; } while (0); + str_length += 8; + } + void q_append(double *d) + { + do { *((long *) (Ptr + str_length)) = ((doubleget_union *)&(*d))->m[0]; *(((long *) (Ptr + str_length))+1) = ((doubleget_union *)&(*d))->m[1]; } while (0); + str_length += 8; + } + void q_append(const char *data, uint32 data_len) + { + memcpy(Ptr + str_length, data, data_len); + str_length += data_len; + } + void write_at_position(int position, uint32 value) + { + *((long *) (Ptr + position))= (long) (value); + } + void qs_append(const char *str, uint32 len); + void qs_append(double d); + void qs_append(double *d); + inline void qs_append(const char c) + { + Ptr[str_length]= c; + str_length++; + } + void qs_append(int i); + void qs_append(uint i); + inline char *prep_append(uint32 arg_length, uint32 step_alloc) + { + uint32 new_length= arg_length + str_length; + if (new_length > Alloced_length) + { + if (realloc(new_length + step_alloc)) + return 0; + } + uint32 old_length= str_length; + str_length+= arg_length; + return Ptr+ old_length; + } + inline In_C_you_should_use_my_bool_instead() append(const char *s, uint32 arg_length, uint32 step_alloc) + { + uint32 new_length= arg_length + str_length; + if (new_length > Alloced_length && realloc(new_length + step_alloc)) + return (1); + memcpy(Ptr+str_length, s, arg_length); + str_length+= arg_length; + return (0); + } + void print(String *print); + void swap(String &s); + inline In_C_you_should_use_my_bool_instead() uses_buffer_owned_by(const String *s) const + { + return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length); + } +}; +static inline In_C_you_should_use_my_bool_instead() check_if_only_end_space(CHARSET_INFO *cs, char *str, + char *end) +{ + return str+ cs->cset->scan(cs, str, end, 2) == end; +} +#include "sql_list.h" +class Sql_alloc +{ +public: + static void *operator new(size_t size) throw () + { + return sql_alloc(size); + } + static void *operator new[](size_t size) + { + return sql_alloc(size); + } + static void *operator new[](size_t size, MEM_ROOT *mem_root) throw () + { return alloc_root(mem_root, size); } + static void *operator new(size_t size, MEM_ROOT *mem_root) throw () + { return alloc_root(mem_root, size); } + static void operator delete(void *ptr, size_t size) { ; } + static void operator delete(void *ptr, MEM_ROOT *mem_root) + { } + static void operator delete[](void *ptr, MEM_ROOT *mem_root) + { } + static void operator delete[](void *ptr, size_t size) { ; } + inline Sql_alloc() {} + inline ~Sql_alloc() {} +}; +struct list_node :public Sql_alloc +{ + list_node *next; + void *info; + list_node(void *info_par,list_node *next_par) + :next(next_par),info(info_par) + {} + list_node() + { + info= 0; + next= this; + } +}; +extern list_node end_of_list; +class base_list :public Sql_alloc +{ +protected: + list_node *first,**last; +public: + uint elements; + inline void empty() { elements=0; first= &end_of_list; last=&first;} + inline base_list() { empty(); } + inline base_list(const base_list &tmp) :Sql_alloc() + { + elements= tmp.elements; + first= tmp.first; + last= elements ? tmp.last : &first; + } + base_list(const base_list &rhs, MEM_ROOT *mem_root); + inline base_list(In_C_you_should_use_my_bool_instead() error) { } + inline In_C_you_should_use_my_bool_instead() push_back(void *info) + { + if (((*last)=new list_node(info, &end_of_list))) + { + last= &(*last)->next; + elements++; + return 0; + } + return 1; + } + inline In_C_you_should_use_my_bool_instead() push_back(void *info, MEM_ROOT *mem_root) + { + if (((*last)=new (mem_root) list_node(info, &end_of_list))) + { + last= &(*last)->next; + elements++; + return 0; + } + return 1; + } + inline In_C_you_should_use_my_bool_instead() push_front(void *info) + { + list_node *node=new list_node(info,first); + if (node) + { + if (last == &first) + last= &node->next; + first=node; + elements++; + return 0; + } + return 1; + } + void remove(list_node **prev) + { + list_node *node=(*prev)->next; + if (!--elements) + last= &first; + else if (last == &(*prev)->next) + last= prev; + delete *prev; + *prev=node; + } + inline void concat(base_list *list) + { + if (!list->is_empty()) + { + *last= list->first; + last= list->last; + elements+= list->elements; + } + } + inline void *pop(void) + { + if (first == &end_of_list) return 0; + list_node *tmp=first; + first=first->next; + if (!--elements) + last= &first; + return tmp->info; + } + inline void disjoin(base_list *list) + { + list_node **prev= &first; + list_node *node= first; + list_node *list_first= list->first; + elements=0; + while (node && node != list_first) + { + prev= &node->next; + node= node->next; + elements++; + } + *prev= *last; + last= prev; + } + inline void prepand(base_list *list) + { + if (!list->is_empty()) + { + *list->last= first; + first= list->first; + elements+= list->elements; + } + } + inline void swap(base_list &rhs) + { + { list_node * dummy; dummy= first; first= rhs.first; rhs.first= dummy; }; + { list_node ** dummy; dummy= last; last= rhs.last; rhs.last= dummy; }; + { uint dummy; dummy= elements; elements= rhs.elements; rhs.elements= dummy; }; + } + inline list_node* last_node() { return *last; } + inline list_node* first_node() { return first;} + inline void *head() { return first->info; } + inline void **head_ref() { return first != &end_of_list ? &first->info : 0; } + inline In_C_you_should_use_my_bool_instead() is_empty() { return first == &end_of_list ; } + inline list_node *last_ref() { return &end_of_list; } + friend class base_list_iterator; + friend class error_list; + friend class error_list_iterator; +protected: + void after(void *info,list_node *node) + { + list_node *new_node=new list_node(info,node->next); + node->next=new_node; + elements++; + if (last == &(node->next)) + last= &new_node->next; + } +}; +class base_list_iterator +{ +protected: + base_list *list; + list_node **el,**prev,*current; + void sublist(base_list &ls, uint elm) + { + ls.first= *el; + ls.last= list->last; + ls.elements= elm; + } +public: + base_list_iterator() + :list(0), el(0), prev(0), current(0) + {} + base_list_iterator(base_list &list_par) + { init(list_par); } + inline void init(base_list &list_par) + { + list= &list_par; + el= &list_par.first; + prev= 0; + current= 0; + } + inline void *next(void) + { + prev=el; + current= *el; + el= ¤t->next; + return current->info; + } + inline void *next_fast(void) + { + list_node *tmp; + tmp= *el; + el= &tmp->next; + return tmp->info; + } + inline void rewind(void) + { + el= &list->first; + } + inline void *replace(void *element) + { + void *tmp=current->info; + assert(current->info != 0); + current->info=element; + return tmp; + } + void *replace(base_list &new_list) + { + void *ret_value=current->info; + if (!new_list.is_empty()) + { + *new_list.last=current->next; + current->info=new_list.first->info; + current->next=new_list.first->next; + if ((list->last == ¤t->next) && (new_list.elements > 1)) + list->last= new_list.last; + list->elements+=new_list.elements-1; + } + return ret_value; + } + inline void remove(void) + { + list->remove(prev); + el=prev; + current=0; + } + void after(void *element) + { + list->after(element,current); + current=current->next; + el= ¤t->next; + } + inline void **ref(void) + { + return ¤t->info; + } + inline In_C_you_should_use_my_bool_instead() is_last(void) + { + return el == &list->last_ref()->next; + } + friend class error_list_iterator; +}; +template class List :public base_list +{ +public: + inline List() :base_list() {} + inline List(const List &tmp) :base_list(tmp) {} + inline List(const List &tmp, MEM_ROOT *mem_root) : + base_list(tmp, mem_root) {} + inline In_C_you_should_use_my_bool_instead() push_back(T *a) { return base_list::push_back(a); } + inline In_C_you_should_use_my_bool_instead() push_back(T *a, MEM_ROOT *mem_root) + { return base_list::push_back(a, mem_root); } + inline In_C_you_should_use_my_bool_instead() push_front(T *a) { return base_list::push_front(a); } + inline T* head() {return (T*) base_list::head(); } + inline T** head_ref() {return (T**) base_list::head_ref(); } + inline T* pop() {return (T*) base_list::pop(); } + inline void concat(List *list) { base_list::concat(list); } + inline void disjoin(List *list) { base_list::disjoin(list); } + inline void prepand(List *list) { base_list::prepand(list); } + void delete_elements(void) + { + list_node *element,*next; + for (element=first; element != &end_of_list; element=next) + { + next=element->next; + delete (T*) element->info; + } + empty(); + } +}; +template class List_iterator :public base_list_iterator +{ +public: + List_iterator(List &a) : base_list_iterator(a) {} + List_iterator() : base_list_iterator() {} + inline void init(List &a) { base_list_iterator::init(a); } + inline T* operator++(int) { return (T*) base_list_iterator::next(); } + inline T *replace(T *a) { return (T*) base_list_iterator::replace(a); } + inline T *replace(List &a) { return (T*) base_list_iterator::replace(a); } + inline void rewind(void) { base_list_iterator::rewind(); } + inline void remove() { base_list_iterator::remove(); } + inline void after(T *a) { base_list_iterator::after(a); } + inline T** ref(void) { return (T**) base_list_iterator::ref(); } +}; +template class List_iterator_fast :public base_list_iterator +{ +protected: + inline T *replace(T *a) { return (T*) 0; } + inline T *replace(List &a) { return (T*) 0; } + inline void remove(void) { } + inline void after(T *a) { } + inline T** ref(void) { return (T**) 0; } +public: + inline List_iterator_fast(List &a) : base_list_iterator(a) {} + inline List_iterator_fast() : base_list_iterator() {} + inline void init(List &a) { base_list_iterator::init(a); } + inline T* operator++(int) { return (T*) base_list_iterator::next_fast(); } + inline void rewind(void) { base_list_iterator::rewind(); } + void sublist(List &list_arg, uint el_arg) + { + base_list_iterator::sublist(list_arg, el_arg); + } +}; +struct ilink +{ + struct ilink **prev,*next; + static void *operator new(size_t size) + { + return (void*)my_malloc((uint)size, (myf) (16 | 8)); + } + static void operator delete(void* ptr_arg, size_t size) + { + ((void)(myf) (16|64),my_no_flags_free((uchar*)ptr_arg)); + } + inline ilink() + { + prev=0; next=0; + } + inline void unlink() + { + if (prev) *prev= next; + if (next) next->prev=prev; + prev=0 ; next=0; + } + virtual ~ilink() { unlink(); } +}; +class i_string: public ilink +{ +public: + const char* ptr; + i_string():ptr(0) { } + i_string(const char* s) : ptr(s) {} +}; +class i_string_pair: public ilink +{ +public: + const char* key; + const char* val; + i_string_pair():key(0),val(0) { } + i_string_pair(const char* key_arg, const char* val_arg) : + key(key_arg),val(val_arg) {} +}; +template class I_List_iterator; +class base_ilist +{ +public: + struct ilink *first,last; + inline void empty() { first= &last; last.prev= &first; } + base_ilist() { empty(); } + inline In_C_you_should_use_my_bool_instead() is_empty() { return first == &last; } + inline void append(ilink *a) + { + first->prev= &a->next; + a->next=first; a->prev= &first; first=a; + } + inline void push_back(ilink *a) + { + *last.prev= a; + a->next= &last; + a->prev= last.prev; + last.prev= &a->next; + } + inline struct ilink *get() + { + struct ilink *first_link=first; + if (first_link == &last) + return 0; + first_link->unlink(); + return first_link; + } + inline struct ilink *head() + { + return (first != &last) ? first : 0; + } + friend class base_list_iterator; +}; +class base_ilist_iterator +{ + base_ilist *list; + struct ilink **el,*current; +public: + base_ilist_iterator(base_ilist &list_par) :list(&list_par), + el(&list_par.first),current(0) {} + void *next(void) + { + current= *el; + if (current == &list->last) return 0; + el= ¤t->next; + return current; + } +}; +template +class I_List :private base_ilist +{ +public: + I_List() :base_ilist() {} + inline void empty() { base_ilist::empty(); } + inline In_C_you_should_use_my_bool_instead() is_empty() { return base_ilist::is_empty(); } + inline void append(T* a) { base_ilist::append(a); } + inline void push_back(T* a) { base_ilist::push_back(a); } + inline T* get() { return (T*) base_ilist::get(); } + inline T* head() { return (T*) base_ilist::head(); } + friend class I_List_iterator; +}; +template class I_List_iterator :public base_ilist_iterator +{ +public: + I_List_iterator(I_List &a) : base_ilist_iterator(a) {} + inline T* operator++(int) { return (T*) base_ilist_iterator::next(); } +}; +template +inline +void +list_copy_and_replace_each_value(List &list, MEM_ROOT *mem_root) +{ + List_iterator it(list); + T *el; + while ((el= it++)) + it.replace(el->clone(mem_root)); +} +#include "sql_map.h" +class mapped_files; +mapped_files *map_file(const char * name,uchar *magic,uint magic_length); +void unmap_file(mapped_files *map); +class mapped_files :public ilink { + uchar *map; + ha_rows size; + char *name; + File file; + int error; + uint use_count; +public: + mapped_files(const char * name,uchar *magic,uint magic_length); + ~mapped_files(); + friend class mapped_file; + friend mapped_files *map_file(const char * name,uchar *magic, + uint magic_length); + friend void unmap_file(mapped_files *map); +}; +class mapped_file +{ + mapped_files *file; +public: + mapped_file(const char * name,uchar *magic,uint magic_length) + { + file=map_file(name,magic,magic_length); + } + ~mapped_file() + { + unmap_file(file); + } + uchar *map() + { + return file->map; + } +}; +#include "my_decimal.h" +#include +typedef enum +{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} + decimal_round_mode; +typedef int32 decimal_digit_t; +typedef struct st_decimal_t { + int intg, frac, len; + my_bool sign; + decimal_digit_t *buf; +} decimal_t; +int internal_str2dec(const char *from, decimal_t *to, char **end, + my_bool fixed); +int decimal2string(decimal_t *from, char *to, int *to_len, + int fixed_precision, int fixed_decimals, + char filler); +int decimal2ulonglong(decimal_t *from, ulonglong *to); +int ulonglong2decimal(ulonglong from, decimal_t *to); +int decimal2longlong(decimal_t *from, longlong *to); +int longlong2decimal(longlong from, decimal_t *to); +int decimal2double(decimal_t *from, double *to); +int double2decimal(double from, decimal_t *to); +int decimal_actual_fraction(decimal_t *from); +int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); +int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale); +int decimal_size(int precision, int scale); +int decimal_bin_size(int precision, int scale); +int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, + int param); +int decimal_intg(decimal_t *from); +int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_cmp(decimal_t *from1, decimal_t *from2); +int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, + int scale_incr); +int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to); +int decimal_round(decimal_t *from, decimal_t *to, int new_scale, + decimal_round_mode mode); +int decimal_is_zero(decimal_t *from); +void max_decimal(int precision, int frac, decimal_t *to); +inline uint my_decimal_size(uint precision, uint scale) +{ + return decimal_size(precision, scale) + 1; +} +inline int my_decimal_int_part(uint precision, uint decimals) +{ + return precision - ((decimals == 31) ? 0 : decimals); +} +class my_decimal :public decimal_t +{ + decimal_digit_t buffer[9]; +public: + void init() + { + len= 9; + buf= buffer; + for (uint i= 0; i < 9; i++) + buffer[i]= i; + } + my_decimal() + { + init(); + } + void fix_buffer_pointer() { buf= buffer; } + In_C_you_should_use_my_bool_instead() sign() const { return decimal_t::sign; } + void sign(In_C_you_should_use_my_bool_instead() s) { decimal_t::sign= s; } + uint precision() const { return intg + frac; } + void swap(my_decimal &rhs) + { + { my_decimal dummy; dummy= *this; *this= rhs; rhs= dummy; }; + { decimal_digit_t * dummy; dummy= buf; buf= rhs.buf; rhs.buf= dummy; }; + } +}; +void print_decimal(const my_decimal *dec); +void print_decimal_buff(const my_decimal *dec, const uchar* ptr, int length); +const char *dbug_decimal_as_string(char *buff, const my_decimal *val); +int decimal_operation_results(int result); +inline +void max_my_decimal(my_decimal *to, int precision, int frac) +{ + assert((precision <= ((9 * 9) - 8*2))&& (frac <= 30)); + max_decimal(precision, frac, (decimal_t*) to); +} +inline void max_internal_decimal(my_decimal *to) +{ + max_my_decimal(to, ((9 * 9) - 8*2), 0); +} +inline int check_result(uint mask, int result) +{ + if (result & mask) + decimal_operation_results(result); + return result; +} +inline int check_result_and_overflow(uint mask, int result, my_decimal *val) +{ + if (check_result(mask, result) & 2) + { + In_C_you_should_use_my_bool_instead() sign= val->sign(); + val->fix_buffer_pointer(); + max_internal_decimal(val); + val->sign(sign); + } + return result; +} +inline uint my_decimal_length_to_precision(uint length, uint scale, + In_C_you_should_use_my_bool_instead() unsigned_flag) +{ + assert(length || !scale); + return (uint) (length - (scale>0 ? 1:0) - + (unsigned_flag || !length ? 0:1)); +} +inline uint32 my_decimal_precision_to_length(uint precision, uint8 scale, + In_C_you_should_use_my_bool_instead() unsigned_flag) +{ + assert(precision || !scale); + do { if ((precision) > (((9 * 9) - 8*2))) (precision)=(((9 * 9) - 8*2)); } while(0); + return (uint32)(precision + (scale>0 ? 1:0) + + (unsigned_flag || !precision ? 0:1)); +} +inline +int my_decimal_string_length(const my_decimal *d) +{ + return (((d)->intg ? (d)->intg : 1) + (d)->frac + ((d)->frac > 0) + 2); +} +inline +int my_decimal_max_length(const my_decimal *d) +{ + return (((d)->intg ? (d)->intg : 1) + (d)->frac + ((d)->frac > 0) + 2) - 1; +} +inline +int my_decimal_get_binary_size(uint precision, uint scale) +{ + return decimal_bin_size((int)precision, (int)scale); +} +inline +void my_decimal2decimal(const my_decimal *from, my_decimal *to) +{ + *to= *from; + to->fix_buffer_pointer(); +} +int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec, + int scale); +inline +int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec, + int scale) +{ + return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale)); +} +inline +int my_decimal_set_zero(my_decimal *d) +{ + do { (((decimal_t*) d))->buf[0]=0; (((decimal_t*) d))->intg=1; (((decimal_t*) d))->frac=0; (((decimal_t*) d))->sign=0; } while(0); + return 0; +} +inline +In_C_you_should_use_my_bool_instead() my_decimal_is_zero(const my_decimal *decimal_value) +{ + return decimal_is_zero((decimal_t*) decimal_value); +} +inline +int my_decimal_round(uint mask, const my_decimal *from, int scale, + In_C_you_should_use_my_bool_instead() truncate, my_decimal *to) +{ + return check_result(mask, decimal_round((decimal_t*) from, to, scale, + (truncate ? TRUNCATE : HALF_UP))); +} +inline +int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to) +{ + return check_result(mask, decimal_round((decimal_t*) from, to, 0, FLOOR)); +} +inline +int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to) +{ + return check_result(mask, decimal_round((decimal_t*) from, to, 0, CEILING)); +} +int my_decimal2string(uint mask, const my_decimal *d, uint fixed_prec, + uint fixed_dec, char filler, String *str); +inline +int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag, + longlong *l) +{ + my_decimal rounded; + decimal_round((decimal_t*)d, &rounded, 0, HALF_UP); + return check_result(mask, (unsigned_flag ? + decimal2ulonglong(&rounded, (ulonglong *)l) : + decimal2longlong(&rounded, l))); +} +inline +int my_decimal2double(uint mask, const my_decimal *d, double *result) +{ + return decimal2double((decimal_t*) d, result); +} +inline +int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end) +{ + return check_result_and_overflow(mask, internal_str2dec((str), ((decimal_t*)d), (end), 0), + d); +} +int str2my_decimal(uint mask, const char *from, uint length, + CHARSET_INFO *charset, my_decimal *decimal_value); +inline +int double2my_decimal(uint mask, double val, my_decimal *d) +{ + return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d); +} +inline +int int2my_decimal(uint mask, longlong i, my_bool unsigned_flag, my_decimal *d) +{ + return check_result(mask, (unsigned_flag ? + ulonglong2decimal((ulonglong)i, d) : + longlong2decimal(i, d))); +} +inline +void my_decimal_neg(decimal_t *arg) +{ + if (decimal_is_zero(arg)) + { + arg->sign= 0; + return; + } + do { (arg)->sign^=1; } while(0); +} +inline +int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a, + const my_decimal *b) +{ + return check_result_and_overflow(mask, + decimal_add((decimal_t*)a,(decimal_t*)b,res), + res); +} +inline +int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a, + const my_decimal *b) +{ + return check_result_and_overflow(mask, + decimal_sub((decimal_t*)a,(decimal_t*)b,res), + res); +} +inline +int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a, + const my_decimal *b) +{ + return check_result_and_overflow(mask, + decimal_mul((decimal_t*)a,(decimal_t*)b,res), + res); +} +inline +int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a, + const my_decimal *b, int div_scale_inc) +{ + return check_result_and_overflow(mask, + decimal_div((decimal_t*)a,(decimal_t*)b,res, + div_scale_inc), + res); +} +inline +int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a, + const my_decimal *b) +{ + return check_result_and_overflow(mask, + decimal_mod((decimal_t*)a,(decimal_t*)b,res), + res); +} +inline +int my_decimal_cmp(const my_decimal *a, const my_decimal *b) +{ + return decimal_cmp((decimal_t*) a, (decimal_t*) b); +} +inline +int my_decimal_intg(const my_decimal *a) +{ + return decimal_intg((decimal_t*) a); +} +void my_decimal_trim(ulong *precision, uint *scale); +#include "handler.h" +#include +#include "myisampack.h" +typedef struct st_HA_KEYSEG +{ + CHARSET_INFO *charset; + uint32 start; + uint32 null_pos; + uint16 bit_pos; + uint16 flag; + uint16 length; + uint8 type; + uint8 language; + uint8 null_bit; + uint8 bit_start,bit_end; + uint8 bit_length; +} HA_KEYSEG; +extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , + my_bool, my_bool); +extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, + register uchar *b, uint key_length, uint nextflag, + uint *diff_pos); +extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); +extern void my_handler_error_register(void); +extern void my_handler_error_unregister(void); +#include +typedef struct st_ft_info FT_INFO; +struct _ft_vft +{ + int (*read_next)(FT_INFO *, char *); + float (*find_relevance)(FT_INFO *, uchar *, uint); + void (*close_search)(FT_INFO *); + float (*get_relevance)(FT_INFO *); + void (*reinit_search)(FT_INFO *); +}; +struct st_ft_info +{ + struct _ft_vft *please; +}; +extern const char *ft_stopword_file; +extern const char *ft_precompiled_stopwords[]; +extern ulong ft_min_word_len; +extern ulong ft_max_word_len; +extern ulong ft_query_expansion_limit; +extern char ft_boolean_syntax[15]; +extern struct st_mysql_ftparser ft_default_parser; +int ft_init_stopwords(void); +void ft_free_stopwords(void); +FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *); +my_bool ft_boolean_check_syntax_string(const uchar *); +#include +struct st_block_link; +typedef struct st_block_link BLOCK_LINK; +struct st_keycache_page; +typedef struct st_keycache_page KEYCACHE_PAGE; +struct st_hash_link; +typedef struct st_hash_link HASH_LINK; +typedef struct st_keycache_wqueue +{ + struct st_my_thread_var *last_thread; +} KEYCACHE_WQUEUE; +typedef struct st_key_cache +{ + my_bool key_cache_inited; + my_bool in_resize; + my_bool resize_in_flush; + my_bool can_be_used; + size_t key_cache_mem_size; + uint key_cache_block_size; + ulong min_warm_blocks; + ulong age_threshold; + ulonglong keycache_time; + uint hash_entries; + int hash_links; + int hash_links_used; + int disk_blocks; + ulong blocks_used; + ulong blocks_unused; + ulong blocks_changed; + ulong warm_blocks; + ulong cnt_for_resize_op; + long blocks_available; + HASH_LINK **hash_root; + HASH_LINK *hash_link_root; + HASH_LINK *free_hash_list; + BLOCK_LINK *free_block_list; + BLOCK_LINK *block_root; + uchar *block_mem; + BLOCK_LINK *used_last; + BLOCK_LINK *used_ins; + pthread_mutex_t cache_lock; + KEYCACHE_WQUEUE resize_queue; + KEYCACHE_WQUEUE waiting_for_resize_cnt; + KEYCACHE_WQUEUE waiting_for_hash_link; + KEYCACHE_WQUEUE waiting_for_block; + BLOCK_LINK *changed_blocks[128]; + BLOCK_LINK *file_blocks[128]; + ulonglong param_buff_size; + ulong param_block_size; + ulong param_division_limit; + ulong param_age_threshold; + ulong global_blocks_changed; + ulonglong global_cache_w_requests; + ulonglong global_cache_write; + ulonglong global_cache_r_requests; + ulonglong global_cache_read; + int blocks; + my_bool in_init; +} KEY_CACHE; +extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache; +extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, + size_t use_mem, uint division_limit, + uint age_threshold); +extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, + size_t use_mem, uint division_limit, + uint age_threshold); +extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit, + uint age_threshold); +extern uchar *key_cache_read(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length,int return_buffer); +extern int key_cache_insert(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length); +extern int key_cache_write(KEY_CACHE *keycache, + File file, my_off_t filepos, int level, + uchar *buff, uint length, + uint block_length,int force_write); +extern int flush_key_blocks(KEY_CACHE *keycache, + int file, enum flush_type type); +extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup); +extern my_bool multi_keycache_init(void); +extern void multi_keycache_free(void); +extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length); +extern my_bool multi_key_cache_set(const uchar *key, uint length, + KEY_CACHE *key_cache); +extern void multi_key_cache_change(KEY_CACHE *old_data, + KEY_CACHE *new_data); +extern int reset_key_cache_counters(const char *name, + KEY_CACHE *key_cache); +enum legacy_db_type +{ + DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1, + DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM, + DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM, + DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM, + DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, + DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER, + DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_CSV_DB, + DB_TYPE_FEDERATED_DB, + DB_TYPE_BLACKHOLE_DB, + DB_TYPE_PARTITION_DB, + DB_TYPE_BINLOG, + DB_TYPE_SOLID, + DB_TYPE_PBXT, + DB_TYPE_TABLE_FUNCTION, + DB_TYPE_MEMCACHE, + DB_TYPE_FALCON, + DB_TYPE_MARIA, + DB_TYPE_FIRST_DYNAMIC=42, + DB_TYPE_DEFAULT=127 +}; +enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, + ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED, + ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE }; +enum enum_binlog_func { + BFN_RESET_LOGS= 1, + BFN_RESET_SLAVE= 2, + BFN_BINLOG_WAIT= 3, + BFN_BINLOG_END= 4, + BFN_BINLOG_PURGE_FILE= 5 +}; +enum enum_binlog_command { + LOGCOM_CREATE_TABLE, + LOGCOM_ALTER_TABLE, + LOGCOM_RENAME_TABLE, + LOGCOM_DROP_TABLE, + LOGCOM_CREATE_DB, + LOGCOM_ALTER_DB, + LOGCOM_DROP_DB +}; +typedef ulonglong my_xid; +struct xid_t { + long formatID; + long gtrid_length; + long bqual_length; + char data[128]; + xid_t() {} + In_C_you_should_use_my_bool_instead() eq(struct xid_t *xid) + { return eq(xid->gtrid_length, xid->bqual_length, xid->data); } + In_C_you_should_use_my_bool_instead() eq(long g, long b, const char *d) + { return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); } + void set(struct xid_t *xid) + { memcpy(this, xid, xid->length()); } + void set(long f, const char *g, long gl, const char *b, long bl) + { + formatID= f; + memcpy(data, g, gtrid_length= gl); + memcpy(data+gl, b, bqual_length= bl); + } + void set(ulonglong xid) + { + my_xid tmp; + formatID= 1; + set(8, 0, "MySQLXid"); + memcpy(data+8, &server_id, sizeof(server_id)); + tmp= xid; + memcpy(data+(8 +sizeof(server_id)), &tmp, sizeof(tmp)); + gtrid_length=((8 +sizeof(server_id))+sizeof(my_xid)); + } + void set(long g, long b, const char *d) + { + formatID= 1; + gtrid_length= g; + bqual_length= b; + memcpy(data, d, g+b); + } + In_C_you_should_use_my_bool_instead() is_null() { return formatID == -1; } + void null() { formatID= -1; } + my_xid quick_get_my_xid() + { + my_xid tmp; + memcpy(&tmp, data+(8 +sizeof(server_id)), sizeof(tmp)); + return tmp; + } + my_xid get_my_xid() + { + return gtrid_length == ((8 +sizeof(server_id))+sizeof(my_xid)) && bqual_length == 0 && + !memcmp(data+8, &server_id, sizeof(server_id)) && + !memcmp(data, "MySQLXid", 8) ? + quick_get_my_xid() : 0; + } + uint length() + { + return sizeof(formatID)+sizeof(gtrid_length)+sizeof(bqual_length)+ + gtrid_length+bqual_length; + } + uchar *key() + { + return (uchar *)>rid_length; + } + uint key_length() + { + return sizeof(gtrid_length)+sizeof(bqual_length)+gtrid_length+bqual_length; + } +}; +typedef struct xid_t XID; +enum ts_command_type +{ + TS_CMD_NOT_DEFINED = -1, + CREATE_TABLESPACE = 0, + ALTER_TABLESPACE = 1, + CREATE_LOGFILE_GROUP = 2, + ALTER_LOGFILE_GROUP = 3, + DROP_TABLESPACE = 4, + DROP_LOGFILE_GROUP = 5, + CHANGE_FILE_TABLESPACE = 6, + ALTER_ACCESS_MODE_TABLESPACE = 7 +}; +enum ts_alter_tablespace_type +{ + TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED = -1, + ALTER_TABLESPACE_ADD_FILE = 1, + ALTER_TABLESPACE_DROP_FILE = 2 +}; +enum tablespace_access_mode +{ + TS_NOT_DEFINED= -1, + TS_READ_ONLY = 0, + TS_READ_WRITE = 1, + TS_NOT_ACCESSIBLE = 2 +}; +struct handlerton; +class st_alter_tablespace : public Sql_alloc +{ + public: + const char *tablespace_name; + const char *logfile_group_name; + enum ts_command_type ts_cmd_type; + enum ts_alter_tablespace_type ts_alter_tablespace_type; + const char *data_file_name; + const char *undo_file_name; + const char *redo_file_name; + ulonglong extent_size; + ulonglong undo_buffer_size; + ulonglong redo_buffer_size; + ulonglong initial_size; + ulonglong autoextend_size; + ulonglong max_size; + uint nodegroup_id; + handlerton *storage_engine; + In_C_you_should_use_my_bool_instead() wait_until_completed; + const char *ts_comment; + enum tablespace_access_mode ts_access_mode; + st_alter_tablespace() + { + tablespace_name= NULL; + logfile_group_name= "DEFAULT_LG"; + ts_cmd_type= TS_CMD_NOT_DEFINED; + data_file_name= NULL; + undo_file_name= NULL; + redo_file_name= NULL; + extent_size= 1024*1024; + undo_buffer_size= 8*1024*1024; + redo_buffer_size= 8*1024*1024; + initial_size= 128*1024*1024; + autoextend_size= 0; + max_size= 0; + storage_engine= NULL; + nodegroup_id= 65535; + wait_until_completed= (1); + ts_comment= NULL; + ts_access_mode= TS_NOT_DEFINED; + } +}; +struct st_table; +typedef struct st_table TABLE; +typedef struct st_table_share TABLE_SHARE; +struct st_foreign_key_info; +typedef struct st_foreign_key_info FOREIGN_KEY_INFO; +typedef In_C_you_should_use_my_bool_instead() (stat_print_fn)(THD *thd, const char *type, uint type_len, + const char *file, uint file_len, + const char *status, uint status_len); +enum ha_stat_type { HA_ENGINE_STATUS, HA_ENGINE_LOGS, HA_ENGINE_MUTEX }; +extern st_plugin_int *hton2plugin[15]; +enum log_status +{ + HA_LOG_STATUS_FREE= 0, + HA_LOG_STATUS_INUSE= 1, + HA_LOG_STATUS_NOSUCHLOG= 2 +}; +void signal_log_not_needed(struct handlerton, char *log_file); +struct handler_log_file_data { + LEX_STRING filename; + enum log_status status; +}; +enum handler_iterator_type +{ + HA_TRANSACTLOG_ITERATOR= 1 +}; +enum handler_create_iterator_result +{ + HA_ITERATOR_OK, + HA_ITERATOR_UNSUPPORTED, + HA_ITERATOR_ERROR +}; +struct handler_iterator { + int (*next)(struct handler_iterator *, void *iterator_object); + void (*destroy)(struct handler_iterator *); + void *buffer; +}; +struct handlerton +{ + SHOW_COMP_OPTION state; + enum legacy_db_type db_type; + uint slot; + uint savepoint_offset; + int (*close_connection)(handlerton *hton, THD *thd); + int (*savepoint_set)(handlerton *hton, THD *thd, void *sv); + int (*savepoint_rollback)(handlerton *hton, THD *thd, void *sv); + int (*savepoint_release)(handlerton *hton, THD *thd, void *sv); + int (*commit)(handlerton *hton, THD *thd, In_C_you_should_use_my_bool_instead() all); + int (*rollback)(handlerton *hton, THD *thd, In_C_you_should_use_my_bool_instead() all); + int (*prepare)(handlerton *hton, THD *thd, In_C_you_should_use_my_bool_instead() all); + int (*recover)(handlerton *hton, XID *xid_list, uint len); + int (*commit_by_xid)(handlerton *hton, XID *xid); + int (*rollback_by_xid)(handlerton *hton, XID *xid); + void *(*create_cursor_read_view)(handlerton *hton, THD *thd); + void (*set_cursor_read_view)(handlerton *hton, THD *thd, void *read_view); + void (*close_cursor_read_view)(handlerton *hton, THD *thd, void *read_view); + handler *(*create)(handlerton *hton, TABLE_SHARE *table, MEM_ROOT *mem_root); + void (*drop_database)(handlerton *hton, char* path); + int (*panic)(handlerton *hton, enum ha_panic_function flag); + int (*start_consistent_snapshot)(handlerton *hton, THD *thd); + In_C_you_should_use_my_bool_instead() (*flush_logs)(handlerton *hton); + In_C_you_should_use_my_bool_instead() (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat); + uint (*partition_flags)(); + uint (*alter_table_flags)(uint flags); + int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info); + int (*fill_files_table)(handlerton *hton, THD *thd, + TABLE_LIST *tables, + class Item *cond); + uint32 flags; + int (*binlog_func)(handlerton *hton, THD *thd, enum_binlog_func fn, void *arg); + void (*binlog_log_query)(handlerton *hton, THD *thd, + enum_binlog_command binlog_command, + const char *query, uint query_length, + const char *db, const char *table_name); + int (*release_temporary_latches)(handlerton *hton, THD *thd); + enum log_status (*get_log_status)(handlerton *hton, char *log); + enum handler_create_iterator_result + (*create_iterator)(handlerton *hton, enum handler_iterator_type type, + struct handler_iterator *fill_this_in); + int (*discover)(handlerton *hton, THD* thd, const char *db, + const char *name, + uchar **frmblob, + size_t *frmlen); + int (*find_files)(handlerton *hton, THD *thd, + const char *db, + const char *path, + const char *wild, In_C_you_should_use_my_bool_instead() dir, List *files); + int (*table_exists_in_engine)(handlerton *hton, THD* thd, const char *db, + const char *name); + uint32 license; + void *data; +}; +class Ha_trx_info; +struct THD_TRANS +{ + In_C_you_should_use_my_bool_instead() no_2pc; + Ha_trx_info *ha_list; + In_C_you_should_use_my_bool_instead() modified_non_trans_table; + void reset() { no_2pc= (0); modified_non_trans_table= (0); } +}; +class Ha_trx_info +{ +public: + void register_ha(THD_TRANS *trans, handlerton *ht_arg) + { + assert(m_flags == 0); + assert(m_ht == NULL); + assert(m_next == NULL); + m_ht= ht_arg; + m_flags= (int) TRX_READ_ONLY; + m_next= trans->ha_list; + trans->ha_list= this; + } + void reset() + { + m_next= NULL; + m_ht= NULL; + m_flags= 0; + } + Ha_trx_info() { reset(); } + void set_trx_read_write() + { + assert(is_started()); + m_flags|= (int) TRX_READ_WRITE; + } + In_C_you_should_use_my_bool_instead() is_trx_read_write() const + { + assert(is_started()); + return m_flags & (int) TRX_READ_WRITE; + } + In_C_you_should_use_my_bool_instead() is_started() const { return m_ht != NULL; } + void coalesce_trx_with(const Ha_trx_info *stmt_trx) + { + assert(is_started()); + if (stmt_trx->is_trx_read_write()) + set_trx_read_write(); + } + Ha_trx_info *next() const + { + assert(is_started()); + return m_next; + } + handlerton *ht() const + { + assert(is_started()); + return m_ht; + } +private: + enum { TRX_READ_ONLY= 0, TRX_READ_WRITE= 1 }; + Ha_trx_info *m_next; + handlerton *m_ht; + uchar m_flags; +}; +enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, + ISO_REPEATABLE_READ, ISO_SERIALIZABLE}; +enum ndb_distribution { ND_KEYHASH= 0, ND_LINHASH= 1 }; +typedef struct { + ulonglong data_file_length; + ulonglong max_data_file_length; + ulonglong index_file_length; + ulonglong delete_length; + ha_rows records; + ulong mean_rec_length; + time_t create_time; + time_t check_time; + time_t update_time; + ulonglong check_sum; +} PARTITION_INFO; +class Item; +struct st_table_log_memory_entry; +class partition_info; +struct st_partition_iter; +enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES }; +typedef struct st_ha_create_information +{ + CHARSET_INFO *table_charset, *default_table_charset; + LEX_STRING connect_string; + const char *password, *tablespace; + LEX_STRING comment; + const char *data_file_name, *index_file_name; + const char *alias; + ulonglong max_rows,min_rows; + ulonglong auto_increment_value; + ulong table_options; + ulong avg_row_length; + ulong used_fields; + ulong key_block_size; + SQL_LIST merge_list; + handlerton *db_type; + enum row_type row_type; + uint null_bits; + uint options; + uint merge_insert_method; + uint extra_size; + enum ha_choice transactional; + In_C_you_should_use_my_bool_instead() table_existed; + In_C_you_should_use_my_bool_instead() frm_only; + In_C_you_should_use_my_bool_instead() varchar; + enum ha_storage_media storage_media; + enum ha_choice page_checksum; +} HA_CREATE_INFO; +typedef struct st_key_create_information +{ + enum ha_key_alg algorithm; + ulong block_size; + LEX_STRING parser_name; +} KEY_CREATE_INFO; +class TABLEOP_HOOKS +{ +public: + TABLEOP_HOOKS() {} + virtual ~TABLEOP_HOOKS() {} + inline void prelock(TABLE **tables, uint count) + { + do_prelock(tables, count); + } + inline int postlock(TABLE **tables, uint count) + { + return do_postlock(tables, count); + } +private: + virtual void do_prelock(TABLE **tables, uint count) + { + } + virtual int do_postlock(TABLE **tables, uint count) + { + return 0; + } +}; +typedef struct st_savepoint SAVEPOINT; +extern ulong savepoint_alloc_size; +extern KEY_CREATE_INFO default_key_create_info; +typedef class Item COND; +typedef struct st_ha_check_opt +{ + st_ha_check_opt() {} + ulong sort_buffer_size; + uint flags; + uint sql_flags; + KEY_CACHE *key_cache; + void init(); +} HA_CHECK_OPT; +typedef struct st_handler_buffer +{ + const uchar *buffer; + const uchar *buffer_end; + uchar *end_of_used_area; +} HANDLER_BUFFER; +typedef struct system_status_var SSV; +class ha_statistics +{ +public: + ulonglong data_file_length; + ulonglong max_data_file_length; + ulonglong index_file_length; + ulonglong max_index_file_length; + ulonglong delete_length; + ulonglong auto_increment_value; + ha_rows records; + ha_rows deleted; + ulong mean_rec_length; + time_t create_time; + time_t check_time; + time_t update_time; + uint block_size; + ha_statistics(): + data_file_length(0), max_data_file_length(0), + index_file_length(0), delete_length(0), auto_increment_value(0), + records(0), deleted(0), mean_rec_length(0), create_time(0), + check_time(0), update_time(0), block_size(0) + {} +}; +uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map); +class handler :public Sql_alloc +{ +public: + typedef ulonglong Table_flags; +protected: + struct st_table_share *table_share; + struct st_table *table; + Table_flags cached_table_flags; + ha_rows estimation_rows_to_insert; +public: + handlerton *ht; + uchar *ref; + uchar *dup_ref; + ha_statistics stats; + In_C_you_should_use_my_bool_instead() multi_range_sorted; + KEY_MULTI_RANGE *multi_range_curr; + KEY_MULTI_RANGE *multi_range_end; + HANDLER_BUFFER *multi_range_buffer; + key_range save_end_range, *end_range; + KEY_PART_INFO *range_key_part; + int key_compare_result_on_equal; + In_C_you_should_use_my_bool_instead() eq_range; + uint errkey; + uint key_used_on_scan; + uint active_index; + uint ref_length; + FT_INFO *ft_handler; + enum {NONE=0, INDEX, RND} inited; + In_C_you_should_use_my_bool_instead() locked; + In_C_you_should_use_my_bool_instead() implicit_emptied; + const COND *pushed_cond; + ulonglong next_insert_id; + ulonglong insert_id_for_cur_row; + Discrete_interval auto_inc_interval_for_cur_row; + handler(handlerton *ht_arg, TABLE_SHARE *share_arg) + :table_share(share_arg), table(0), + estimation_rows_to_insert(0), ht(ht_arg), + ref(0), key_used_on_scan(64), active_index(64), + ref_length(sizeof(my_off_t)), + ft_handler(0), inited(NONE), + locked((0)), implicit_emptied(0), + pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0) + {} + virtual ~handler(void) + { + assert(locked == (0)); + } + virtual handler *clone(MEM_ROOT *mem_root); + void init() + { + cached_table_flags= table_flags(); + } + int ha_open(TABLE *table, const char *name, int mode, int test_if_locked); + int ha_index_init(uint idx, In_C_you_should_use_my_bool_instead() sorted) + { + int result; + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_init","./sql/handler.h",1159,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + assert(inited==NONE); + if (!(result= index_init(idx, sorted))) + inited=INDEX; + do {_db_return_ (1163, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0); + } + int ha_index_end() + { + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_end","./sql/handler.h",1167,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + assert(inited==INDEX); + inited=NONE; + do {_db_return_ (1170, &_db_func_, &_db_file_, &_db_level_); return(index_end());} while(0); + } + int ha_rnd_init(In_C_you_should_use_my_bool_instead() scan) + { + int result; + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_init","./sql/handler.h",1175,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + assert(inited==NONE || (inited==RND && scan)); + inited= (result= rnd_init(scan)) ? NONE: RND; + do {_db_return_ (1178, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0); + } + int ha_rnd_end() + { + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_end","./sql/handler.h",1182,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + assert(inited==RND); + inited=NONE; + do {_db_return_ (1185, &_db_func_, &_db_file_, &_db_level_); return(rnd_end());} while(0); + } + int ha_reset(); + int ha_index_or_rnd_end() + { + return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0; + } + Table_flags ha_table_flags() const { return cached_table_flags; } + int ha_external_lock(THD *thd, int lock_type); + int ha_write_row(uchar * buf); + int ha_update_row(const uchar * old_data, uchar * new_data); + int ha_delete_row(const uchar * buf); + void ha_release_auto_increment(); + int ha_check_for_upgrade(HA_CHECK_OPT *check_opt); + int ha_check(THD *thd, HA_CHECK_OPT *check_opt); + int ha_repair(THD* thd, HA_CHECK_OPT* check_opt); + void ha_start_bulk_insert(ha_rows rows) + { + estimation_rows_to_insert= rows; + start_bulk_insert(rows); + } + int ha_end_bulk_insert() + { + estimation_rows_to_insert= 0; + return end_bulk_insert(); + } + int ha_bulk_update_row(const uchar *old_data, uchar *new_data, + uint *dup_key_found); + int ha_delete_all_rows(); + int ha_reset_auto_increment(ulonglong value); + int ha_backup(THD* thd, HA_CHECK_OPT* check_opt); + int ha_restore(THD* thd, HA_CHECK_OPT* check_opt); + int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt); + int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt); + In_C_you_should_use_my_bool_instead() ha_check_and_repair(THD *thd); + int ha_disable_indexes(uint mode); + int ha_enable_indexes(uint mode); + int ha_discard_or_import_tablespace(my_bool discard); + void ha_prepare_for_alter(); + int ha_rename_table(const char *from, const char *to); + int ha_delete_table(const char *name); + void ha_drop_table(const char *name); + int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info); + int ha_create_handler_files(const char *name, const char *old_name, + int action_flag, HA_CREATE_INFO *info); + int ha_change_partitions(HA_CREATE_INFO *create_info, + const char *path, + ulonglong *copied, + ulonglong *deleted, + const uchar *pack_frm_data, + size_t pack_frm_len); + int ha_drop_partitions(const char *path); + int ha_rename_partitions(const char *path); + int ha_optimize_partitions(THD *thd); + int ha_analyze_partitions(THD *thd); + int ha_check_partitions(THD *thd); + int ha_repair_partitions(THD *thd); + void adjust_next_insert_id_after_explicit_value(ulonglong nr); + int update_auto_increment(); + void print_keydup_error(uint key_nr, const char *msg); + virtual void print_error(int error, myf errflag); + virtual In_C_you_should_use_my_bool_instead() get_error_message(int error, String *buf); + uint get_dup_key(int error); + virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) + { + table= table_arg; + table_share= share; + } + virtual double scan_time() + { return ((double) (ulonglong) (stats.data_file_length)) / 4096 + 2; } + virtual double read_time(uint index, uint ranges, ha_rows rows) + { return ((double) (ulonglong) (ranges+rows)); } + virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; } + In_C_you_should_use_my_bool_instead() has_transactions() + { return (ha_table_flags() & (1 << 0)) == 0; } + virtual uint extra_rec_buf_length() const { return 0; } + virtual In_C_you_should_use_my_bool_instead() is_fatal_error(int error, uint flags) + { + if (!error || + ((flags & 1) && + (error == 121 || + error == 141))) + return (0); + return (1); + } + virtual ha_rows records() { return stats.records; } + virtual ha_rows estimate_rows_upper_bound() + { return stats.records+10; } + virtual enum row_type get_row_type() const { return ROW_TYPE_NOT_USED; } + virtual const char *index_type(uint key_number) { assert(0); return "";} + virtual void column_bitmaps_signal(); + uint get_index(void) const { return active_index; } + virtual int close(void)=0; + virtual In_C_you_should_use_my_bool_instead() start_bulk_update() { return 1; } + virtual In_C_you_should_use_my_bool_instead() start_bulk_delete() { return 1; } + virtual int exec_bulk_update(uint *dup_key_found) + { + assert((0)); + return 131; + } + virtual void end_bulk_update() { return; } + virtual int end_bulk_delete() + { + assert((0)); + return 131; + } + virtual int index_read_map(uchar * buf, const uchar * key, + key_part_map keypart_map, + enum ha_rkey_function find_flag) + { + uint key_len= calculate_key_len(table, active_index, key, keypart_map); + return index_read(buf, key, key_len, find_flag); + } + virtual int index_read_idx_map(uchar * buf, uint index, const uchar * key, + key_part_map keypart_map, + enum ha_rkey_function find_flag); + virtual int index_next(uchar * buf) + { return 131; } + virtual int index_prev(uchar * buf) + { return 131; } + virtual int index_first(uchar * buf) + { return 131; } + virtual int index_last(uchar * buf) + { return 131; } + virtual int index_next_same(uchar *buf, const uchar *key, uint keylen); + virtual int index_read_last_map(uchar * buf, const uchar * key, + key_part_map keypart_map) + { + uint key_len= calculate_key_len(table, active_index, key, keypart_map); + return index_read_last(buf, key, key_len); + } + virtual int read_multi_range_first(KEY_MULTI_RANGE **found_range_p, + KEY_MULTI_RANGE *ranges, uint range_count, + In_C_you_should_use_my_bool_instead() sorted, HANDLER_BUFFER *buffer); + virtual int read_multi_range_next(KEY_MULTI_RANGE **found_range_p); + virtual int read_range_first(const key_range *start_key, + const key_range *end_key, + In_C_you_should_use_my_bool_instead() eq_range, In_C_you_should_use_my_bool_instead() sorted); + virtual int read_range_next(); + int compare_key(key_range *range); + virtual int ft_init() { return 131; } + void ft_end() { ft_handler=NULL; } + virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key) + { return NULL; } + virtual int ft_read(uchar *buf) { return 131; } + virtual int rnd_next(uchar *buf)=0; + virtual int rnd_pos(uchar * buf, uchar *pos)=0; + virtual int rnd_pos_by_record(uchar *record) + { + position(record); + return rnd_pos(record, ref); + } + virtual int read_first_row(uchar *buf, uint primary_key); + virtual int restart_rnd_next(uchar *buf, uchar *pos) + { return 131; } + virtual int rnd_same(uchar *buf, uint inx) + { return 131; } + virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) + { return (ha_rows) 10; } + virtual void position(const uchar *record)=0; + virtual int info(uint)=0; + virtual void get_dynamic_partition_info(PARTITION_INFO *stat_info, + uint part_id); + virtual int extra(enum ha_extra_function operation) + { return 0; } + virtual int extra_opt(enum ha_extra_function operation, ulong cache_size) + { return extra(operation); } + virtual In_C_you_should_use_my_bool_instead() was_semi_consistent_read() { return 0; } + virtual void try_semi_consistent_read(In_C_you_should_use_my_bool_instead()) {} + virtual void unlock_row() {} + virtual int start_stmt(THD *thd, thr_lock_type lock_type) {return 0;} + virtual void get_auto_increment(ulonglong offset, ulonglong increment, + ulonglong nb_desired_values, + ulonglong *first_value, + ulonglong *nb_reserved_values); + void set_next_insert_id(ulonglong id) + { + do {_db_pargs_(1488,"info"); _db_doprnt_ ("auto_increment: next value %lu", (ulong)id);} while(0); + next_insert_id= id; + } + void restore_auto_increment(ulonglong prev_insert_id) + { + next_insert_id= (prev_insert_id > 0) ? prev_insert_id : + insert_id_for_cur_row; + } + virtual void update_create_info(HA_CREATE_INFO *create_info) {} + int check_old_types(); + virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual int dump(THD* thd, int fd = -1) { return 131; } + virtual int indexes_are_disabled(void) {return 0;} + virtual int net_read_dump(NET* net) { return 131; } + virtual char *update_table_comment(const char * comment) + { return (char*) comment;} + virtual void append_create_info(String *packet) {} + virtual In_C_you_should_use_my_bool_instead() is_fk_defined_on_table_or_index(uint index) + { return (0); } + virtual char* get_foreign_key_create_info() + { return(NULL);} + virtual char* get_tablespace_name(THD *thd, char *name, uint name_len) + { return(NULL);} + virtual In_C_you_should_use_my_bool_instead() can_switch_engines() { return 1; } + virtual int get_foreign_key_list(THD *thd, List *f_key_list) + { return 0; } + virtual uint referenced_by_foreign_key() { return 0;} + virtual void init_table_handle_for_HANDLER() + { return; } + virtual void free_foreign_key_create_info(char* str) {} + virtual const char *table_type() const =0; + virtual const char **bas_ext() const =0; + virtual int get_default_no_partitions(HA_CREATE_INFO *info) { return 1;} + virtual void set_auto_partitions(partition_info *part_info) { return; } + virtual In_C_you_should_use_my_bool_instead() get_no_parts(const char *name, + uint *no_parts) + { + *no_parts= 0; + return 0; + } + virtual void set_part_info(partition_info *part_info) {return;} + virtual ulong index_flags(uint idx, uint part, In_C_you_should_use_my_bool_instead() all_parts) const =0; + virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys) + { return (131); } + virtual int prepare_drop_index(TABLE *table_arg, uint *key_num, + uint num_of_keys) + { return (131); } + virtual int final_drop_index(TABLE *table_arg) + { return (131); } + uint max_record_length() const + { return ((65535) < (max_supported_record_length()) ? (65535) : (max_supported_record_length())); } + uint max_keys() const + { return ((64) < (max_supported_keys()) ? (64) : (max_supported_keys())); } + uint max_key_parts() const + { return ((16) < (max_supported_key_parts()) ? (16) : (max_supported_key_parts())); } + uint max_key_length() const + { return ((3072) < (max_supported_key_length()) ? (3072) : (max_supported_key_length())); } + uint max_key_part_length() const + { return ((3072) < (max_supported_key_part_length()) ? (3072) : (max_supported_key_part_length())); } + virtual uint max_supported_record_length() const { return 65535; } + virtual uint max_supported_keys() const { return 0; } + virtual uint max_supported_key_parts() const { return 16; } + virtual uint max_supported_key_length() const { return 3072; } + virtual uint max_supported_key_part_length() const { return 255; } + virtual uint min_record_length(uint options) const { return 1; } + virtual In_C_you_should_use_my_bool_instead() low_byte_first() const { return 1; } + virtual uint checksum() const { return 0; } + virtual In_C_you_should_use_my_bool_instead() is_crashed() const { return 0; } + virtual In_C_you_should_use_my_bool_instead() auto_repair() const { return 0; } + virtual uint lock_count(void) const { return 1; } + virtual THR_LOCK_DATA **store_lock(THD *thd, + THR_LOCK_DATA **to, + enum thr_lock_type lock_type)=0; + virtual uint8 table_cache_type() { return 0; } + virtual my_bool register_query_cache_table(THD *thd, char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data) + { + *engine_callback= 0; + return (1); + } + virtual In_C_you_should_use_my_bool_instead() primary_key_is_clustered() { return (0); } + virtual int cmp_ref(const uchar *ref1, const uchar *ref2) + { + return memcmp(ref1, ref2, ref_length); + } + virtual const COND *cond_push(const COND *cond) { return cond; }; + virtual void cond_pop() { return; }; + virtual In_C_you_should_use_my_bool_instead() check_if_incompatible_data(HA_CREATE_INFO *create_info, + uint table_changes) + { return 1; } + virtual void use_hidden_primary_key(); +protected: + void ha_statistic_increment(ulong SSV::*offset) const; + void **ha_data(THD *) const; + THD *ha_thd(void) const; + virtual int rename_table(const char *from, const char *to); + virtual int delete_table(const char *name); +private: + inline void mark_trx_read_write(); +private: + virtual int open(const char *name, int mode, uint test_if_locked)=0; + virtual int index_init(uint idx, In_C_you_should_use_my_bool_instead() sorted) { active_index= idx; return 0; } + virtual int index_end() { active_index= 64; return 0; } + virtual int rnd_init(In_C_you_should_use_my_bool_instead() scan)= 0; + virtual int rnd_end() { return 0; } + virtual int write_row(uchar *buf __attribute__((unused))) + { + return 131; + } + virtual int update_row(const uchar *old_data __attribute__((unused)), + uchar *new_data __attribute__((unused))) + { + return 131; + } + virtual int delete_row(const uchar *buf __attribute__((unused))) + { + return 131; + } + virtual int reset() { return 0; } + virtual Table_flags table_flags(void) const= 0; + virtual int external_lock(THD *thd __attribute__((unused)), + int lock_type __attribute__((unused))) + { + return 0; + } + virtual void release_auto_increment() { return; }; + virtual int check_for_upgrade(HA_CHECK_OPT *check_opt) + { return 0; } + virtual int check(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual int repair(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual void start_bulk_insert(ha_rows rows) {} + virtual int end_bulk_insert() { return 0; } + virtual int index_read(uchar * buf, const uchar * key, uint key_len, + enum ha_rkey_function find_flag) + { return 131; } + virtual int index_read_last(uchar * buf, const uchar * key, uint key_len) + { return ((_my_thread_var())->thr_errno= 131); } + virtual int bulk_update_row(const uchar *old_data, uchar *new_data, + uint *dup_key_found) + { + assert((0)); + return 131; + } + virtual int delete_all_rows() + { return ((_my_thread_var())->thr_errno=131); } + virtual int reset_auto_increment(ulonglong value) + { return 131; } + virtual int backup(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual int restore(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual int optimize(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt) + { return -1; } + virtual In_C_you_should_use_my_bool_instead() check_and_repair(THD *thd) { return (1); } + virtual int disable_indexes(uint mode) { return 131; } + virtual int enable_indexes(uint mode) { return 131; } + virtual int discard_or_import_tablespace(my_bool discard) + { return ((_my_thread_var())->thr_errno=131); } + virtual void prepare_for_alter() { return; } + virtual void drop_table(const char *name); + virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info)=0; + virtual int create_handler_files(const char *name, const char *old_name, + int action_flag, HA_CREATE_INFO *info) + { return (0); } + virtual int change_partitions(HA_CREATE_INFO *create_info, + const char *path, + ulonglong *copied, + ulonglong *deleted, + const uchar *pack_frm_data, + size_t pack_frm_len) + { return 131; } + virtual int drop_partitions(const char *path) + { return 131; } + virtual int rename_partitions(const char *path) + { return 131; } + virtual int optimize_partitions(THD *thd) + { return 131; } + virtual int analyze_partitions(THD *thd) + { return 131; } + virtual int check_partitions(THD *thd) + { return 131; } + virtual int repair_partitions(THD *thd) + { return 131; } +}; +extern const char *ha_row_type[]; +extern const char *tx_isolation_names[]; +extern const char *binlog_format_names[]; +extern TYPELIB tx_isolation_typelib; +extern TYPELIB myisam_stats_method_typelib; +extern ulong total_ha, total_ha_2pc; +handlerton *ha_default_handlerton(THD *thd); +plugin_ref ha_resolve_by_name(THD *thd, const LEX_STRING *name); +plugin_ref ha_lock_engine(THD *thd, handlerton *hton); +handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type); +handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc, + handlerton *db_type); +handlerton *ha_checktype(THD *thd, enum legacy_db_type database_type, + In_C_you_should_use_my_bool_instead() no_substitute, In_C_you_should_use_my_bool_instead() report_error); +static inline enum legacy_db_type ha_legacy_type(const handlerton *db_type) +{ + return (db_type == NULL) ? DB_TYPE_UNKNOWN : db_type->db_type; +} +static inline const char *ha_resolve_storage_engine_name(const handlerton *db_type) +{ + return db_type == NULL ? "UNKNOWN" : hton2plugin[db_type->slot]->name.str; +} +static inline In_C_you_should_use_my_bool_instead() ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag) +{ + return db_type == NULL ? (0) : ((db_type->flags & flag) ? 1 : 0); +} +static inline In_C_you_should_use_my_bool_instead() ha_storage_engine_is_enabled(const handlerton *db_type) +{ + return (db_type && db_type->create) ? + (db_type->state == SHOW_OPTION_YES) : (0); +} +int ha_init_errors(void); +int ha_init(void); +int ha_end(void); +int ha_initialize_handlerton(st_plugin_int *plugin); +int ha_finalize_handlerton(st_plugin_int *plugin); +TYPELIB *ha_known_exts(void); +int ha_panic(enum ha_panic_function flag); +void ha_close_connection(THD* thd); +In_C_you_should_use_my_bool_instead() ha_flush_logs(handlerton *db_type); +void ha_drop_database(char* path); +int ha_create_table(THD *thd, const char *path, + const char *db, const char *table_name, + HA_CREATE_INFO *create_info, + In_C_you_should_use_my_bool_instead() update_create_info); +int ha_delete_table(THD *thd, handlerton *db_type, const char *path, + const char *db, const char *alias, In_C_you_should_use_my_bool_instead() generate_warning); +In_C_you_should_use_my_bool_instead() ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat); +int ha_create_table_from_engine(THD* thd, const char *db, const char *name); +int ha_discover(THD* thd, const char* dbname, const char* name, + uchar** frmblob, size_t* frmlen); +int ha_find_files(THD *thd,const char *db,const char *path, + const char *wild, In_C_you_should_use_my_bool_instead() dir, List* files); +int ha_table_exists_in_engine(THD* thd, const char* db, const char* name); +extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache); +int ha_resize_key_cache(KEY_CACHE *key_cache); +int ha_change_key_cache_param(KEY_CACHE *key_cache); +int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache); +int ha_end_key_cache(KEY_CACHE *key_cache); +int ha_release_temporary_latches(THD *thd); +int ha_start_consistent_snapshot(THD *thd); +int ha_commit_or_rollback_by_xid(XID *xid, In_C_you_should_use_my_bool_instead() commit); +int ha_commit_one_phase(THD *thd, In_C_you_should_use_my_bool_instead() all); +int ha_rollback_trans(THD *thd, In_C_you_should_use_my_bool_instead() all); +int ha_prepare(THD *thd); +int ha_recover(HASH *commit_list); +int ha_commit_trans(THD *thd, In_C_you_should_use_my_bool_instead() all); +int ha_autocommit_or_rollback(THD *thd, int error); +int ha_enable_transaction(THD *thd, In_C_you_should_use_my_bool_instead() on); +int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv); +int ha_savepoint(THD *thd, SAVEPOINT *sv); +int ha_release_savepoint(THD *thd, SAVEPOINT *sv); +void trans_register_ha(THD *thd, In_C_you_should_use_my_bool_instead() all, handlerton *ht); +#include "parse_file.h" +enum file_opt_type { + FILE_OPTIONS_STRING, + FILE_OPTIONS_ESTRING, + FILE_OPTIONS_ULONGLONG, + FILE_OPTIONS_REV, + FILE_OPTIONS_TIMESTAMP, + FILE_OPTIONS_STRLIST, + FILE_OPTIONS_ULLLIST +}; +struct File_option +{ + LEX_STRING name; + int offset; + file_opt_type type; +}; +class Unknown_key_hook +{ +public: + Unknown_key_hook() {} + virtual ~Unknown_key_hook() {} + virtual In_C_you_should_use_my_bool_instead() process_unknown_string(char *&unknown_key, uchar* base, + MEM_ROOT *mem_root, char *end)= 0; +}; +class File_parser_dummy_hook: public Unknown_key_hook +{ +public: + File_parser_dummy_hook() {} + virtual In_C_you_should_use_my_bool_instead() process_unknown_string(char *&unknown_key, uchar* base, + MEM_ROOT *mem_root, char *end); +}; +extern File_parser_dummy_hook file_parser_dummy_hook; +In_C_you_should_use_my_bool_instead() get_file_options_ulllist(char *&ptr, char *end, char *line, + uchar* base, File_option *parameter, + MEM_ROOT *mem_root); +char * +parse_escaped_string(char *ptr, char *end, MEM_ROOT *mem_root, LEX_STRING *str); +class File_parser; +File_parser *sql_parse_prepare(const LEX_STRING *file_name, + MEM_ROOT *mem_root, In_C_you_should_use_my_bool_instead() bad_format_errors); +my_bool +sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, + const LEX_STRING *type, + uchar* base, File_option *parameters, uint versions); +my_bool rename_in_schema_file(const char *schema, const char *old_name, + const char *new_name, ulonglong revision, + uint num_view_backups); +class File_parser: public Sql_alloc +{ + char *buff, *start, *end; + LEX_STRING file_type; + my_bool content_ok; +public: + File_parser() :buff(0), start(0), end(0), content_ok(0) + { file_type.str= 0; file_type.length= 0; } + my_bool ok() { return content_ok; } + LEX_STRING *type() { return &file_type; } + my_bool parse(uchar* base, MEM_ROOT *mem_root, + struct File_option *parameters, uint required, + Unknown_key_hook *hook); + friend File_parser *sql_parse_prepare(const LEX_STRING *file_name, + MEM_ROOT *mem_root, + In_C_you_should_use_my_bool_instead() bad_format_errors); +}; +#include "table.h" +class Item; +class Item_subselect; +class GRANT_TABLE; +class st_select_lex_unit; +class st_select_lex; +class partition_info; +class COND_EQUAL; +class Security_context; +class View_creation_ctx : public Default_object_creation_ctx, + public Sql_alloc +{ +public: + static View_creation_ctx *create(THD *thd); + static View_creation_ctx *create(THD *thd, + TABLE_LIST *view); +private: + View_creation_ctx(THD *thd) + : Default_object_creation_ctx(thd) + { } +}; +typedef struct st_order { + struct st_order *next; + Item **item; + Item *item_ptr; + Item **item_copy; + int counter; + In_C_you_should_use_my_bool_instead() asc; + In_C_you_should_use_my_bool_instead() free_me; + In_C_you_should_use_my_bool_instead() in_field_list; + In_C_you_should_use_my_bool_instead() counter_used; + Field *field; + char *buff; + table_map used, depend_map; +} ORDER; +typedef struct st_grant_info +{ + GRANT_TABLE *grant_table; + uint version; + ulong privilege; + ulong want_privilege; + ulong orig_want_privilege; +} GRANT_INFO; +enum tmp_table_type +{ + NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE, + INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE +}; +enum trg_event_type +{ + TRG_EVENT_INSERT= 0, + TRG_EVENT_UPDATE= 1, + TRG_EVENT_DELETE= 2, + TRG_EVENT_MAX +}; +enum frm_type_enum +{ + FRMTYPE_ERROR= 0, + FRMTYPE_TABLE, + FRMTYPE_VIEW +}; +enum release_type { RELEASE_NORMAL, RELEASE_WAIT_FOR_DROP }; +typedef struct st_filesort_info +{ + IO_CACHE *io_cache; + uchar **sort_keys; + uchar *buffpek; + uint buffpek_len; + uchar *addon_buf; + size_t addon_length; + struct st_sort_addon_field *addon_field; + void (*unpack)(struct st_sort_addon_field *, uchar *); + uchar *record_pointers; + ha_rows found_records; +} FILESORT_INFO; +enum timestamp_auto_set_type +{ + TIMESTAMP_NO_AUTO_SET= 0, TIMESTAMP_AUTO_SET_ON_INSERT= 1, + TIMESTAMP_AUTO_SET_ON_UPDATE= 2, TIMESTAMP_AUTO_SET_ON_BOTH= 3 +}; +class Field_timestamp; +class Field_blob; +class Table_triggers_list; +enum enum_table_category +{ + TABLE_UNKNOWN_CATEGORY=0, + TABLE_CATEGORY_TEMPORARY=1, + TABLE_CATEGORY_USER=2, + TABLE_CATEGORY_SYSTEM=3, + TABLE_CATEGORY_INFORMATION=4, + TABLE_CATEGORY_PERFORMANCE=5 +}; +typedef enum enum_table_category TABLE_CATEGORY; +TABLE_CATEGORY get_table_category(const LEX_STRING *db, + const LEX_STRING *name); +typedef struct st_table_share +{ + st_table_share() {} + TABLE_CATEGORY table_category; + HASH name_hash; + MEM_ROOT mem_root; + TYPELIB keynames; + TYPELIB fieldnames; + TYPELIB *intervals; + pthread_mutex_t mutex; + pthread_cond_t cond; + struct st_table_share *next, + **prev; + Field **field; + Field **found_next_number_field; + Field *timestamp_field; + KEY *key_info; + uint *blob_field; + uchar *default_values; + LEX_STRING comment; + CHARSET_INFO *table_charset; + MY_BITMAP all_set; + LEX_STRING table_cache_key; + LEX_STRING db; + LEX_STRING table_name; + LEX_STRING path; + LEX_STRING normalized_path; + LEX_STRING connect_string; + key_map keys_in_use; + key_map keys_for_keyread; + ha_rows min_rows, max_rows; + ulong avg_row_length; + ulong raid_chunksize; + ulong version, mysql_version; + ulong timestamp_offset; + ulong reclength; + plugin_ref db_plugin; + inline handlerton *db_type() const + { + return db_plugin ? ((handlerton*)((db_plugin)[0]->data)) : NULL; + } + enum row_type row_type; + enum tmp_table_type tmp_table; + enum ha_choice transactional; + enum ha_choice page_checksum; + uint ref_count; + uint open_count; + uint blob_ptr_size; + uint key_block_size; + uint null_bytes, last_null_bit_pos; + uint fields; + uint rec_buff_length; + uint keys, key_parts; + uint max_key_length, max_unique_length, total_key_length; + uint uniques; + uint null_fields; + uint blob_fields; + uint timestamp_field_offset; + uint varchar_fields; + uint db_create_options; + uint db_options_in_use; + uint db_record_offset; + uint raid_type, raid_chunks; + uint rowid_field_offset; + uint primary_key; + uint next_number_index; + uint next_number_key_offset; + uint next_number_keypart; + uint error, open_errno, errarg; + uint column_bitmap_size; + uchar frm_version; + In_C_you_should_use_my_bool_instead() null_field_first; + In_C_you_should_use_my_bool_instead() system; + In_C_you_should_use_my_bool_instead() crypted; + In_C_you_should_use_my_bool_instead() db_low_byte_first; + In_C_you_should_use_my_bool_instead() crashed; + In_C_you_should_use_my_bool_instead() is_view; + In_C_you_should_use_my_bool_instead() name_lock, replace_with_name_lock; + In_C_you_should_use_my_bool_instead() waiting_on_cond; + ulong table_map_id; + ulonglong table_map_version; + int cached_row_logging_check; + void set_table_cache_key(char *key_buff, uint key_length) + { + table_cache_key.str= key_buff; + table_cache_key.length= key_length; + db.str= table_cache_key.str; + db.length= strlen(db.str); + table_name.str= db.str + db.length + 1; + table_name.length= strlen(table_name.str); + } + void set_table_cache_key(char *key_buff, const char *key, uint key_length) + { + memcpy(key_buff, key, key_length); + set_table_cache_key(key_buff, key_length); + } + inline In_C_you_should_use_my_bool_instead() honor_global_locks() + { + return ((table_category == TABLE_CATEGORY_USER) + || (table_category == TABLE_CATEGORY_SYSTEM)); + } + inline In_C_you_should_use_my_bool_instead() require_write_privileges() + { + return (table_category == TABLE_CATEGORY_PERFORMANCE); + } + inline ulong get_table_def_version() + { + return table_map_id; + } + enum enum_table_ref_type get_table_ref_type() const + { + if (is_view) + return TABLE_REF_VIEW; + switch (tmp_table) { + case NO_TMP_TABLE: + return TABLE_REF_BASE_TABLE; + case SYSTEM_TMP_TABLE: + return TABLE_REF_I_S_TABLE; + default: + return TABLE_REF_TMP_TABLE; + } + } + ulong get_table_ref_version() const + { + return (tmp_table == SYSTEM_TMP_TABLE || is_view) ? 0 : table_map_id; + } +} TABLE_SHARE; +extern ulong refresh_version; +enum index_hint_type +{ + INDEX_HINT_IGNORE, + INDEX_HINT_USE, + INDEX_HINT_FORCE +}; +struct st_table { + st_table() {} + TABLE_SHARE *s; + handler *file; + struct st_table *next, *prev; + struct st_table *parent; + TABLE_LIST *child_l; + TABLE_LIST **child_last_l; + THD *in_use; + Field **field; + uchar *record[2]; + uchar *write_row_record; + uchar *insert_values; + key_map covering_keys; + key_map quick_keys, merge_keys; + key_map keys_in_use_for_query; + key_map keys_in_use_for_group_by; + key_map keys_in_use_for_order_by; + KEY *key_info; + Field *next_number_field; + Field *found_next_number_field; + Field_timestamp *timestamp_field; + Table_triggers_list *triggers; + TABLE_LIST *pos_in_table_list; + ORDER *group; + const char *alias; + uchar *null_flags; + my_bitmap_map *bitmap_init_value; + MY_BITMAP def_read_set, def_write_set, tmp_set; + MY_BITMAP *read_set, *write_set; + query_id_t query_id; + ha_rows quick_rows[64]; + key_part_map const_key_parts[64]; + uint quick_key_parts[64]; + uint quick_n_ranges[64]; + ha_rows quick_condition_rows; + timestamp_auto_set_type timestamp_field_type; + table_map map; + uint lock_position; + uint lock_data_start; + uint lock_count; + uint tablenr,used_fields; + uint temp_pool_slot; + uint status; + uint db_stat; + uint derived_select_number; + int current_lock; + my_bool copy_blobs; + uint maybe_null; + my_bool null_row; + my_bool force_index; + my_bool distinct,const_table,no_rows; + my_bool key_read, no_keyread; + my_bool open_placeholder; + my_bool locked_by_logger; + my_bool no_replicate; + my_bool locked_by_name; + my_bool fulltext_searched; + my_bool no_cache; + my_bool open_by_handler; + my_bool auto_increment_field_not_null; + my_bool insert_or_update; + my_bool alias_name_used; + my_bool get_fields_in_item_tree; + my_bool children_attached; + REGINFO reginfo; + MEM_ROOT mem_root; + GRANT_INFO grant; + FILESORT_INFO sort; + In_C_you_should_use_my_bool_instead() fill_item_list(List *item_list) const; + void reset_item_list(List *item_list) const; + void clear_column_bitmaps(void); + void prepare_for_position(void); + void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map); + void mark_columns_used_by_index(uint index); + void restore_column_maps_after_mark_index(); + void mark_auto_increment_column(void); + void mark_columns_needed_for_update(void); + void mark_columns_needed_for_delete(void); + void mark_columns_needed_for_insert(void); + inline void column_bitmaps_set(MY_BITMAP *read_set_arg, + MY_BITMAP *write_set_arg) + { + read_set= read_set_arg; + write_set= write_set_arg; + if (file) + file->column_bitmaps_signal(); + } + inline void column_bitmaps_set_no_signal(MY_BITMAP *read_set_arg, + MY_BITMAP *write_set_arg) + { + read_set= read_set_arg; + write_set= write_set_arg; + } + inline void use_all_columns() + { + column_bitmaps_set(&s->all_set, &s->all_set); + } + inline void default_column_bitmaps() + { + read_set= &def_read_set; + write_set= &def_write_set; + } + inline In_C_you_should_use_my_bool_instead() is_name_opened() { return db_stat || open_placeholder; } + inline In_C_you_should_use_my_bool_instead() needs_reopen_or_name_lock() + { return s->version != refresh_version; } + In_C_you_should_use_my_bool_instead() is_children_attached(void); +}; +enum enum_schema_table_state +{ + NOT_PROCESSED= 0, + PROCESSED_BY_CREATE_SORT_INDEX, + PROCESSED_BY_JOIN_EXEC +}; +typedef struct st_foreign_key_info +{ + LEX_STRING *forein_id; + LEX_STRING *referenced_db; + LEX_STRING *referenced_table; + LEX_STRING *update_method; + LEX_STRING *delete_method; + LEX_STRING *referenced_key_name; + List foreign_fields; + List referenced_fields; +} FOREIGN_KEY_INFO; +enum enum_schema_tables +{ + SCH_CHARSETS= 0, + SCH_COLLATIONS, + SCH_COLLATION_CHARACTER_SET_APPLICABILITY, + SCH_COLUMNS, + SCH_COLUMN_PRIVILEGES, + SCH_ENGINES, + SCH_EVENTS, + SCH_FILES, + SCH_GLOBAL_STATUS, + SCH_GLOBAL_VARIABLES, + SCH_KEY_COLUMN_USAGE, + SCH_OPEN_TABLES, + SCH_PARTITIONS, + SCH_PLUGINS, + SCH_PROCESSLIST, + SCH_PROFILES, + SCH_REFERENTIAL_CONSTRAINTS, + SCH_PROCEDURES, + SCH_SCHEMATA, + SCH_SCHEMA_PRIVILEGES, + SCH_SESSION_STATUS, + SCH_SESSION_VARIABLES, + SCH_STATISTICS, + SCH_STATUS, + SCH_TABLES, + SCH_TABLE_CONSTRAINTS, + SCH_TABLE_NAMES, + SCH_TABLE_PRIVILEGES, + SCH_TRIGGERS, + SCH_USER_PRIVILEGES, + SCH_VARIABLES, + SCH_VIEWS +}; +typedef struct st_field_info +{ + const char* field_name; + uint field_length; + enum enum_field_types field_type; + int value; + uint field_flags; + const char* old_name; + uint open_method; +} ST_FIELD_INFO; +struct TABLE_LIST; +typedef class Item COND; +typedef struct st_schema_table +{ + const char* table_name; + ST_FIELD_INFO *fields_info; + TABLE *(*create_table) (THD *thd, TABLE_LIST *table_list); + int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond); + int (*old_format) (THD *thd, struct st_schema_table *schema_table); + int (*process_table) (THD *thd, TABLE_LIST *tables, TABLE *table, + In_C_you_should_use_my_bool_instead() res, LEX_STRING *db_name, LEX_STRING *table_name); + int idx_field1, idx_field2; + In_C_you_should_use_my_bool_instead() hidden; + uint i_s_requested_object; +} ST_SCHEMA_TABLE; +struct st_lex; +class select_union; +class TMP_TABLE_PARAM; +Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref, + const char *name); +struct Field_translator +{ + Item *item; + const char *name; +}; +class Natural_join_column: public Sql_alloc +{ +public: + Field_translator *view_field; + Field *table_field; + TABLE_LIST *table_ref; + In_C_you_should_use_my_bool_instead() is_common; +public: + Natural_join_column(Field_translator *field_param, TABLE_LIST *tab); + Natural_join_column(Field *field_param, TABLE_LIST *tab); + const char *name(); + Item *create_item(THD *thd); + Field *field(); + const char *table_name(); + const char *db_name(); + GRANT_INFO *grant(); +}; +class Index_hint; +struct TABLE_LIST +{ + TABLE_LIST() {} + inline void init_one_table(const char *db_name_arg, + const char *table_name_arg, + enum thr_lock_type lock_type_arg) + { + bzero((char*) this, sizeof(*this)); + db= (char*) db_name_arg; + table_name= alias= (char*) table_name_arg; + lock_type= lock_type_arg; + } + TABLE_LIST *next_local; + TABLE_LIST *next_global, **prev_global; + char *db, *alias, *table_name, *schema_table_name; + char *option; + Item *on_expr; + Item *prep_on_expr; + COND_EQUAL *cond_equal; + TABLE_LIST *natural_join; + In_C_you_should_use_my_bool_instead() is_natural_join; + List *join_using_fields; + List *join_columns; + In_C_you_should_use_my_bool_instead() is_join_columns_complete; + TABLE_LIST *next_name_resolution_table; + List *index_hints; + TABLE *table; + uint table_id; + select_union *derived_result; + TABLE_LIST *correspondent_table; + st_select_lex_unit *derived; + ST_SCHEMA_TABLE *schema_table; + st_select_lex *schema_select_lex; + In_C_you_should_use_my_bool_instead() schema_table_reformed; + TMP_TABLE_PARAM *schema_table_param; + st_select_lex *select_lex; + st_lex *view; + Field_translator *field_translation; + Field_translator *field_translation_end; + TABLE_LIST *merge_underlying_list; + List *view_tables; + TABLE_LIST *belong_to_view; + TABLE_LIST *referencing_view; + TABLE_LIST *parent_l; + Security_context *security_ctx; + Security_context *view_sctx; + In_C_you_should_use_my_bool_instead() allowed_show; + TABLE_LIST *next_leaf; + Item *where; + Item *check_option; + LEX_STRING select_stmt; + LEX_STRING md5; + LEX_STRING source; + LEX_STRING view_db; + LEX_STRING view_name; + LEX_STRING timestamp; + st_lex_user definer; + ulonglong file_version; + ulonglong updatable_view; + ulonglong revision; + ulonglong algorithm; + ulonglong view_suid; + ulonglong with_check; + uint8 effective_with_check; + uint8 effective_algorithm; + GRANT_INFO grant; + ulonglong engine_data; + qc_engine_callback callback_func; + thr_lock_type lock_type; + uint outer_join; + uint shared; + size_t db_length; + size_t table_name_length; + In_C_you_should_use_my_bool_instead() updatable; + In_C_you_should_use_my_bool_instead() straight; + In_C_you_should_use_my_bool_instead() updating; + In_C_you_should_use_my_bool_instead() force_index; + In_C_you_should_use_my_bool_instead() ignore_leaves; + table_map dep_tables; + table_map on_expr_dep_tables; + struct st_nested_join *nested_join; + TABLE_LIST *embedding; + List *join_list; + In_C_you_should_use_my_bool_instead() cacheable_table; + In_C_you_should_use_my_bool_instead() table_in_first_from_clause; + In_C_you_should_use_my_bool_instead() skip_temporary; + In_C_you_should_use_my_bool_instead() contain_auto_increment; + In_C_you_should_use_my_bool_instead() multitable_view; + In_C_you_should_use_my_bool_instead() compact_view_format; + In_C_you_should_use_my_bool_instead() where_processed; + In_C_you_should_use_my_bool_instead() check_option_processed; + enum frm_type_enum required_type; + handlerton *db_type; + char timestamp_buffer[20]; + In_C_you_should_use_my_bool_instead() prelocking_placeholder; + In_C_you_should_use_my_bool_instead() create; + In_C_you_should_use_my_bool_instead() internal_tmp_table; + View_creation_ctx *view_creation_ctx; + LEX_STRING view_client_cs_name; + LEX_STRING view_connection_cl_name; + LEX_STRING view_body_utf8; + uint8 trg_event_map; + uint i_s_requested_object; + In_C_you_should_use_my_bool_instead() has_db_lookup_value; + In_C_you_should_use_my_bool_instead() has_table_lookup_value; + uint table_open_method; + enum enum_schema_table_state schema_table_state; + void calc_md5(char *buffer); + void set_underlying_merge(); + int view_check_option(THD *thd, In_C_you_should_use_my_bool_instead() ignore_failure); + In_C_you_should_use_my_bool_instead() setup_underlying(THD *thd); + void cleanup_items(); + In_C_you_should_use_my_bool_instead() placeholder() + { + return derived || view || schema_table || create && !table->db_stat || + !table; + } + void print(THD *thd, String *str, enum_query_type query_type); + In_C_you_should_use_my_bool_instead() check_single_table(TABLE_LIST **table, table_map map, + TABLE_LIST *view); + In_C_you_should_use_my_bool_instead() set_insert_values(MEM_ROOT *mem_root); + void hide_view_error(THD *thd); + TABLE_LIST *find_underlying_table(TABLE *table); + TABLE_LIST *first_leaf_for_name_resolution(); + TABLE_LIST *last_leaf_for_name_resolution(); + In_C_you_should_use_my_bool_instead() is_leaf_for_name_resolution(); + inline TABLE_LIST *top_table() + { return belong_to_view ? belong_to_view : this; } + inline In_C_you_should_use_my_bool_instead() prepare_check_option(THD *thd) + { + In_C_you_should_use_my_bool_instead() res= (0); + if (effective_with_check) + res= prep_check_option(thd, effective_with_check); + return res; + } + inline In_C_you_should_use_my_bool_instead() prepare_where(THD *thd, Item **conds, + In_C_you_should_use_my_bool_instead() no_where_clause) + { + if (effective_algorithm == 2) + return prep_where(thd, conds, no_where_clause); + return (0); + } + void register_want_access(ulong want_access); + In_C_you_should_use_my_bool_instead() prepare_security(THD *thd); + Security_context *find_view_security_context(THD *thd); + In_C_you_should_use_my_bool_instead() prepare_view_securety_context(THD *thd); + void reinit_before_use(THD *thd); + Item_subselect *containing_subselect(); + In_C_you_should_use_my_bool_instead() process_index_hints(TABLE *table); + inline ulong get_child_def_version() + { + return child_def_version; + } + inline void set_child_def_version(ulong version) + { + child_def_version= version; + } + inline void init_child_def_version() + { + child_def_version= ~0UL; + } + inline + In_C_you_should_use_my_bool_instead() is_table_ref_id_equal(TABLE_SHARE *s) const + { + return (m_table_ref_type == s->get_table_ref_type() && + m_table_ref_version == s->get_table_ref_version()); + } + inline + void set_table_ref_id(TABLE_SHARE *s) + { + m_table_ref_type= s->get_table_ref_type(); + m_table_ref_version= s->get_table_ref_version(); + } +private: + In_C_you_should_use_my_bool_instead() prep_check_option(THD *thd, uint8 check_opt_type); + In_C_you_should_use_my_bool_instead() prep_where(THD *thd, Item **conds, In_C_you_should_use_my_bool_instead() no_where_clause); + ulong child_def_version; + enum enum_table_ref_type m_table_ref_type; + ulong m_table_ref_version; +}; +class Item; +class Field_iterator: public Sql_alloc +{ +public: + Field_iterator() {} + virtual ~Field_iterator() {} + virtual void set(TABLE_LIST *)= 0; + virtual void next()= 0; + virtual In_C_you_should_use_my_bool_instead() end_of_fields()= 0; + virtual const char *name()= 0; + virtual Item *create_item(THD *)= 0; + virtual Field *field()= 0; +}; +class Field_iterator_table: public Field_iterator +{ + Field **ptr; +public: + Field_iterator_table() :ptr(0) {} + void set(TABLE_LIST *table) { ptr= table->table->field; } + void set_table(TABLE *table) { ptr= table->field; } + void next() { ptr++; } + In_C_you_should_use_my_bool_instead() end_of_fields() { return *ptr == 0; } + const char *name(); + Item *create_item(THD *thd); + Field *field() { return *ptr; } +}; +class Field_iterator_view: public Field_iterator +{ + Field_translator *ptr, *array_end; + TABLE_LIST *view; +public: + Field_iterator_view() :ptr(0), array_end(0) {} + void set(TABLE_LIST *table); + void next() { ptr++; } + In_C_you_should_use_my_bool_instead() end_of_fields() { return ptr == array_end; } + const char *name(); + Item *create_item(THD *thd); + Item **item_ptr() {return &ptr->item; } + Field *field() { return 0; } + inline Item *item() { return ptr->item; } + Field_translator *field_translator() { return ptr; } +}; +class Field_iterator_natural_join: public Field_iterator +{ + List_iterator_fast column_ref_it; + Natural_join_column *cur_column_ref; +public: + Field_iterator_natural_join() :cur_column_ref(NULL) {} + ~Field_iterator_natural_join() {} + void set(TABLE_LIST *table); + void next(); + In_C_you_should_use_my_bool_instead() end_of_fields() { return !cur_column_ref; } + const char *name() { return cur_column_ref->name(); } + Item *create_item(THD *thd) { return cur_column_ref->create_item(thd); } + Field *field() { return cur_column_ref->field(); } + Natural_join_column *column_ref() { return cur_column_ref; } +}; +class Field_iterator_table_ref: public Field_iterator +{ + TABLE_LIST *table_ref, *first_leaf, *last_leaf; + Field_iterator_table table_field_it; + Field_iterator_view view_field_it; + Field_iterator_natural_join natural_join_it; + Field_iterator *field_it; + void set_field_iterator(); +public: + Field_iterator_table_ref() :field_it(NULL) {} + void set(TABLE_LIST *table); + void next(); + In_C_you_should_use_my_bool_instead() end_of_fields() + { return (table_ref == last_leaf && field_it->end_of_fields()); } + const char *name() { return field_it->name(); } + const char *table_name(); + const char *db_name(); + GRANT_INFO *grant(); + Item *create_item(THD *thd) { return field_it->create_item(thd); } + Field *field() { return field_it->field(); } + Natural_join_column *get_or_create_column_ref(TABLE_LIST *parent_table_ref); + Natural_join_column *get_natural_column_ref(); +}; +typedef struct st_nested_join +{ + List join_list; + table_map used_tables; + table_map not_null_tables; + struct st_join_table *first_nested; + uint counter; + nested_join_map nj_map; +} NESTED_JOIN; +typedef struct st_changed_table_list +{ + struct st_changed_table_list *next; + char *key; + uint32 key_length; +} CHANGED_TABLE_LIST; +typedef struct st_open_table_list{ + struct st_open_table_list *next; + char *db,*table; + uint32 in_use,locked; +} OPEN_TABLE_LIST; +typedef struct st_table_field_w_type +{ + LEX_STRING name; + LEX_STRING type; + LEX_STRING cset; +} TABLE_FIELD_W_TYPE; +my_bool +table_check_intact(TABLE *table, const uint table_f_count, + const TABLE_FIELD_W_TYPE *table_def); +static inline my_bitmap_map *tmp_use_all_columns(TABLE *table, + MY_BITMAP *bitmap) +{ + my_bitmap_map *old= bitmap->bitmap; + bitmap->bitmap= table->s->all_set.bitmap; + return old; +} +static inline void tmp_restore_column_map(MY_BITMAP *bitmap, + my_bitmap_map *old) +{ + bitmap->bitmap= old; +} +static inline my_bitmap_map *dbug_tmp_use_all_columns(TABLE *table, + MY_BITMAP *bitmap) +{ + return tmp_use_all_columns(table, bitmap); +} +static inline void dbug_tmp_restore_column_map(MY_BITMAP *bitmap, + my_bitmap_map *old) +{ + tmp_restore_column_map(bitmap, old); +} +size_t max_row_length(TABLE *table, const uchar *data); +#include "sql_error.h" +class MYSQL_ERROR: public Sql_alloc +{ +public: + enum enum_warning_level + { WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END}; + uint code; + enum_warning_level level; + char *msg; + MYSQL_ERROR(THD *thd, uint code_arg, enum_warning_level level_arg, + const char *msg_arg) + :code(code_arg), level(level_arg) + { + if (msg_arg) + set_msg(thd, msg_arg); + } + void set_msg(THD *thd, const char *msg_arg); +}; +MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, + uint code, const char *msg); +void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level, + uint code, const char *format, ...); +void mysql_reset_errors(THD *thd, In_C_you_should_use_my_bool_instead() force); +In_C_you_should_use_my_bool_instead() mysqld_show_warnings(THD *thd, ulong levels_to_show); +extern const LEX_STRING warning_level_names[]; +#include "field.h" +const uint32 max_field_size= (uint32) 4294967295U; +class Send_field; +class Protocol; +class Create_field; +struct st_cache_field; +int field_conv(Field *to,Field *from); +inline uint get_enum_pack_length(int elements) +{ + return elements < 256 ? 1 : 2; +} +inline uint get_set_pack_length(int elements) +{ + uint len= (elements + 7) / 8; + return len > 4 ? 8 : len; +} +class Field +{ + Field(const Item &); + void operator=(Field &); +public: + static void *operator new(size_t size) {return sql_alloc(size); } + static void operator delete(void *ptr_arg, size_t size) { ; } + uchar *ptr; + uchar *null_ptr; + struct st_table *table; + struct st_table *orig_table; + const char **table_name, *field_name; + LEX_STRING comment; + key_map key_start, part_of_key, part_of_key_not_clustered; + key_map part_of_sortkey; + enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL, + CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD, + BIT_FIELD, TIMESTAMP_OLD_FIELD, CAPITALIZE, BLOB_FIELD, + TIMESTAMP_DN_FIELD, TIMESTAMP_UN_FIELD, TIMESTAMP_DNUN_FIELD}; + enum geometry_type + { + GEOM_GEOMETRY = 0, GEOM_POINT = 1, GEOM_LINESTRING = 2, GEOM_POLYGON = 3, + GEOM_MULTIPOINT = 4, GEOM_MULTILINESTRING = 5, GEOM_MULTIPOLYGON = 6, + GEOM_GEOMETRYCOLLECTION = 7 + }; + enum imagetype { itRAW, itMBR}; + utype unireg_check; + uint32 field_length; + uint32 flags; + uint16 field_index; + uchar null_bit; + In_C_you_should_use_my_bool_instead() is_created_from_null_item; + Field(uchar *ptr_arg,uint32 length_arg,uchar *null_ptr_arg, + uchar null_bit_arg, utype unireg_check_arg, + const char *field_name_arg); + virtual ~Field() {} + virtual int store(const char *to, uint length,CHARSET_INFO *cs)=0; + virtual int store(double nr)=0; + virtual int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val)=0; + virtual int store_decimal(const my_decimal *d)=0; + virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type); + int store(const char *to, uint length, CHARSET_INFO *cs, + enum_check_fields check_level); + virtual double val_real(void)=0; + virtual longlong val_int(void)=0; + virtual my_decimal *val_decimal(my_decimal *); + inline String *val_str(String *str) { return val_str(str, str); } + virtual String *val_str(String*,String *)=0; + String *val_int_as_str(String *val_buffer, my_bool unsigned_flag); + virtual In_C_you_should_use_my_bool_instead() str_needs_quotes() { return (0); } + virtual Item_result result_type () const=0; + virtual Item_result cmp_type () const { return result_type(); } + virtual Item_result cast_to_int_type () const { return result_type(); } + static In_C_you_should_use_my_bool_instead() type_can_have_key_part(enum_field_types); + static enum_field_types field_type_merge(enum_field_types, enum_field_types); + static Item_result result_merge_type(enum_field_types); + virtual In_C_you_should_use_my_bool_instead() eq(Field *field) + { + return (ptr == field->ptr && null_ptr == field->null_ptr && + null_bit == field->null_bit); + } + virtual In_C_you_should_use_my_bool_instead() eq_def(Field *field); + virtual uint32 pack_length() const { return (uint32) field_length; } + virtual uint32 pack_length_in_rec() const { return pack_length(); } + virtual int compatible_field_size(uint field_metadata); + virtual uint pack_length_from_metadata(uint field_metadata) + { return field_metadata; } + virtual uint row_pack_length() { return 0; } + virtual int save_field_metadata(uchar *first_byte) + { return do_save_field_metadata(first_byte); } + virtual uint32 data_length() { return pack_length(); } + virtual uint32 sort_length() const { return pack_length(); } + virtual uint32 max_data_length() const { + return pack_length(); + }; + virtual int reset(void) { bzero(ptr,pack_length()); return 0; } + virtual void reset_fields() {} + virtual void set_default() + { + my_ptrdiff_t l_offset= (my_ptrdiff_t) (table->s->default_values - + table->record[0]); + memcpy(ptr, ptr + l_offset, pack_length()); + if (null_ptr) + *null_ptr= ((*null_ptr & (uchar) ~null_bit) | + null_ptr[l_offset] & null_bit); + } + virtual In_C_you_should_use_my_bool_instead() binary() const { return 1; } + virtual In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; } + virtual enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; } + virtual uint32 key_length() const { return pack_length(); } + virtual enum_field_types type() const =0; + virtual enum_field_types real_type() const { return type(); } + inline int cmp(const uchar *str) { return cmp(ptr,str); } + virtual int cmp_max(const uchar *a, const uchar *b, uint max_len) + { return cmp(a, b); } + virtual int cmp(const uchar *,const uchar *)=0; + virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L) + { return memcmp(a,b,pack_length()); } + virtual int cmp_offset(uint row_offset) + { return cmp(ptr,ptr+row_offset); } + virtual int cmp_binary_offset(uint row_offset) + { return cmp_binary(ptr, ptr+row_offset); }; + virtual int key_cmp(const uchar *a,const uchar *b) + { return cmp(a, b); } + virtual int key_cmp(const uchar *str, uint length) + { return cmp(ptr,str); } + virtual uint decimals() const { return 0; } + virtual void sql_type(String &str) const =0; + virtual uint size_of() const =0; + inline In_C_you_should_use_my_bool_instead() is_null(my_ptrdiff_t row_offset= 0) + { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : table->null_row; } + inline In_C_you_should_use_my_bool_instead() is_real_null(my_ptrdiff_t row_offset= 0) + { return null_ptr ? (null_ptr[row_offset] & null_bit ? 1 : 0) : 0; } + inline In_C_you_should_use_my_bool_instead() is_null_in_record(const uchar *record) + { + if (!null_ptr) + return 0; + return ((record[(uint) (null_ptr -table->record[0])] & null_bit) ? 1 : 0); + } + inline In_C_you_should_use_my_bool_instead() is_null_in_record_with_offset(my_ptrdiff_t offset) + { + if (!null_ptr) + return 0; + return ((null_ptr[offset] & null_bit) ? 1 : 0); + } + inline void set_null(my_ptrdiff_t row_offset= 0) + { if (null_ptr) null_ptr[row_offset]|= null_bit; } + inline void set_notnull(my_ptrdiff_t row_offset= 0) + { if (null_ptr) null_ptr[row_offset]&= (uchar) ~null_bit; } + inline In_C_you_should_use_my_bool_instead() maybe_null(void) { return null_ptr != 0 || table->maybe_null; } + inline In_C_you_should_use_my_bool_instead() real_maybe_null(void) { return null_ptr != 0; } + enum { + LAST_NULL_BYTE_UNDEF= 0 + }; + size_t last_null_byte() const { + size_t bytes= do_last_null_byte(); + do {_db_pargs_(284,"debug"); _db_doprnt_ ("last_null_byte() ==> %ld", (long) bytes);} while(0); + assert(bytes <= table->s->null_bytes); + return bytes; + } + virtual void make_field(Send_field *); + virtual void sort_string(uchar *buff,uint length)=0; + virtual In_C_you_should_use_my_bool_instead() optimize_range(uint idx, uint part); + virtual In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (0); } + virtual void free() {} + virtual Field *new_field(MEM_ROOT *root, struct st_table *new_table, + In_C_you_should_use_my_bool_instead() keep_type); + virtual Field *new_key_field(MEM_ROOT *root, struct st_table *new_table, + uchar *new_ptr, uchar *new_null_ptr, + uint new_null_bit); + Field *clone(MEM_ROOT *mem_root, struct st_table *new_table); + inline void move_field(uchar *ptr_arg,uchar *null_ptr_arg,uchar null_bit_arg) + { + ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg; + } + inline void move_field(uchar *ptr_arg) { ptr=ptr_arg; } + virtual void move_field_offset(my_ptrdiff_t ptr_diff) + { + ptr=(uchar*) ((uchar*) (ptr)+ptr_diff); + if (null_ptr) + null_ptr=(uchar*) ((uchar*) (null_ptr)+ptr_diff); + } + virtual void get_image(uchar *buff, uint length, CHARSET_INFO *cs) + { memcpy(buff,ptr,length); } + virtual void set_image(const uchar *buff,uint length, CHARSET_INFO *cs) + { memcpy(ptr,buff,length); } + virtual uint get_key_image(uchar *buff, uint length, imagetype type) + { + get_image(buff, length, &my_charset_bin); + return length; + } + virtual void set_key_image(const uchar *buff,uint length) + { set_image(buff,length, &my_charset_bin); } + inline longlong val_int_offset(uint row_offset) + { + ptr+=row_offset; + longlong tmp=val_int(); + ptr-=row_offset; + return tmp; + } + inline longlong val_int(const uchar *new_ptr) + { + uchar *old_ptr= ptr; + longlong return_value; + ptr= (uchar*) new_ptr; + return_value= val_int(); + ptr= old_ptr; + return return_value; + } + inline String *val_str(String *str, const uchar *new_ptr) + { + uchar *old_ptr= ptr; + ptr= (uchar*) new_ptr; + val_str(str); + ptr= old_ptr; + return str; + } + virtual In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + uchar *pack(uchar *to, const uchar *from) + { + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::pack","./sql/field.h",390,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + uchar *result= this->pack(to, from, UINT_MAX, table->s->db_low_byte_first); + do {_db_return_ (392, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0); + } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first); + const uchar *unpack(uchar* to, const uchar *from) + { + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::unpack","./sql/field.h",402,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + const uchar *result= unpack(to, from, 0U, table->s->db_low_byte_first); + do {_db_return_ (404, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0); + } + virtual uchar *pack_key(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + return pack(to, from, max_length, low_byte_first); + } + virtual uchar *pack_key_from_key_image(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + return pack(to, from, max_length, low_byte_first); + } + virtual const uchar *unpack_key(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + return unpack(to, from, max_length, low_byte_first); + } + virtual uint packed_col_length(const uchar *to, uint length) + { return length;} + virtual uint max_packed_col_length(uint max_length) + { return max_length;} + virtual int pack_cmp(const uchar *a,const uchar *b, uint key_length_arg, + my_bool insert_or_update) + { return cmp(a,b); } + virtual int pack_cmp(const uchar *b, uint key_length_arg, + my_bool insert_or_update) + { return cmp(ptr,b); } + uint offset(uchar *record) + { + return (uint) (ptr - record); + } + void copy_from_tmp(int offset); + uint fill_cache_field(struct st_cache_field *copy); + virtual In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + virtual In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); + virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; } + virtual CHARSET_INFO *sort_charset(void) const { return charset(); } + virtual In_C_you_should_use_my_bool_instead() has_charset(void) const { return (0); } + virtual void set_charset(CHARSET_INFO *charset_arg) { } + virtual enum Derivation derivation(void) const + { return DERIVATION_IMPLICIT; } + virtual void set_derivation(enum Derivation derivation_arg) { } + In_C_you_should_use_my_bool_instead() set_warning(MYSQL_ERROR::enum_warning_level, unsigned int code, + int cuted_increment); + void set_datetime_warning(MYSQL_ERROR::enum_warning_level, uint code, + const char *str, uint str_len, + timestamp_type ts_type, int cuted_increment); + void set_datetime_warning(MYSQL_ERROR::enum_warning_level, uint code, + longlong nr, timestamp_type ts_type, + int cuted_increment); + void set_datetime_warning(MYSQL_ERROR::enum_warning_level, const uint code, + double nr, timestamp_type ts_type); + inline In_C_you_should_use_my_bool_instead() check_overflow(int op_result) + { + return (op_result == 2); + } + int warn_if_overflow(int op_result); + void init(TABLE *table_arg) + { + orig_table= table= table_arg; + table_name= &table_arg->alias; + } + virtual uint32 max_display_length()= 0; + virtual uint is_equal(Create_field *new_field); + longlong convert_decimal2longlong(const my_decimal *val, In_C_you_should_use_my_bool_instead() unsigned_flag, + int *err); + inline uint32 char_length() const + { + return field_length / charset()->mbmaxlen; + } + virtual geometry_type get_geometry_type() + { + assert(0); + return GEOM_GEOMETRY; + } + virtual void hash(ulong *nr, ulong *nr2); + friend In_C_you_should_use_my_bool_instead() reopen_table(THD *,struct st_table *,In_C_you_should_use_my_bool_instead()); + friend int cre_myisam(char * name, register TABLE *form, uint options, + ulonglong auto_increment_value); + friend class Copy_field; + friend class Item_avg_field; + friend class Item_std_field; + friend class Item_sum_num; + friend class Item_sum_sum; + friend class Item_sum_str; + friend class Item_sum_count; + friend class Item_sum_avg; + friend class Item_sum_std; + friend class Item_sum_min; + friend class Item_sum_max; + friend class Item_func_group_concat; +private: + virtual size_t do_last_null_byte() const; + virtual int do_save_field_metadata(uchar *metadata_ptr) + { return 0; } +}; +class Field_num :public Field { +public: + const uint8 dec; + In_C_you_should_use_my_bool_instead() zerofill,unsigned_flag; + Field_num(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, utype unireg_check_arg, + const char *field_name_arg, + uint8 dec_arg, In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg); + Item_result result_type () const { return REAL_RESULT; } + void prepend_zeros(String *value); + void add_zerofill_and_unsigned(String &res) const; + friend class Create_field; + void make_field(Send_field *); + uint decimals() const { return (uint) dec; } + uint size_of() const { return sizeof(*this); } + In_C_you_should_use_my_bool_instead() eq_def(Field *field); + int store_decimal(const my_decimal *); + my_decimal *val_decimal(my_decimal *); + uint is_equal(Create_field *new_field); + int check_int(CHARSET_INFO *cs, const char *str, int length, + const char *int_end, int error); + In_C_you_should_use_my_bool_instead() get_int(CHARSET_INFO *cs, const char *from, uint len, + longlong *rnd, ulonglong unsigned_max, + longlong signed_min, longlong signed_max); +}; +class Field_str :public Field { +protected: + CHARSET_INFO *field_charset; + enum Derivation field_derivation; +public: + Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, utype unireg_check_arg, + const char *field_name_arg, CHARSET_INFO *charset); + Item_result result_type () const { return STRING_RESULT; } + uint decimals() const { return 31; } + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val)=0; + int store_decimal(const my_decimal *); + int store(const char *to,uint length,CHARSET_INFO *cs)=0; + uint size_of() const { return sizeof(*this); } + CHARSET_INFO *charset(void) const { return field_charset; } + void set_charset(CHARSET_INFO *charset_arg) { field_charset= charset_arg; } + enum Derivation derivation(void) const { return field_derivation; } + virtual void set_derivation(enum Derivation derivation_arg) + { field_derivation= derivation_arg; } + In_C_you_should_use_my_bool_instead() binary() const { return field_charset == &my_charset_bin; } + uint32 max_display_length() { return field_length; } + friend class Create_field; + my_decimal *val_decimal(my_decimal *); + virtual In_C_you_should_use_my_bool_instead() str_needs_quotes() { return (1); } + In_C_you_should_use_my_bool_instead() compare_str_field_flags(Create_field *new_field, uint32 flags); + uint is_equal(Create_field *new_field); +}; +class Field_longstr :public Field_str +{ +protected: + int report_if_important_data(const char *ptr, const char *end, + In_C_you_should_use_my_bool_instead() count_spaces); +public: + Field_longstr(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, utype unireg_check_arg, + const char *field_name_arg, CHARSET_INFO *charset_arg) + :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, + field_name_arg, charset_arg) + {} + int store_decimal(const my_decimal *d); + uint32 max_data_length() const; +}; +class Field_real :public Field_num { +public: + my_bool not_fixed; + Field_real(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, utype unireg_check_arg, + const char *field_name_arg, + uint8 dec_arg, In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, + field_name_arg, dec_arg, zero_arg, unsigned_arg), + not_fixed(dec_arg >= 31) + {} + int store_decimal(const my_decimal *); + my_decimal *val_decimal(my_decimal *); + int truncate(double *nr, double max_length); + uint32 max_display_length() { return field_length; } + uint size_of() const { return sizeof(*this); } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first); + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); +}; +class Field_decimal :public Field_real { +public: + Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + uint8 dec_arg,In_C_you_should_use_my_bool_instead() zero_arg,In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + dec_arg, zero_arg, unsigned_arg) + {} + enum_field_types type() const { return MYSQL_TYPE_DECIMAL;} + enum ha_base_keytype key_type() const + { return zerofill ? HA_KEYTYPE_BINARY : HA_KEYTYPE_NUM; } + int reset(void); + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + void overflow(In_C_you_should_use_my_bool_instead() negative); + In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; } + void sql_type(String &str) const; + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first) + { + return Field::unpack(to, from, param_data, low_byte_first); + } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + return Field::pack(to, from, max_length, low_byte_first); + } +}; +class Field_new_decimal :public Field_num { +private: + int do_save_field_metadata(uchar *first_byte); +public: + uint precision; + uint bin_size; + Field_new_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + uint8 dec_arg, In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg); + Field_new_decimal(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg, + const char *field_name_arg, uint8 dec_arg, + In_C_you_should_use_my_bool_instead() unsigned_arg); + enum_field_types type() const { return MYSQL_TYPE_NEWDECIMAL;} + enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; } + Item_result result_type () const { return DECIMAL_RESULT; } + int reset(void); + In_C_you_should_use_my_bool_instead() store_value(const my_decimal *decimal_value); + void set_value_on_overflow(my_decimal *decimal_value, In_C_you_should_use_my_bool_instead() sign); + int store(const char *to, uint length, CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int store_time(MYSQL_TIME *ltime, timestamp_type t_type); + int store_decimal(const my_decimal *); + double val_real(void); + longlong val_int(void); + my_decimal *val_decimal(my_decimal *); + String *val_str(String*, String *); + int cmp(const uchar *, const uchar *); + void sort_string(uchar *buff, uint length); + In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; } + void sql_type(String &str) const; + uint32 max_display_length() { return field_length; } + uint size_of() const { return sizeof(*this); } + uint32 pack_length() const { return (uint32) bin_size; } + uint pack_length_from_metadata(uint field_metadata); + uint row_pack_length() { return pack_length(); } + int compatible_field_size(uint field_metadata); + uint is_equal(Create_field *new_field); + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first); +}; +class Field_tiny :public Field_num { +public: + Field_tiny(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + 0, zero_arg,unsigned_arg) + {} + enum Item_result result_type () const { return INT_RESULT; } + enum_field_types type() const { return MYSQL_TYPE_TINY;} + enum ha_base_keytype key_type() const + { return unsigned_flag ? HA_KEYTYPE_BINARY : HA_KEYTYPE_INT8; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { ptr[0]=0; return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 1; } + void sql_type(String &str) const; + uint32 max_display_length() { return 4; } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + *to= *from; + return to + 1; + } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first) + { + *to= *from; + return from + 1; + } +}; +class Field_short :public Field_num { +public: + Field_short(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + 0, zero_arg,unsigned_arg) + {} + Field_short(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg, 0, 0, unsigned_arg) + {} + enum Item_result result_type () const { return INT_RESULT; } + enum_field_types type() const { return MYSQL_TYPE_SHORT;} + enum ha_base_keytype key_type() const + { return unsigned_flag ? HA_KEYTYPE_USHORT_INT : HA_KEYTYPE_SHORT_INT;} + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { ptr[0]=ptr[1]=0; return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 2; } + void sql_type(String &str) const; + uint32 max_display_length() { return 6; } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + int16 val; + do { val = (*((int16 *) (from))); } while(0); + *((uint16*) (to))= (uint16) (val); + return to + sizeof(val); + } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first) + { + int16 val; + do { val = (*((int16 *) (from))); } while(0); + *((uint16*) (to))= (uint16) (val); + return from + sizeof(val); + } +}; +class Field_medium :public Field_num { +public: + Field_medium(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + 0, zero_arg,unsigned_arg) + {} + enum Item_result result_type () const { return INT_RESULT; } + enum_field_types type() const { return MYSQL_TYPE_INT24;} + enum ha_base_keytype key_type() const + { return unsigned_flag ? HA_KEYTYPE_UINT24 : HA_KEYTYPE_INT24; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 3; } + void sql_type(String &str) const; + uint32 max_display_length() { return 8; } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + return Field::pack(to, from, max_length, low_byte_first); + } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first) + { + return Field::unpack(to, from, param_data, low_byte_first); + } +}; +class Field_long :public Field_num { +public: + Field_long(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + 0, zero_arg,unsigned_arg) + {} + Field_long(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg,0,0,unsigned_arg) + {} + enum Item_result result_type () const { return INT_RESULT; } + enum_field_types type() const { return MYSQL_TYPE_LONG;} + enum ha_base_keytype key_type() const + { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; } + double val_real(void); + longlong val_int(void); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + String *val_str(String*,String *); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 4; } + void sql_type(String &str) const; + uint32 max_display_length() { return 11; } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + int32 val; + do { val = (*((long *) (from))); } while(0); + *((long *) (to))= (long) (val); + return to + sizeof(val); + } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first) + { + int32 val; + do { val = (*((long *) (from))); } while(0); + *((long *) (to))= (long) (val); + return from + sizeof(val); + } +}; +class Field_longlong :public Field_num { +public: + Field_longlong(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() zero_arg, In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + 0, zero_arg,unsigned_arg) + {} + Field_longlong(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, + const char *field_name_arg, + In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_num((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg,0,0,unsigned_arg) + {} + enum Item_result result_type () const { return INT_RESULT; } + enum_field_types type() const { return MYSQL_TYPE_LONGLONG;} + enum ha_base_keytype key_type() const + { return unsigned_flag ? HA_KEYTYPE_ULONGLONG : HA_KEYTYPE_LONGLONG; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) + { + ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; + return 0; + } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 8; } + void sql_type(String &str) const; + In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); } + uint32 max_display_length() { return 20; } + virtual uchar *pack(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first) + { + int64 val; + memcpy(((uchar*) &val),((uchar*) (from)),(sizeof(ulonglong))); + memcpy(((uchar*) (to)),((uchar*) &val),(sizeof(ulonglong))); + return to + sizeof(val); + } + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first) + { + int64 val; + memcpy(((uchar*) &val),((uchar*) (from)),(sizeof(ulonglong))); + memcpy(((uchar*) (to)),((uchar*) &val),(sizeof(ulonglong))); + return from + sizeof(val); + } +}; +class Field_float :public Field_real { +public: + Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + uint8 dec_arg,In_C_you_should_use_my_bool_instead() zero_arg,In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + dec_arg, zero_arg, unsigned_arg) + {} + Field_float(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + uint8 dec_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, (uint) 0, + NONE, field_name_arg, dec_arg, 0, 0) + {} + enum_field_types type() const { return MYSQL_TYPE_FLOAT;} + enum ha_base_keytype key_type() const { return HA_KEYTYPE_FLOAT; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { bzero(ptr,sizeof(float)); return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return sizeof(float); } + uint row_pack_length() { return pack_length(); } + void sql_type(String &str) const; +private: + int do_save_field_metadata(uchar *first_byte); +}; +class Field_double :public Field_real { +public: + Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + uint8 dec_arg,In_C_you_should_use_my_bool_instead() zero_arg,In_C_you_should_use_my_bool_instead() unsigned_arg) + :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + dec_arg, zero_arg, unsigned_arg) + {} + Field_double(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + uint8 dec_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, + NONE, field_name_arg, dec_arg, 0, 0) + {} + Field_double(uint32 len_arg, In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + uint8 dec_arg, my_bool not_fixed_arg) + :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, + NONE, field_name_arg, dec_arg, 0, 0) + {not_fixed= not_fixed_arg; } + enum_field_types type() const { return MYSQL_TYPE_DOUBLE;} + enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { bzero(ptr,sizeof(double)); return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return sizeof(double); } + uint row_pack_length() { return pack_length(); } + void sql_type(String &str) const; +private: + int do_save_field_metadata(uchar *first_byte); +}; +class Field_null :public Field_str { + static uchar null[1]; +public: + Field_null(uchar *ptr_arg, uint32 len_arg, + enum utype unireg_check_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str(ptr_arg, len_arg, null, 1, + unireg_check_arg, field_name_arg, cs) + {} + enum_field_types type() const { return MYSQL_TYPE_NULL;} + int store(const char *to, uint length, CHARSET_INFO *cs) + { null[0]=1; return 0; } + int store(double nr) { null[0]=1; return 0; } + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val) { null[0]=1; return 0; } + int store_decimal(const my_decimal *d) { null[0]=1; return 0; } + int reset(void) { return 0; } + double val_real(void) { return 0.0;} + longlong val_int(void) { return 0;} + my_decimal *val_decimal(my_decimal *) { return 0; } + String *val_str(String *value,String *value2) + { value2->length(0); return value2;} + int cmp(const uchar *a, const uchar *b) { return 0;} + void sort_string(uchar *buff, uint length) {} + uint32 pack_length() const { return 0; } + void sql_type(String &str) const; + uint size_of() const { return sizeof(*this); } + uint32 max_display_length() { return 4; } +}; +class Field_timestamp :public Field_str { +public: + Field_timestamp(uchar *ptr_arg, uint32 len_arg, + uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + TABLE_SHARE *share, CHARSET_INFO *cs); + Field_timestamp(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs); + enum_field_types type() const { return MYSQL_TYPE_TIMESTAMP;} + enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; } + enum Item_result cmp_type () const { return INT_RESULT; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 4; } + void sql_type(String &str) const; + In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); } + In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; } + void set_time(); + virtual void set_default() + { + if (table->timestamp_field == this && + unireg_check != TIMESTAMP_UN_FIELD) + set_time(); + else + Field::set_default(); + } + inline long get_timestamp(my_bool *null_value) + { + if ((*null_value= is_null())) + return 0; + long tmp; + do { tmp = (*((long *) (ptr))); } while(0); + return tmp; + } + inline void store_timestamp(my_time_t timestamp) + { + *((long *) (ptr))= (long) ((uint32) timestamp); + } + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); + timestamp_auto_set_type get_auto_set_type() const; +}; +class Field_year :public Field_tiny { +public: + Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg) + :Field_tiny(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, 1, 1) + {} + enum_field_types type() const { return MYSQL_TYPE_YEAR;} + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + void sql_type(String &str) const; + In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); } +}; +class Field_date :public Field_str { +public: + Field_date(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, cs) + {} + Field_date(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str((uchar*) 0,10, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg, cs) {} + enum_field_types type() const { return MYSQL_TYPE_DATE;} + enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; } + enum Item_result cmp_type () const { return INT_RESULT; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 4; } + void sql_type(String &str) const; + In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); } + In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; } +}; +class Field_newdate :public Field_str { +public: + Field_newdate(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, cs) + {} + Field_newdate(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str((uchar*) 0,10, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg, cs) {} + enum_field_types type() const { return MYSQL_TYPE_DATE;} + enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; } + enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; } + enum Item_result cmp_type () const { return INT_RESULT; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int store_time(MYSQL_TIME *ltime, timestamp_type type); + int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 3; } + void sql_type(String &str) const; + In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); } + In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; } + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); +}; +class Field_time :public Field_str { +public: + Field_time(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str(ptr_arg, 8, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, cs) + {} + Field_time(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str((uchar*) 0,8, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg, cs) {} + enum_field_types type() const { return MYSQL_TYPE_TIME;} + enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; } + enum Item_result cmp_type () const { return INT_RESULT; } + int store_time(MYSQL_TIME *ltime, timestamp_type type); + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int reset(void) { ptr[0]=ptr[1]=ptr[2]=0; return 0; } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime, uint fuzzydate); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 3; } + void sql_type(String &str) const; + In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); } + In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; } +}; +class Field_datetime :public Field_str { +public: + Field_datetime(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str(ptr_arg, 19, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, cs) + {} + Field_datetime(In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_str((uchar*) 0,19, maybe_null_arg ? (uchar*) "": 0,0, + NONE, field_name_arg, cs) {} + enum_field_types type() const { return MYSQL_TYPE_DATETIME;} + enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; } + enum Item_result cmp_type () const { return INT_RESULT; } + uint decimals() const { return 6; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int store_time(MYSQL_TIME *ltime, timestamp_type type); + int reset(void) + { + ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; + return 0; + } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + In_C_you_should_use_my_bool_instead() send_binary(Protocol *protocol); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return 8; } + void sql_type(String &str) const; + In_C_you_should_use_my_bool_instead() can_be_compared_as_longlong() const { return (1); } + In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; } + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); +}; +class Field_string :public Field_longstr { +public: + In_C_you_should_use_my_bool_instead() can_alter_field_type; + Field_string(uchar *ptr_arg, uint32 len_arg,uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, cs), + can_alter_field_type(1) {}; + Field_string(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0, + NONE, field_name_arg, cs), + can_alter_field_type(1) {}; + enum_field_types type() const + { + return ((can_alter_field_type && orig_table && + orig_table->s->db_create_options & 1 && + field_length >= 4) && + orig_table->s->frm_version < (6 +4) ? + MYSQL_TYPE_VAR_STRING : MYSQL_TYPE_STRING); + } + enum ha_base_keytype key_type() const + { return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; } + In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; } + int reset(void) + { + charset()->cset->fill(charset(),(char*) ptr, field_length, + (has_charset() ? ' ' : 0)); + return 0; + } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int store(double nr) { return Field_str::store(nr); } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + my_decimal *val_decimal(my_decimal *); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + void sql_type(String &str) const; + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first); + uint pack_length_from_metadata(uint field_metadata) + { return (field_metadata & 0x00ff); } + uint row_pack_length() { return (field_length + 1); } + int pack_cmp(const uchar *a,const uchar *b,uint key_length, + my_bool insert_or_update); + int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update); + uint packed_col_length(const uchar *to, uint length); + uint max_packed_col_length(uint max_length); + uint size_of() const { return sizeof(*this); } + enum_field_types real_type() const { return MYSQL_TYPE_STRING; } + In_C_you_should_use_my_bool_instead() has_charset(void) const + { return charset() == &my_charset_bin ? (0) : (1); } + Field *new_field(MEM_ROOT *root, struct st_table *new_table, In_C_you_should_use_my_bool_instead() keep_type); + virtual uint get_key_image(uchar *buff,uint length, imagetype type); +private: + int do_save_field_metadata(uchar *first_byte); +}; +class Field_varstring :public Field_longstr { +public: + static const uint MAX_SIZE; + uint32 length_bytes; + Field_varstring(uchar *ptr_arg, + uint32 len_arg, uint length_bytes_arg, + uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + TABLE_SHARE *share, CHARSET_INFO *cs) + :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, cs), + length_bytes(length_bytes_arg) + { + share->varchar_fields++; + } + Field_varstring(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, + const char *field_name_arg, + TABLE_SHARE *share, CHARSET_INFO *cs) + :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0, + NONE, field_name_arg, cs), + length_bytes(len_arg < 256 ? 1 :2) + { + share->varchar_fields++; + } + enum_field_types type() const { return MYSQL_TYPE_VARCHAR; } + enum ha_base_keytype key_type() const; + uint row_pack_length() { return field_length; } + In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; } + int reset(void) { bzero(ptr,field_length+length_bytes); return 0; } + uint32 pack_length() const { return (uint32) field_length+length_bytes; } + uint32 key_length() const { return (uint32) field_length; } + uint32 sort_length() const + { + return (uint32) field_length + (field_charset == &my_charset_bin ? + length_bytes : 0); + } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int store(double nr) { return Field_str::store(nr); } + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + my_decimal *val_decimal(my_decimal *); + int cmp_max(const uchar *, const uchar *, uint max_length); + int cmp(const uchar *a,const uchar *b) + { + return cmp_max(a, b, ~0L); + } + void sort_string(uchar *buff,uint length); + uint get_key_image(uchar *buff,uint length, imagetype type); + void set_key_image(const uchar *buff,uint length); + void sql_type(String &str) const; + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + uchar *pack_key(uchar *to, const uchar *from, uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + uchar *pack_key_from_key_image(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + virtual const uchar *unpack(uchar* to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first); + const uchar *unpack_key(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + int pack_cmp(const uchar *a, const uchar *b, uint key_length, + my_bool insert_or_update); + int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update); + int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L); + int key_cmp(const uchar *,const uchar*); + int key_cmp(const uchar *str, uint length); + uint packed_col_length(const uchar *to, uint length); + uint max_packed_col_length(uint max_length); + uint32 data_length(); + uint size_of() const { return sizeof(*this); } + enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; } + In_C_you_should_use_my_bool_instead() has_charset(void) const + { return charset() == &my_charset_bin ? (0) : (1); } + Field *new_field(MEM_ROOT *root, struct st_table *new_table, In_C_you_should_use_my_bool_instead() keep_type); + Field *new_key_field(MEM_ROOT *root, struct st_table *new_table, + uchar *new_ptr, uchar *new_null_ptr, + uint new_null_bit); + uint is_equal(Create_field *new_field); + void hash(ulong *nr, ulong *nr2); +private: + int do_save_field_metadata(uchar *first_byte); +}; +class Field_blob :public Field_longstr { +protected: + uint packlength; + String value; +public: + Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + TABLE_SHARE *share, uint blob_pack_length, CHARSET_INFO *cs); + Field_blob(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs) + :Field_longstr((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0, + NONE, field_name_arg, cs), + packlength(4) + { + flags|= 16; + } + Field_blob(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + CHARSET_INFO *cs, In_C_you_should_use_my_bool_instead() set_packlength) + :Field_longstr((uchar*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0, + NONE, field_name_arg, cs) + { + flags|= 16; + packlength= 4; + if (set_packlength) + { + uint32 l_char_length= len_arg/cs->mbmaxlen; + packlength= l_char_length <= 255 ? 1 : + l_char_length <= 65535 ? 2 : + l_char_length <= 16777215 ? 3 : 4; + } + } + Field_blob(uint32 packlength_arg) + :Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, "temp", system_charset_info), + packlength(packlength_arg) {} + enum_field_types type() const { return MYSQL_TYPE_BLOB;} + enum ha_base_keytype key_type() const + { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + my_decimal *val_decimal(my_decimal *); + int cmp_max(const uchar *, const uchar *, uint max_length); + int cmp(const uchar *a,const uchar *b) + { return cmp_max(a, b, ~0L); } + int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length); + int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0L); + int key_cmp(const uchar *,const uchar*); + int key_cmp(const uchar *str, uint length); + uint32 key_length() const { return 0; } + void sort_string(uchar *buff,uint length); + uint32 pack_length() const + { return (uint32) (packlength+table->s->blob_ptr_size); } + uint32 pack_length_no_ptr() const + { return (uint32) (packlength); } + uint row_pack_length() { return pack_length_no_ptr(); } + uint32 sort_length() const; + virtual uint32 max_data_length() const + { + return (uint32) (((ulonglong) 1 << (packlength*8)) -1); + } + int reset(void) { bzero(ptr, packlength+sizeof(uchar*)); return 0; } + void reset_fields() { bzero((uchar*) &value,sizeof(value)); } + static + void store_length(uchar *i_ptr, uint i_packlength, uint32 i_number, In_C_you_should_use_my_bool_instead() low_byte_first); + void store_length(uchar *i_ptr, uint i_packlength, uint32 i_number) + { + store_length(i_ptr, i_packlength, i_number, table->s->db_low_byte_first); + } + inline void store_length(uint32 number) + { + store_length(ptr, packlength, number); + } + uint32 get_packed_size(const uchar *ptr_arg, In_C_you_should_use_my_bool_instead() low_byte_first) + {return packlength + get_length(ptr_arg, packlength, low_byte_first);} + inline uint32 get_length(uint row_offset= 0) + { return get_length(ptr+row_offset, this->packlength, table->s->db_low_byte_first); } + uint32 get_length(const uchar *ptr, uint packlength, In_C_you_should_use_my_bool_instead() low_byte_first); + uint32 get_length(const uchar *ptr_arg) + { return get_length(ptr_arg, this->packlength, table->s->db_low_byte_first); } + void put_length(uchar *pos, uint32 length); + inline void get_ptr(uchar **str) + { + memcpy(((uchar*) str),(ptr+packlength),(sizeof(uchar*))); + } + inline void get_ptr(uchar **str, uint row_offset) + { + memcpy(((uchar*) str),(ptr+packlength+row_offset),(sizeof(char*))); + } + inline void set_ptr(uchar *length, uchar *data) + { + memcpy(ptr,length,packlength); + memcpy((ptr+packlength),(&data),(sizeof(char*))); + } + void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data) + { + uchar *ptr_ofs= (uchar*) ((uchar*) (ptr)+ptr_diff); + store_length(ptr_ofs, packlength, length); + memcpy((ptr_ofs+packlength),(&data),(sizeof(char*))); + } + inline void set_ptr(uint32 length, uchar *data) + { + set_ptr_offset(0, length, data); + } + uint get_key_image(uchar *buff,uint length, imagetype type); + void set_key_image(const uchar *buff,uint length); + void sql_type(String &str) const; + inline In_C_you_should_use_my_bool_instead() copy() + { + uchar *tmp; + get_ptr(&tmp); + if (value.copy((char*) tmp, get_length(), charset())) + { + Field_blob::reset(); + return 1; + } + tmp=(uchar*) value.ptr(); + memcpy((ptr+packlength),(&tmp),(sizeof(char*))); + return 0; + } + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + uchar *pack_key(uchar *to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + uchar *pack_key_from_key_image(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + virtual const uchar *unpack(uchar *to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first); + const uchar *unpack_key(uchar* to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + int pack_cmp(const uchar *a, const uchar *b, uint key_length, + my_bool insert_or_update); + int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update); + uint packed_col_length(const uchar *col_ptr, uint length); + uint max_packed_col_length(uint max_length); + void free() { value.free(); } + inline void clear_temporary() { bzero((uchar*) &value,sizeof(value)); } + friend int field_conv(Field *to,Field *from); + uint size_of() const { return sizeof(*this); } + In_C_you_should_use_my_bool_instead() has_charset(void) const + { return charset() == &my_charset_bin ? (0) : (1); } + uint32 max_display_length(); + uint is_equal(Create_field *new_field); + inline In_C_you_should_use_my_bool_instead() in_read_set() { return bitmap_is_set(table->read_set, field_index); } + inline In_C_you_should_use_my_bool_instead() in_write_set() { return bitmap_is_set(table->write_set, field_index); } +private: + int do_save_field_metadata(uchar *first_byte); +}; +class Field_geom :public Field_blob { +public: + enum geometry_type geom_type; + Field_geom(uchar *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + TABLE_SHARE *share, uint blob_pack_length, + enum geometry_type geom_type_arg) + :Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, + field_name_arg, share, blob_pack_length, &my_charset_bin) + { geom_type= geom_type_arg; } + Field_geom(uint32 len_arg,In_C_you_should_use_my_bool_instead() maybe_null_arg, const char *field_name_arg, + TABLE_SHARE *share, enum geometry_type geom_type_arg) + :Field_blob(len_arg, maybe_null_arg, field_name_arg, &my_charset_bin) + { geom_type= geom_type_arg; } + enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY2; } + enum_field_types type() const { return MYSQL_TYPE_GEOMETRY; } + void sql_type(String &str) const; + int store(const char *to, uint length, CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int store_decimal(const my_decimal *); + uint size_of() const { return sizeof(*this); } + int reset(void) { return !maybe_null() || Field_blob::reset(); } + geometry_type get_geometry_type() { return geom_type; }; +}; +class Field_enum :public Field_str { +protected: + uint packlength; +public: + TYPELIB *typelib; + Field_enum(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + uint packlength_arg, + TYPELIB *typelib_arg, + CHARSET_INFO *charset_arg) + :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, charset_arg), + packlength(packlength_arg),typelib(typelib_arg) + { + flags|=256; + } + Field *new_field(MEM_ROOT *root, struct st_table *new_table, In_C_you_should_use_my_bool_instead() keep_type); + enum_field_types type() const { return MYSQL_TYPE_STRING; } + enum Item_result cmp_type () const { return INT_RESULT; } + enum Item_result cast_to_int_type () const { return INT_RESULT; } + enum ha_base_keytype key_type() const; + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + double val_real(void); + longlong val_int(void); + String *val_str(String*,String *); + int cmp(const uchar *,const uchar *); + void sort_string(uchar *buff,uint length); + uint32 pack_length() const { return (uint32) packlength; } + void store_type(ulonglong value); + void sql_type(String &str) const; + uint size_of() const { return sizeof(*this); } + enum_field_types real_type() const { return MYSQL_TYPE_ENUM; } + uint pack_length_from_metadata(uint field_metadata) + { return (field_metadata & 0x00ff); } + uint row_pack_length() { return pack_length(); } + virtual In_C_you_should_use_my_bool_instead() zero_pack() const { return 0; } + In_C_you_should_use_my_bool_instead() optimize_range(uint idx, uint part) { return 0; } + In_C_you_should_use_my_bool_instead() eq_def(Field *field); + In_C_you_should_use_my_bool_instead() has_charset(void) const { return (1); } + CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; } +private: + int do_save_field_metadata(uchar *first_byte); +}; +class Field_set :public Field_enum { +public: + Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg, + uint32 packlength_arg, + TYPELIB *typelib_arg, CHARSET_INFO *charset_arg) + :Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, + unireg_check_arg, field_name_arg, + packlength_arg, + typelib_arg,charset_arg) + { + flags=(flags & ~256) | 2048; + } + int store(const char *to,uint length,CHARSET_INFO *charset); + int store(double nr) { return Field_set::store((longlong) nr, (0)); } + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + virtual In_C_you_should_use_my_bool_instead() zero_pack() const { return 1; } + String *val_str(String*,String *); + void sql_type(String &str) const; + enum_field_types real_type() const { return MYSQL_TYPE_SET; } + In_C_you_should_use_my_bool_instead() has_charset(void) const { return (1); } +}; +class Field_bit :public Field { +public: + uchar *bit_ptr; + uchar bit_ofs; + uint bit_len; + uint bytes_in_rec; + Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, uchar *bit_ptr_arg, uchar bit_ofs_arg, + enum utype unireg_check_arg, const char *field_name_arg); + enum_field_types type() const { return MYSQL_TYPE_BIT; } + enum ha_base_keytype key_type() const { return HA_KEYTYPE_BIT; } + uint32 key_length() const { return (uint32) (field_length + 7) / 8; } + uint32 max_data_length() const { return (field_length + 7) / 8; } + uint32 max_display_length() { return field_length; } + uint size_of() const { return sizeof(*this); } + Item_result result_type () const { return INT_RESULT; } + int reset(void) { bzero(ptr, bytes_in_rec); return 0; } + int store(const char *to, uint length, CHARSET_INFO *charset); + int store(double nr); + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val); + int store_decimal(const my_decimal *); + double val_real(void); + longlong val_int(void); + String *val_str(String*, String *); + virtual In_C_you_should_use_my_bool_instead() str_needs_quotes() { return (1); } + my_decimal *val_decimal(my_decimal *); + int cmp(const uchar *a, const uchar *b) + { + assert(ptr == a); + return Field_bit::key_cmp(b, bytes_in_rec+((bit_len) ? 1 : 0)); + } + int cmp_binary_offset(uint row_offset) + { return cmp_offset(row_offset); } + int cmp_max(const uchar *a, const uchar *b, uint max_length); + int key_cmp(const uchar *a, const uchar *b) + { return cmp_binary((uchar *) a, (uchar *) b); } + int key_cmp(const uchar *str, uint length); + int cmp_offset(uint row_offset); + void get_image(uchar *buff, uint length, CHARSET_INFO *cs) + { get_key_image(buff, length, itRAW); } + void set_image(const uchar *buff,uint length, CHARSET_INFO *cs) + { Field_bit::store((char *) buff, length, cs); } + uint get_key_image(uchar *buff, uint length, imagetype type); + void set_key_image(const uchar *buff, uint length) + { Field_bit::store((char*) buff, length, &my_charset_bin); } + void sort_string(uchar *buff, uint length) + { get_key_image(buff, length, itRAW); } + uint32 pack_length() const { return (uint32) (field_length + 7) / 8; } + uint32 pack_length_in_rec() const { return bytes_in_rec; } + uint pack_length_from_metadata(uint field_metadata); + uint row_pack_length() + { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); } + int compatible_field_size(uint field_metadata); + void sql_type(String &str) const; + virtual uchar *pack(uchar *to, const uchar *from, + uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first); + virtual const uchar *unpack(uchar *to, const uchar *from, + uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first); + virtual void set_default(); + Field *new_key_field(MEM_ROOT *root, struct st_table *new_table, + uchar *new_ptr, uchar *new_null_ptr, + uint new_null_bit); + void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg) + { + bit_ptr= bit_ptr_arg; + bit_ofs= bit_ofs_arg; + } + In_C_you_should_use_my_bool_instead() eq(Field *field) + { + return (Field::eq(field) && + field->type() == type() && + bit_ptr == ((Field_bit *)field)->bit_ptr && + bit_ofs == ((Field_bit *)field)->bit_ofs); + } + uint is_equal(Create_field *new_field); + void move_field_offset(my_ptrdiff_t ptr_diff) + { + Field::move_field_offset(ptr_diff); + bit_ptr= (uchar*) ((uchar*) (bit_ptr)+ptr_diff); + } + void hash(ulong *nr, ulong *nr2); +private: + virtual size_t do_last_null_byte() const; + int do_save_field_metadata(uchar *first_byte); +}; +class Field_bit_as_char: public Field_bit { +public: + Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, + uchar null_bit_arg, + enum utype unireg_check_arg, const char *field_name_arg); + enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; } + uint size_of() const { return sizeof(*this); } + int store(const char *to, uint length, CHARSET_INFO *charset); + int store(double nr) { return Field_bit::store(nr); } + int store(longlong nr, In_C_you_should_use_my_bool_instead() unsigned_val) + { return Field_bit::store(nr, unsigned_val); } + void sql_type(String &str) const; +}; +class Create_field :public Sql_alloc +{ +public: + const char *field_name; + const char *change; + const char *after; + LEX_STRING comment; + Item *def; + enum enum_field_types sql_type; + ulong length; + uint32 char_length; + uint decimals, flags, pack_length, key_length; + Field::utype unireg_check; + TYPELIB *interval; + TYPELIB *save_interval; + List interval_list; + CHARSET_INFO *charset; + Field::geometry_type geom_type; + Field *field; + uint8 row,col,sc_length,interval_id; + uint offset,pack_flag; + Create_field() :after(0) {} + Create_field(Field *field, Field *orig_field); + Create_field *clone(MEM_ROOT *mem_root) const + { return new (mem_root) Create_field(*this); } + void create_length_to_internal_length(void); + void init_for_tmp_table(enum_field_types sql_type_arg, + uint32 max_length, uint32 decimals, + In_C_you_should_use_my_bool_instead() maybe_null, In_C_you_should_use_my_bool_instead() is_unsigned); + In_C_you_should_use_my_bool_instead() init(THD *thd, char *field_name, enum_field_types type, char *length, + char *decimals, uint type_modifier, Item *default_value, + Item *on_update_value, LEX_STRING *comment, char *change, + List *interval_list, CHARSET_INFO *cs, + uint uint_geom_type); +}; +class Send_field { + public: + const char *db_name; + const char *table_name,*org_table_name; + const char *col_name,*org_col_name; + ulong length; + uint charsetnr, flags, decimals; + enum_field_types type; + Send_field() {} +}; +class Copy_field :public Sql_alloc { + typedef void Copy_func(Copy_field*); + Copy_func *get_copy_func(Field *to, Field *from); +public: + uchar *from_ptr,*to_ptr; + uchar *from_null_ptr,*to_null_ptr; + my_bool *null_row; + uint from_bit,to_bit; + uint from_length,to_length; + Field *from_field,*to_field; + String tmp; + Copy_field() {} + ~Copy_field() {} + void set(Field *to,Field *from,In_C_you_should_use_my_bool_instead() save); + void set(uchar *to,Field *from); + void (*do_copy)(Copy_field *); + void (*do_copy2)(Copy_field *); +}; +Field *make_field(TABLE_SHARE *share, uchar *ptr, uint32 field_length, + uchar *null_pos, uchar null_bit, + uint pack_flag, enum_field_types field_type, + CHARSET_INFO *cs, + Field::geometry_type geom_type, + Field::utype unireg_check, + TYPELIB *interval, const char *field_name); +uint pack_length_to_packflag(uint type); +enum_field_types get_blob_type_from_length(ulong length); +uint32 calc_pack_length(enum_field_types type,uint32 length); +int set_field_to_null(Field *field); +int set_field_to_null_with_conversions(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); +#include "protocol.h" +class i_string; +class THD; +typedef struct st_mysql_field MYSQL_FIELD; +typedef struct st_mysql_rows MYSQL_ROWS; +class Protocol +{ +protected: + THD *thd; + String *packet; + String *convert; + uint field_pos; + enum enum_field_types *field_types; + uint field_count; + In_C_you_should_use_my_bool_instead() net_store_data(const uchar *from, size_t length); + In_C_you_should_use_my_bool_instead() store_string_aux(const char *from, size_t length, + CHARSET_INFO *fromcs, CHARSET_INFO *tocs); +public: + Protocol() {} + Protocol(THD *thd_arg) { init(thd_arg); } + virtual ~Protocol() {} + void init(THD* thd_arg); + enum { SEND_NUM_ROWS= 1, SEND_DEFAULTS= 2, SEND_EOF= 4 }; + virtual In_C_you_should_use_my_bool_instead() send_fields(List *list, uint flags); + In_C_you_should_use_my_bool_instead() store(I_List *str_list); + In_C_you_should_use_my_bool_instead() store(const char *from, CHARSET_INFO *cs); + String *storage_packet() { return packet; } + inline void free() { packet->free(); } + virtual In_C_you_should_use_my_bool_instead() write(); + inline In_C_you_should_use_my_bool_instead() store(int from) + { return store_long((longlong) from); } + inline In_C_you_should_use_my_bool_instead() store(uint32 from) + { return store_long((longlong) from); } + inline In_C_you_should_use_my_bool_instead() store(longlong from) + { return store_longlong((longlong) from, 0); } + inline In_C_you_should_use_my_bool_instead() store(ulonglong from) + { return store_longlong((longlong) from, 1); } + inline In_C_you_should_use_my_bool_instead() store(String *str) + { return store((char*) str->ptr(), str->length(), str->charset()); } + virtual In_C_you_should_use_my_bool_instead() prepare_for_send(List *item_list) + { + field_count=item_list->elements; + return 0; + } + virtual In_C_you_should_use_my_bool_instead() flush(); + virtual void end_partial_result_set(THD *thd); + virtual void prepare_for_resend()=0; + virtual In_C_you_should_use_my_bool_instead() store_null()=0; + virtual In_C_you_should_use_my_bool_instead() store_tiny(longlong from)=0; + virtual In_C_you_should_use_my_bool_instead() store_short(longlong from)=0; + virtual In_C_you_should_use_my_bool_instead() store_long(longlong from)=0; + virtual In_C_you_should_use_my_bool_instead() store_longlong(longlong from, In_C_you_should_use_my_bool_instead() unsigned_flag)=0; + virtual In_C_you_should_use_my_bool_instead() store_decimal(const my_decimal *)=0; + virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, CHARSET_INFO *cs)=0; + virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, + CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0; + virtual In_C_you_should_use_my_bool_instead() store(float from, uint32 decimals, String *buffer)=0; + virtual In_C_you_should_use_my_bool_instead() store(double from, uint32 decimals, String *buffer)=0; + virtual In_C_you_should_use_my_bool_instead() store(MYSQL_TIME *time)=0; + virtual In_C_you_should_use_my_bool_instead() store_date(MYSQL_TIME *time)=0; + virtual In_C_you_should_use_my_bool_instead() store_time(MYSQL_TIME *time)=0; + virtual In_C_you_should_use_my_bool_instead() store(Field *field)=0; + void remove_last_row() {} + enum enum_protocol_type + { + PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1 + }; + virtual enum enum_protocol_type type()= 0; +}; +class Protocol_text :public Protocol +{ +public: + Protocol_text() {} + Protocol_text(THD *thd_arg) :Protocol(thd_arg) {} + virtual void prepare_for_resend(); + virtual In_C_you_should_use_my_bool_instead() store_null(); + virtual In_C_you_should_use_my_bool_instead() store_tiny(longlong from); + virtual In_C_you_should_use_my_bool_instead() store_short(longlong from); + virtual In_C_you_should_use_my_bool_instead() store_long(longlong from); + virtual In_C_you_should_use_my_bool_instead() store_longlong(longlong from, In_C_you_should_use_my_bool_instead() unsigned_flag); + virtual In_C_you_should_use_my_bool_instead() store_decimal(const my_decimal *); + virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, CHARSET_INFO *cs); + virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, + CHARSET_INFO *fromcs, CHARSET_INFO *tocs); + virtual In_C_you_should_use_my_bool_instead() store(MYSQL_TIME *time); + virtual In_C_you_should_use_my_bool_instead() store_date(MYSQL_TIME *time); + virtual In_C_you_should_use_my_bool_instead() store_time(MYSQL_TIME *time); + virtual In_C_you_should_use_my_bool_instead() store(float nr, uint32 decimals, String *buffer); + virtual In_C_you_should_use_my_bool_instead() store(double from, uint32 decimals, String *buffer); + virtual In_C_you_should_use_my_bool_instead() store(Field *field); + virtual enum enum_protocol_type type() { return PROTOCOL_TEXT; }; +}; +class Protocol_binary :public Protocol +{ +private: + uint bit_fields; +public: + Protocol_binary() {} + Protocol_binary(THD *thd_arg) :Protocol(thd_arg) {} + virtual In_C_you_should_use_my_bool_instead() prepare_for_send(List *item_list); + virtual void prepare_for_resend(); + virtual In_C_you_should_use_my_bool_instead() store_null(); + virtual In_C_you_should_use_my_bool_instead() store_tiny(longlong from); + virtual In_C_you_should_use_my_bool_instead() store_short(longlong from); + virtual In_C_you_should_use_my_bool_instead() store_long(longlong from); + virtual In_C_you_should_use_my_bool_instead() store_longlong(longlong from, In_C_you_should_use_my_bool_instead() unsigned_flag); + virtual In_C_you_should_use_my_bool_instead() store_decimal(const my_decimal *); + virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, CHARSET_INFO *cs); + virtual In_C_you_should_use_my_bool_instead() store(const char *from, size_t length, + CHARSET_INFO *fromcs, CHARSET_INFO *tocs); + virtual In_C_you_should_use_my_bool_instead() store(MYSQL_TIME *time); + virtual In_C_you_should_use_my_bool_instead() store_date(MYSQL_TIME *time); + virtual In_C_you_should_use_my_bool_instead() store_time(MYSQL_TIME *time); + virtual In_C_you_should_use_my_bool_instead() store(float nr, uint32 decimals, String *buffer); + virtual In_C_you_should_use_my_bool_instead() store(double from, uint32 decimals, String *buffer); + virtual In_C_you_should_use_my_bool_instead() store(Field *field); + virtual enum enum_protocol_type type() { return PROTOCOL_BINARY; }; +}; +void send_warning(THD *thd, uint sql_errno, const char *err=0); +void net_send_error(THD *thd, uint sql_errno=0, const char *err=0); +void net_end_statement(THD *thd); +In_C_you_should_use_my_bool_instead() send_old_password_request(THD *thd); +uchar *net_store_data(uchar *to,const uchar *from, size_t length); +uchar *net_store_data(uchar *to,int32 from); +uchar *net_store_data(uchar *to,longlong from); +#include "sql_udf.h" +enum Item_udftype {UDFTYPE_FUNCTION=1,UDFTYPE_AGGREGATE}; +typedef void (*Udf_func_clear)(UDF_INIT *, uchar *, uchar *); +typedef void (*Udf_func_add)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *); +typedef void (*Udf_func_deinit)(UDF_INIT*); +typedef my_bool (*Udf_func_init)(UDF_INIT *, UDF_ARGS *, char *); +typedef void (*Udf_func_any)(); +typedef double (*Udf_func_double)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *); +typedef longlong (*Udf_func_longlong)(UDF_INIT *, UDF_ARGS *, uchar *, + uchar *); +typedef struct st_udf_func +{ + LEX_STRING name; + Item_result returns; + Item_udftype type; + char *dl; + void *dlhandle; + Udf_func_any func; + Udf_func_init func_init; + Udf_func_deinit func_deinit; + Udf_func_clear func_clear; + Udf_func_add func_add; + ulong usage_count; +} udf_func; +class Item_result_field; +class udf_handler :public Sql_alloc +{ + protected: + udf_func *u_d; + String *buffers; + UDF_ARGS f_args; + UDF_INIT initid; + char *num_buffer; + uchar error, is_null; + In_C_you_should_use_my_bool_instead() initialized; + Item **args; + public: + table_map used_tables_cache; + In_C_you_should_use_my_bool_instead() const_item_cache; + In_C_you_should_use_my_bool_instead() not_original; + udf_handler(udf_func *udf_arg) :u_d(udf_arg), buffers(0), error(0), + is_null(0), initialized(0), not_original(0) + {} + ~udf_handler(); + const char *name() const { return u_d ? u_d->name.str : "?"; } + Item_result result_type () const + { return u_d ? u_d->returns : STRING_RESULT;} + In_C_you_should_use_my_bool_instead() get_arguments(); + In_C_you_should_use_my_bool_instead() fix_fields(THD *thd, Item_result_field *item, + uint arg_count, Item **args); + void cleanup(); + double val(my_bool *null_value) + { + is_null= 0; + if (get_arguments()) + { + *null_value=1; + return 0.0; + } + Udf_func_double func= (Udf_func_double) u_d->func; + double tmp=func(&initid, &f_args, &is_null, &error); + if (is_null || error) + { + *null_value=1; + return 0.0; + } + *null_value=0; + return tmp; + } + longlong val_int(my_bool *null_value) + { + is_null= 0; + if (get_arguments()) + { + *null_value=1; + return 0LL; + } + Udf_func_longlong func= (Udf_func_longlong) u_d->func; + longlong tmp=func(&initid, &f_args, &is_null, &error); + if (is_null || error) + { + *null_value=1; + return 0LL; + } + *null_value=0; + return tmp; + } + my_decimal *val_decimal(my_bool *null_value, my_decimal *dec_buf); + void clear() + { + is_null= 0; + Udf_func_clear func= u_d->func_clear; + func(&initid, &is_null, &error); + } + void add(my_bool *null_value) + { + if (get_arguments()) + { + *null_value=1; + return; + } + Udf_func_add func= u_d->func_add; + func(&initid, &f_args, &is_null, &error); + *null_value= (my_bool) (is_null || error); + } + String *val_str(String *str,String *save_str); +}; +void udf_init(void),udf_free(void); +udf_func *find_udf(const char *name, uint len=0,In_C_you_should_use_my_bool_instead() mark_used=0); +void free_udf(udf_func *udf); +int mysql_create_function(THD *thd,udf_func *udf); +int mysql_drop_function(THD *thd,const LEX_STRING *name); +#include "sql_profile.h" +extern ST_FIELD_INFO query_profile_statistics_info[]; +int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond); +int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table); +#include "sql_partition.h" +#pragma interface +typedef struct { + longlong list_value; + uint32 partition_id; +} LIST_PART_ENTRY; +typedef struct { + uint32 start_part; + uint32 end_part; +} part_id_range; +struct st_partition_iter; +In_C_you_should_use_my_bool_instead() is_partition_in_list(char *part_name, List list_part_names); +char *are_partitions_in_table(partition_info *new_part_info, + partition_info *old_part_info); +In_C_you_should_use_my_bool_instead() check_reorganise_list(partition_info *new_part_info, + partition_info *old_part_info, + List list_part_names); +handler *get_ha_partition(partition_info *part_info); +int get_parts_for_update(const uchar *old_data, uchar *new_data, + const uchar *rec0, partition_info *part_info, + uint32 *old_part_id, uint32 *new_part_id, + longlong *func_value); +int get_part_for_delete(const uchar *buf, const uchar *rec0, + partition_info *part_info, uint32 *part_id); +void prune_partition_set(const TABLE *table, part_id_range *part_spec); +In_C_you_should_use_my_bool_instead() check_partition_info(partition_info *part_info,handlerton **eng_type, + TABLE *table, handler *file, HA_CREATE_INFO *info); +void set_linear_hash_mask(partition_info *part_info, uint no_parts); +In_C_you_should_use_my_bool_instead() fix_partition_func(THD *thd, TABLE *table, In_C_you_should_use_my_bool_instead() create_table_ind); +char *generate_partition_syntax(partition_info *part_info, + uint *buf_length, In_C_you_should_use_my_bool_instead() use_sql_alloc, + In_C_you_should_use_my_bool_instead() show_partition_options); +In_C_you_should_use_my_bool_instead() partition_key_modified(TABLE *table, const MY_BITMAP *fields); +void get_partition_set(const TABLE *table, uchar *buf, const uint index, + const key_range *key_spec, + part_id_range *part_spec); +void get_full_part_id_from_key(const TABLE *table, uchar *buf, + KEY *key_info, + const key_range *key_spec, + part_id_range *part_spec); +In_C_you_should_use_my_bool_instead() mysql_unpack_partition(THD *thd, const char *part_buf, + uint part_info_len, + const char *part_state, uint part_state_len, + TABLE *table, In_C_you_should_use_my_bool_instead() is_create_table_ind, + handlerton *default_db_type, + In_C_you_should_use_my_bool_instead() *work_part_info_used); +void make_used_partitions_str(partition_info *part_info, String *parts_str); +uint32 get_list_array_idx_for_endpoint(partition_info *part_info, + In_C_you_should_use_my_bool_instead() left_endpoint, + In_C_you_should_use_my_bool_instead() include_endpoint); +uint32 get_partition_id_range_for_endpoint(partition_info *part_info, + In_C_you_should_use_my_bool_instead() left_endpoint, + In_C_you_should_use_my_bool_instead() include_endpoint); +In_C_you_should_use_my_bool_instead() fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table, + In_C_you_should_use_my_bool_instead() is_sub_part, In_C_you_should_use_my_bool_instead() is_field_to_be_setup); +In_C_you_should_use_my_bool_instead() check_part_func_fields(Field **ptr, In_C_you_should_use_my_bool_instead() ok_with_charsets); +In_C_you_should_use_my_bool_instead() field_is_partition_charset(Field *field); +typedef uint32 (*partition_iter_func)(st_partition_iter* part_iter); +typedef struct st_partition_iter +{ + partition_iter_func get_next; + In_C_you_should_use_my_bool_instead() ret_null_part, ret_null_part_orig; + struct st_part_num_range + { + uint32 start; + uint32 cur; + uint32 end; + }; + struct st_field_value_range + { + longlong start; + longlong cur; + longlong end; + }; + union + { + struct st_part_num_range part_nums; + struct st_field_value_range field_vals; + }; + partition_info *part_info; +} PARTITION_ITERATOR; +typedef int (*get_partitions_in_range_iter)(partition_info *part_info, + In_C_you_should_use_my_bool_instead() is_subpart, + uchar *min_val, uchar *max_val, + uint flags, + PARTITION_ITERATOR *part_iter); +#include "partition_info.h" +#include "partition_element.h" +enum partition_type { + NOT_A_PARTITION= 0, + RANGE_PARTITION, + HASH_PARTITION, + LIST_PARTITION +}; +enum partition_state { + PART_NORMAL= 0, + PART_IS_DROPPED= 1, + PART_TO_BE_DROPPED= 2, + PART_TO_BE_ADDED= 3, + PART_TO_BE_REORGED= 4, + PART_REORGED_DROPPED= 5, + PART_CHANGED= 6, + PART_IS_CHANGED= 7, + PART_IS_ADDED= 8 +}; +typedef struct p_elem_val +{ + longlong value; + In_C_you_should_use_my_bool_instead() null_value; + In_C_you_should_use_my_bool_instead() unsigned_flag; +} part_elem_value; +struct st_ddl_log_memory_entry; +class partition_element :public Sql_alloc { +public: + List subpartitions; + List list_val_list; + ha_rows part_max_rows; + ha_rows part_min_rows; + longlong range_value; + char *partition_name; + char *tablespace_name; + struct st_ddl_log_memory_entry *log_entry; + char* part_comment; + char* data_file_name; + char* index_file_name; + handlerton *engine_type; + enum partition_state part_state; + uint16 nodegroup_id; + In_C_you_should_use_my_bool_instead() has_null_value; + In_C_you_should_use_my_bool_instead() signed_flag; + In_C_you_should_use_my_bool_instead() max_value; + partition_element() + : part_max_rows(0), part_min_rows(0), range_value(0), + partition_name(NULL), tablespace_name(NULL), + log_entry(NULL), part_comment(NULL), + data_file_name(NULL), index_file_name(NULL), + engine_type(NULL), part_state(PART_NORMAL), + nodegroup_id(65535), has_null_value((0)), + signed_flag((0)), max_value((0)) + { + } + partition_element(partition_element *part_elem) + : part_max_rows(part_elem->part_max_rows), + part_min_rows(part_elem->part_min_rows), + range_value(0), partition_name(NULL), + tablespace_name(part_elem->tablespace_name), + part_comment(part_elem->part_comment), + data_file_name(part_elem->data_file_name), + index_file_name(part_elem->index_file_name), + engine_type(part_elem->engine_type), + part_state(part_elem->part_state), + nodegroup_id(part_elem->nodegroup_id), + has_null_value((0)) + { + } + ~partition_element() {} +}; +class partition_info; +typedef int (*get_part_id_func)(partition_info *part_info, + uint32 *part_id, + longlong *func_value); +typedef uint32 (*get_subpart_id_func)(partition_info *part_info); +struct st_ddl_log_memory_entry; +class partition_info : public Sql_alloc +{ +public: + List partitions; + List temp_partitions; + List part_field_list; + List subpart_field_list; + get_part_id_func get_partition_id; + get_part_id_func get_part_partition_id; + get_subpart_id_func get_subpartition_id; + get_part_id_func get_partition_id_charset; + get_part_id_func get_part_partition_id_charset; + get_subpart_id_func get_subpartition_id_charset; + Field **part_field_array; + Field **subpart_field_array; + Field **part_charset_field_array; + Field **subpart_charset_field_array; + Field **full_part_field_array; + Field **full_part_charset_field_array; + MY_BITMAP full_part_field_set; + uchar **part_field_buffers; + uchar **subpart_field_buffers; + uchar **full_part_field_buffers; + uchar **restore_part_field_ptrs; + uchar **restore_subpart_field_ptrs; + uchar **restore_full_part_field_ptrs; + Item *part_expr; + Item *subpart_expr; + Item *item_free_list; + struct st_ddl_log_memory_entry *first_log_entry; + struct st_ddl_log_memory_entry *exec_log_entry; + struct st_ddl_log_memory_entry *frm_log_entry; + MY_BITMAP used_partitions; + union { + longlong *range_int_array; + LIST_PART_ENTRY *list_array; + }; + get_partitions_in_range_iter get_part_iter_for_interval; + get_partitions_in_range_iter get_subpart_iter_for_interval; + longlong err_value; + char* part_info_string; + char *part_func_string; + char *subpart_func_string; + const char *part_state; + partition_element *curr_part_elem; + partition_element *current_partition; + key_map all_fields_in_PF, all_fields_in_PPF, all_fields_in_SPF; + key_map some_fields_in_PF; + handlerton *default_engine_type; + Item_result part_result_type; + partition_type part_type; + partition_type subpart_type; + uint part_info_len; + uint part_state_len; + uint part_func_len; + uint subpart_func_len; + uint no_parts; + uint no_subparts; + uint count_curr_subparts; + uint part_error_code; + uint no_list_values; + uint no_part_fields; + uint no_subpart_fields; + uint no_full_part_fields; + uint has_null_part_id; + uint16 linear_hash_mask; + In_C_you_should_use_my_bool_instead() use_default_partitions; + In_C_you_should_use_my_bool_instead() use_default_no_partitions; + In_C_you_should_use_my_bool_instead() use_default_subpartitions; + In_C_you_should_use_my_bool_instead() use_default_no_subpartitions; + In_C_you_should_use_my_bool_instead() default_partitions_setup; + In_C_you_should_use_my_bool_instead() defined_max_value; + In_C_you_should_use_my_bool_instead() list_of_part_fields; + In_C_you_should_use_my_bool_instead() list_of_subpart_fields; + In_C_you_should_use_my_bool_instead() linear_hash_ind; + In_C_you_should_use_my_bool_instead() fixed; + In_C_you_should_use_my_bool_instead() is_auto_partitioned; + In_C_you_should_use_my_bool_instead() from_openfrm; + In_C_you_should_use_my_bool_instead() has_null_value; + partition_info() + : get_partition_id(NULL), get_part_partition_id(NULL), + get_subpartition_id(NULL), + part_field_array(NULL), subpart_field_array(NULL), + part_charset_field_array(NULL), + subpart_charset_field_array(NULL), + full_part_field_array(NULL), + full_part_charset_field_array(NULL), + part_field_buffers(NULL), subpart_field_buffers(NULL), + full_part_field_buffers(NULL), + restore_part_field_ptrs(NULL), restore_subpart_field_ptrs(NULL), + restore_full_part_field_ptrs(NULL), + part_expr(NULL), subpart_expr(NULL), item_free_list(NULL), + first_log_entry(NULL), exec_log_entry(NULL), frm_log_entry(NULL), + list_array(NULL), err_value(0), + part_info_string(NULL), + part_func_string(NULL), subpart_func_string(NULL), + part_state(NULL), + curr_part_elem(NULL), current_partition(NULL), + default_engine_type(NULL), + part_result_type(INT_RESULT), + part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION), + part_info_len(0), part_state_len(0), + part_func_len(0), subpart_func_len(0), + no_parts(0), no_subparts(0), + count_curr_subparts(0), part_error_code(0), + no_list_values(0), no_part_fields(0), no_subpart_fields(0), + no_full_part_fields(0), has_null_part_id(0), linear_hash_mask(0), + use_default_partitions((1)), use_default_no_partitions((1)), + use_default_subpartitions((1)), use_default_no_subpartitions((1)), + default_partitions_setup((0)), defined_max_value((0)), + list_of_part_fields((0)), list_of_subpart_fields((0)), + linear_hash_ind((0)), fixed((0)), + is_auto_partitioned((0)), from_openfrm((0)), + has_null_value((0)) + { + all_fields_in_PF.clear_all(); + all_fields_in_PPF.clear_all(); + all_fields_in_SPF.clear_all(); + some_fields_in_PF.clear_all(); + partitions.empty(); + temp_partitions.empty(); + part_field_list.empty(); + subpart_field_list.empty(); + } + ~partition_info() {} + partition_info *get_clone(); + In_C_you_should_use_my_bool_instead() is_sub_partitioned() + { + return (subpart_type == NOT_A_PARTITION ? (0) : (1)); + } + uint get_tot_partitions() + { + return no_parts * (is_sub_partitioned() ? no_subparts : 1); + } + In_C_you_should_use_my_bool_instead() set_up_defaults_for_partitioning(handler *file, HA_CREATE_INFO *info, + uint start_no); + char *has_unique_names(); + In_C_you_should_use_my_bool_instead() check_engine_mix(handlerton *engine_type, In_C_you_should_use_my_bool_instead() default_engine); + In_C_you_should_use_my_bool_instead() check_range_constants(); + In_C_you_should_use_my_bool_instead() check_list_constants(); + In_C_you_should_use_my_bool_instead() check_partition_info(THD *thd, handlerton **eng_type, + handler *file, HA_CREATE_INFO *info, + In_C_you_should_use_my_bool_instead() check_partition_function); + void print_no_partition_found(TABLE *table); + In_C_you_should_use_my_bool_instead() set_up_charset_field_preps(); +private: + static int list_part_cmp(const void* a, const void* b); + static int list_part_cmp_unsigned(const void* a, const void* b); + In_C_you_should_use_my_bool_instead() set_up_default_partitions(handler *file, HA_CREATE_INFO *info, + uint start_no); + In_C_you_should_use_my_bool_instead() set_up_default_subpartitions(handler *file, HA_CREATE_INFO *info); + char *create_default_partition_names(uint part_no, uint no_parts, + uint start_no); + char *create_subpartition_name(uint subpart_no, const char *part_name); + In_C_you_should_use_my_bool_instead() has_unique_name(partition_element *element); +}; +uint32 get_next_partition_id_range(struct st_partition_iter* part_iter); +In_C_you_should_use_my_bool_instead() check_partition_dirs(partition_info *part_info); +static inline void init_single_partition_iterator(uint32 part_id, + PARTITION_ITERATOR *part_iter) +{ + part_iter->part_nums.start= part_iter->part_nums.cur= part_id; + part_iter->part_nums.end= part_id+1; + part_iter->get_next= get_next_partition_id_range; +} +static inline +void init_all_partitions_iterator(partition_info *part_info, + PARTITION_ITERATOR *part_iter) +{ + part_iter->part_nums.start= part_iter->part_nums.cur= 0; + part_iter->part_nums.end= part_info->no_parts; + part_iter->get_next= get_next_partition_id_range; +} +class user_var_entry; +class Security_context; +enum enum_var_type +{ + OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL +}; +class sys_var; +#include "item.h" +class Protocol; +struct TABLE_LIST; +void item_init(void); +class Item_field; +class DTCollation { +public: + CHARSET_INFO *collation; + enum Derivation derivation; + uint repertoire; + void set_repertoire_from_charset(CHARSET_INFO *cs) + { + repertoire= cs->state & 4096 ? + 1 : 3; + } + DTCollation() + { + collation= &my_charset_bin; + derivation= DERIVATION_NONE; + repertoire= 3; + } + DTCollation(CHARSET_INFO *collation_arg, Derivation derivation_arg) + { + collation= collation_arg; + derivation= derivation_arg; + set_repertoire_from_charset(collation_arg); + } + void set(DTCollation &dt) + { + collation= dt.collation; + derivation= dt.derivation; + repertoire= dt.repertoire; + } + void set(CHARSET_INFO *collation_arg, Derivation derivation_arg) + { + collation= collation_arg; + derivation= derivation_arg; + set_repertoire_from_charset(collation_arg); + } + void set(CHARSET_INFO *collation_arg, + Derivation derivation_arg, + uint repertoire_arg) + { + collation= collation_arg; + derivation= derivation_arg; + repertoire= repertoire_arg; + } + void set(CHARSET_INFO *collation_arg) + { + collation= collation_arg; + set_repertoire_from_charset(collation_arg); + } + void set(Derivation derivation_arg) + { derivation= derivation_arg; } + In_C_you_should_use_my_bool_instead() aggregate(DTCollation &dt, uint flags= 0); + In_C_you_should_use_my_bool_instead() set(DTCollation &dt1, DTCollation &dt2, uint flags= 0) + { set(dt1); return aggregate(dt2, flags); } + const char *derivation_name() const + { + switch(derivation) + { + case DERIVATION_IGNORABLE: return "IGNORABLE"; + case DERIVATION_COERCIBLE: return "COERCIBLE"; + case DERIVATION_IMPLICIT: return "IMPLICIT"; + case DERIVATION_SYSCONST: return "SYSCONST"; + case DERIVATION_EXPLICIT: return "EXPLICIT"; + case DERIVATION_NONE: return "NONE"; + default: return "UNKNOWN"; + } + } +}; +struct Hybrid_type_traits; +struct Hybrid_type +{ + longlong integer; + double real; + my_decimal dec_buf[3]; + int used_dec_buf_no; + const Hybrid_type_traits *traits; + Hybrid_type() {} + Hybrid_type(const Hybrid_type &rhs) :traits(rhs.traits) {} +}; +struct Hybrid_type_traits +{ + virtual Item_result type() const { return REAL_RESULT; } + virtual void + fix_length_and_dec(Item *item, Item *arg) const; + virtual void set_zero(Hybrid_type *val) const { val->real= 0.0; } + virtual void add(Hybrid_type *val, Field *f) const + { val->real+= f->val_real(); } + virtual void div(Hybrid_type *val, ulonglong u) const + { val->real/= ((double) (ulonglong) (u)); } + virtual longlong val_int(Hybrid_type *val, In_C_you_should_use_my_bool_instead() unsigned_flag) const + { return (longlong) rint(val->real); } + virtual double val_real(Hybrid_type *val) const { return val->real; } + virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const; + virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; + static const Hybrid_type_traits *instance(); + Hybrid_type_traits() {} + virtual ~Hybrid_type_traits() {} +}; +struct Hybrid_type_traits_decimal: public Hybrid_type_traits +{ + virtual Item_result type() const { return DECIMAL_RESULT; } + virtual void + fix_length_and_dec(Item *arg, Item *item) const; + virtual void set_zero(Hybrid_type *val) const; + virtual void add(Hybrid_type *val, Field *f) const; + virtual void div(Hybrid_type *val, ulonglong u) const; + virtual longlong val_int(Hybrid_type *val, In_C_you_should_use_my_bool_instead() unsigned_flag) const; + virtual double val_real(Hybrid_type *val) const; + virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const + { return &val->dec_buf[val->used_dec_buf_no]; } + virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const; + static const Hybrid_type_traits_decimal *instance(); + Hybrid_type_traits_decimal() {}; +}; +struct Hybrid_type_traits_integer: public Hybrid_type_traits +{ + virtual Item_result type() const { return INT_RESULT; } + virtual void + fix_length_and_dec(Item *arg, Item *item) const; + virtual void set_zero(Hybrid_type *val) const + { val->integer= 0; } + virtual void add(Hybrid_type *val, Field *f) const + { val->integer+= f->val_int(); } + virtual void div(Hybrid_type *val, ulonglong u) const + { val->integer/= (longlong) u; } + virtual longlong val_int(Hybrid_type *val, In_C_you_should_use_my_bool_instead() unsigned_flag) const + { return val->integer; } + virtual double val_real(Hybrid_type *val) const + { return (double) val->integer; } + virtual my_decimal *val_decimal(Hybrid_type *val, my_decimal *buf) const + { + int2my_decimal(30, val->integer, 0, &val->dec_buf[2]); + return &val->dec_buf[2]; + } + virtual String *val_str(Hybrid_type *val, String *buf, uint8 decimals) const + { buf->set(val->integer, &my_charset_bin); return buf;} + static const Hybrid_type_traits_integer *instance(); + Hybrid_type_traits_integer() {}; +}; +void dummy_error_processor(THD *thd, void *data); +void view_error_processor(THD *thd, void *data); +struct Name_resolution_context: Sql_alloc +{ + Name_resolution_context *outer_context; + TABLE_LIST *table_list; + TABLE_LIST *first_name_resolution_table; + TABLE_LIST *last_name_resolution_table; + st_select_lex *select_lex; + void (*error_processor)(THD *, void *); + void *error_processor_data; + In_C_you_should_use_my_bool_instead() resolve_in_select_list; + Security_context *security_ctx; + Name_resolution_context() + :outer_context(0), table_list(0), select_lex(0), + error_processor_data(0), + security_ctx(0) + {} + void init() + { + resolve_in_select_list= (0); + error_processor= &dummy_error_processor; + first_name_resolution_table= NULL; + last_name_resolution_table= NULL; + } + void resolve_in_table_list_only(TABLE_LIST *tables) + { + table_list= first_name_resolution_table= tables; + resolve_in_select_list= (0); + } + void process_error(THD *thd) + { + (*error_processor)(thd, error_processor_data); + } +}; +class Name_resolution_context_state +{ +private: + TABLE_LIST *save_table_list; + TABLE_LIST *save_first_name_resolution_table; + TABLE_LIST *save_next_name_resolution_table; + In_C_you_should_use_my_bool_instead() save_resolve_in_select_list; + TABLE_LIST *save_next_local; +public: + Name_resolution_context_state() {} +public: + void save_state(Name_resolution_context *context, TABLE_LIST *table_list) + { + save_table_list= context->table_list; + save_first_name_resolution_table= context->first_name_resolution_table; + save_resolve_in_select_list= context->resolve_in_select_list; + save_next_local= table_list->next_local; + save_next_name_resolution_table= table_list->next_name_resolution_table; + } + void restore_state(Name_resolution_context *context, TABLE_LIST *table_list) + { + table_list->next_local= save_next_local; + table_list->next_name_resolution_table= save_next_name_resolution_table; + context->table_list= save_table_list; + context->first_name_resolution_table= save_first_name_resolution_table; + context->resolve_in_select_list= save_resolve_in_select_list; + } + TABLE_LIST *get_first_name_resolution_table() + { + return save_first_name_resolution_table; + } +}; +typedef enum monotonicity_info +{ + NON_MONOTONIC, + MONOTONIC_INCREASING, + MONOTONIC_STRICT_INCREASING +} enum_monotonicity_info; +class sp_rcontext; +class Settable_routine_parameter +{ +public: + Settable_routine_parameter() {} + virtual ~Settable_routine_parameter() {} + virtual void set_required_privilege(In_C_you_should_use_my_bool_instead() rw) {}; + virtual In_C_you_should_use_my_bool_instead() set_value(THD *thd, sp_rcontext *ctx, Item **it)= 0; +}; +typedef In_C_you_should_use_my_bool_instead() (Item::*Item_processor) (uchar *arg); +typedef In_C_you_should_use_my_bool_instead() (Item::*Item_analyzer) (uchar **argp); +typedef Item* (Item::*Item_transformer) (uchar *arg); +typedef void (*Cond_traverser) (const Item *item, void *arg); +class Item { + Item(const Item &); + void operator=(Item &); +public: + static void *operator new(size_t size) + { return sql_alloc(size); } + static void *operator new(size_t size, MEM_ROOT *mem_root) + { return alloc_root(mem_root, size); } + static void operator delete(void *ptr,size_t size) { ; } + static void operator delete(void *ptr, MEM_ROOT *mem_root) {} + enum Type {FIELD_ITEM= 0, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM, + INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM, + COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM, + PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM, + FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM, + SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER, + PARAM_ITEM, TRIGGER_FIELD_ITEM, DECIMAL_ITEM, + XPATH_NODESET, XPATH_NODESET_CMP, + VIEW_FIXER_ITEM}; + enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE }; + enum traverse_order { POSTFIX, PREFIX }; + uint rsize; + String str_value; + char * name; + char * orig_name; + Item *next; + uint32 max_length; + uint name_length; + int8 marker; + uint8 decimals; + my_bool maybe_null; + my_bool null_value; + my_bool unsigned_flag; + my_bool with_sum_func; + my_bool fixed; + my_bool is_autogenerated_name; + DTCollation collation; + my_bool with_subselect; + Item_result cmp_context; + Item(); + Item(THD *thd, Item *item); + virtual ~Item() + { + } + void set_name(const char *str, uint length, CHARSET_INFO *cs); + void rename(char *new_name); + void init_make_field(Send_field *tmp_field,enum enum_field_types type); + virtual void cleanup(); + virtual void make_field(Send_field *field); + Field *make_string_field(TABLE *table); + virtual In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + inline void quick_fix_field() { fixed= 1; } + int save_in_field_no_warnings(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + virtual int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + virtual void save_org_in_field(Field *field) + { (void) save_in_field(field, 1); } + virtual int save_safe_in_field(Field *field) + { return save_in_field(field, 1); } + virtual In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str); + virtual In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const; + virtual Item_result result_type() const { return REAL_RESULT; } + virtual Item_result cast_to_int_type() const { return result_type(); } + virtual enum_field_types string_field_type() const; + virtual enum_field_types field_type() const; + virtual enum Type type() const =0; + virtual enum_monotonicity_info get_monotonicity_info() const + { return NON_MONOTONIC; } + virtual longlong val_int_endpoint(In_C_you_should_use_my_bool_instead() left_endp, In_C_you_should_use_my_bool_instead() *incl_endp) + { assert(0); return 0; } + virtual double val_real()=0; + virtual longlong val_int()=0; + inline ulonglong val_uint() { return (ulonglong) val_int(); } + virtual String *val_str(String *str)=0; + virtual my_decimal *val_decimal(my_decimal *decimal_buffer)= 0; + virtual In_C_you_should_use_my_bool_instead() val_bool(); + virtual String *val_nodeset(String*) { return 0; } + String *val_string_from_real(String *str); + String *val_string_from_int(String *str); + String *val_string_from_decimal(String *str); + my_decimal *val_decimal_from_real(my_decimal *decimal_value); + my_decimal *val_decimal_from_int(my_decimal *decimal_value); + my_decimal *val_decimal_from_string(my_decimal *decimal_value); + my_decimal *val_decimal_from_date(my_decimal *decimal_value); + my_decimal *val_decimal_from_time(my_decimal *decimal_value); + longlong val_int_from_decimal(); + double val_real_from_decimal(); + int save_time_in_field(Field *field); + int save_date_in_field(Field *field); + int save_str_value_in_field(Field *field, String *result); + virtual Field *get_tmp_table_field() { return 0; } + virtual Field *tmp_table_field(TABLE *t_arg) { return 0; } + virtual const char *full_name() const { return name ? name : "???"; } + virtual double val_result() { return val_real(); } + virtual longlong val_int_result() { return val_int(); } + virtual String *str_result(String* tmp) { return val_str(tmp); } + virtual my_decimal *val_decimal_result(my_decimal *val) + { return val_decimal(val); } + virtual In_C_you_should_use_my_bool_instead() val_bool_result() { return val_bool(); } + virtual table_map used_tables() const { return (table_map) 0L; } + virtual table_map not_null_tables() const { return used_tables(); } + virtual In_C_you_should_use_my_bool_instead() basic_const_item() const { return 0; } + virtual Item *clone_item() { return 0; } + virtual cond_result eq_cmp_result() const { return COND_OK; } + inline uint float_length(uint decimals_par) const + { return decimals != 31 ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;} + virtual uint decimal_precision() const; + inline int decimal_int_part() const + { return my_decimal_int_part(decimal_precision(), decimals); } + virtual In_C_you_should_use_my_bool_instead() const_item() const { return used_tables() == 0; } + virtual In_C_you_should_use_my_bool_instead() const_during_execution() const + { return (used_tables() & ~(((table_map) 1) << (sizeof(table_map)*8-3))) == 0; } + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(full_name()); + } + void print_item_w_name(String *, enum_query_type query_type); + virtual void update_used_tables() {} + virtual void split_sum_func(THD *thd, Item **ref_pointer_array, + List &fields) {} + void split_sum_func2(THD *thd, Item **ref_pointer_array, List &fields, + Item **ref, In_C_you_should_use_my_bool_instead() skip_registered); + virtual In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + virtual In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); + virtual In_C_you_should_use_my_bool_instead() get_date_result(MYSQL_TIME *ltime,uint fuzzydate) + { return get_date(ltime,fuzzydate); } + virtual In_C_you_should_use_my_bool_instead() is_null() { return 0; } + virtual void update_null_value () { (void) val_int(); } + virtual void top_level_item() {} + virtual void set_result_field(Field *field) {} + virtual In_C_you_should_use_my_bool_instead() is_result_field() { return 0; } + virtual In_C_you_should_use_my_bool_instead() is_bool_func() { return 0; } + virtual void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions) {} + virtual void no_rows_in_result() {} + virtual Item *copy_or_same(THD *thd) { return this; } + virtual Item *copy_andor_structure(THD *thd) { return this; } + virtual Item *real_item() { return this; } + virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); } + static CHARSET_INFO *default_charset(); + virtual CHARSET_INFO *compare_collation() { return NULL; } + virtual In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *arg) + { + return (this->*processor)(arg); + } + virtual Item* transform(Item_transformer transformer, uchar *arg); + virtual Item* compile(Item_analyzer analyzer, uchar **arg_p, + Item_transformer transformer, uchar *arg_t) + { + if ((this->*analyzer) (arg_p)) + return ((this->*transformer) (arg_t)); + return 0; + } + virtual void traverse_cond(Cond_traverser traverser, + void *arg, traverse_order order) + { + (*traverser)(this, arg); + } + virtual In_C_you_should_use_my_bool_instead() remove_dependence_processor(uchar * arg) { return 0; } + virtual In_C_you_should_use_my_bool_instead() remove_fixed(uchar * arg) { fixed= 0; return 0; } + virtual In_C_you_should_use_my_bool_instead() cleanup_processor(uchar *arg); + virtual In_C_you_should_use_my_bool_instead() collect_item_field_processor(uchar * arg) { return 0; } + virtual In_C_you_should_use_my_bool_instead() find_item_in_field_list_processor(uchar *arg) { return 0; } + virtual In_C_you_should_use_my_bool_instead() change_context_processor(uchar *context) { return 0; } + virtual In_C_you_should_use_my_bool_instead() reset_query_id_processor(uchar *query_id_arg) { return 0; } + virtual In_C_you_should_use_my_bool_instead() is_expensive_processor(uchar *arg) { return 0; } + virtual In_C_you_should_use_my_bool_instead() register_field_in_read_map(uchar *arg) { return 0; } + virtual In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (1);} + virtual In_C_you_should_use_my_bool_instead() subst_argument_checker(uchar **arg) + { + if (*arg) + *arg= NULL; + return (1); + } + virtual Item *equal_fields_propagator(uchar * arg) { return this; } + virtual In_C_you_should_use_my_bool_instead() set_no_const_sub(uchar *arg) { return (0); } + virtual Item *replace_equal_field(uchar * arg) { return this; } + virtual Item *this_item() { return this; } + virtual const Item *this_item() const { return this; } + virtual Item **this_item_addr(THD *thd, Item **addr_arg) { return addr_arg; } + virtual uint cols() { return 1; } + virtual Item* element_index(uint i) { return this; } + virtual Item** addr(uint i) { return 0; } + virtual In_C_you_should_use_my_bool_instead() check_cols(uint c); + virtual In_C_you_should_use_my_bool_instead() null_inside() { return 0; } + virtual void bring_value() {} + Field *tmp_table_field_from_field_type(TABLE *table, In_C_you_should_use_my_bool_instead() fixed_length); + virtual Item_field *filed_for_view_update() { return 0; } + virtual Item *neg_transformer(THD *thd) { return NULL; } + virtual Item *update_value_transformer(uchar *select_arg) { return this; } + virtual Item *safe_charset_converter(CHARSET_INFO *tocs); + void delete_self() + { + cleanup(); + delete this; + } + virtual In_C_you_should_use_my_bool_instead() is_splocal() { return 0; } + virtual Settable_routine_parameter *get_settable_routine_parameter() + { + return 0; + } + virtual In_C_you_should_use_my_bool_instead() result_as_longlong() { return (0); } + In_C_you_should_use_my_bool_instead() is_datetime(); + virtual Field::geometry_type get_geometry_type() const + { return Field::GEOM_GEOMETRY; }; + String *check_well_formed_result(String *str, In_C_you_should_use_my_bool_instead() send_error= 0); + In_C_you_should_use_my_bool_instead() eq_by_collation(Item *item, In_C_you_should_use_my_bool_instead() binary_cmp, CHARSET_INFO *cs); +}; +class sp_head; +class Item_basic_constant :public Item +{ +public: + void cleanup() + { + if (orig_name) + name= orig_name; + } +}; +class Item_sp_variable :public Item +{ +protected: + THD *m_thd; +public: + LEX_STRING m_name; +public: + sp_head *m_sp; +public: + Item_sp_variable(char *sp_var_name_str, uint sp_var_name_length); +public: + In_C_you_should_use_my_bool_instead() fix_fields(THD *thd, Item **); + double val_real(); + longlong val_int(); + String *val_str(String *sp); + my_decimal *val_decimal(my_decimal *decimal_value); + In_C_you_should_use_my_bool_instead() is_null(); +public: + inline void make_field(Send_field *field); + inline In_C_you_should_use_my_bool_instead() const_item() const; + inline int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + inline In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str); +}; +inline void Item_sp_variable::make_field(Send_field *field) +{ + Item *it= this_item(); + if (name) + it->set_name(name, (uint) strlen(name), system_charset_info); + else + it->set_name(m_name.str, m_name.length, system_charset_info); + it->make_field(field); +} +inline In_C_you_should_use_my_bool_instead() Item_sp_variable::const_item() const +{ + return (1); +} +inline int Item_sp_variable::save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions) +{ + return this_item()->save_in_field(field, no_conversions); +} +inline In_C_you_should_use_my_bool_instead() Item_sp_variable::send(Protocol *protocol, String *str) +{ + return this_item()->send(protocol, str); +} +class Item_splocal :public Item_sp_variable, + private Settable_routine_parameter +{ + uint m_var_idx; + Type m_type; + Item_result m_result_type; + enum_field_types m_field_type; +public: + uint pos_in_query; + uint len_in_query; + Item_splocal(const LEX_STRING &sp_var_name, uint sp_var_idx, + enum_field_types sp_var_type, + uint pos_in_q= 0, uint len_in_q= 0); + In_C_you_should_use_my_bool_instead() is_splocal() { return 1; } + Item *this_item(); + const Item *this_item() const; + Item **this_item_addr(THD *thd, Item **); + virtual void print(String *str, enum_query_type query_type); +public: + inline const LEX_STRING *my_name() const; + inline uint get_var_idx() const; + inline enum Type type() const; + inline Item_result result_type() const; + inline enum_field_types field_type() const { return m_field_type; } +private: + In_C_you_should_use_my_bool_instead() set_value(THD *thd, sp_rcontext *ctx, Item **it); +public: + Settable_routine_parameter *get_settable_routine_parameter() + { + return this; + } +}; +inline const LEX_STRING *Item_splocal::my_name() const +{ + return &m_name; +} +inline uint Item_splocal::get_var_idx() const +{ + return m_var_idx; +} +inline enum Item::Type Item_splocal::type() const +{ + return m_type; +} +inline Item_result Item_splocal::result_type() const +{ + return m_result_type; +} +class Item_case_expr :public Item_sp_variable +{ +public: + Item_case_expr(uint case_expr_id); +public: + Item *this_item(); + const Item *this_item() const; + Item **this_item_addr(THD *thd, Item **); + inline enum Type type() const; + inline Item_result result_type() const; +public: + virtual void print(String *str, enum_query_type query_type); +private: + uint m_case_expr_id; +}; +inline enum Item::Type Item_case_expr::type() const +{ + return this_item()->type(); +} +inline Item_result Item_case_expr::result_type() const +{ + return this_item()->result_type(); +} +class Item_name_const : public Item +{ + Item *value_item; + Item *name_item; + In_C_you_should_use_my_bool_instead() valid_args; +public: + Item_name_const(Item *name_arg, Item *val); + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + enum Type type() const; + double val_real(); + longlong val_int(); + String *val_str(String *sp); + my_decimal *val_decimal(my_decimal *); + In_C_you_should_use_my_bool_instead() is_null(); + virtual void print(String *str, enum_query_type query_type); + Item_result result_type() const + { + return value_item->result_type(); + } + In_C_you_should_use_my_bool_instead() const_item() const + { + return (1); + } + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions) + { + return value_item->save_in_field(field, no_conversions); + } + In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str) + { + return value_item->send(protocol, str); + } +}; +In_C_you_should_use_my_bool_instead() agg_item_collations(DTCollation &c, const char *name, + Item **items, uint nitems, uint flags, int item_sep); +In_C_you_should_use_my_bool_instead() agg_item_collations_for_comparison(DTCollation &c, const char *name, + Item **items, uint nitems, uint flags); +In_C_you_should_use_my_bool_instead() agg_item_charsets(DTCollation &c, const char *name, + Item **items, uint nitems, uint flags, int item_sep); +class Item_num: public Item_basic_constant +{ +public: + Item_num() {} + virtual Item_num *neg()= 0; + Item *safe_charset_converter(CHARSET_INFO *tocs); + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) { return (0);} +}; +class st_select_lex; +class Item_ident :public Item +{ +protected: + const char *orig_db_name; + const char *orig_table_name; + const char *orig_field_name; +public: + Name_resolution_context *context; + const char *db_name; + const char *table_name; + const char *field_name; + In_C_you_should_use_my_bool_instead() alias_name_used; + uint cached_field_index; + TABLE_LIST *cached_table; + st_select_lex *depended_from; + Item_ident(Name_resolution_context *context_arg, + const char *db_name_arg, const char *table_name_arg, + const char *field_name_arg); + Item_ident(THD *thd, Item_ident *item); + const char *full_name() const; + void cleanup(); + In_C_you_should_use_my_bool_instead() remove_dependence_processor(uchar * arg); + virtual void print(String *str, enum_query_type query_type); + virtual In_C_you_should_use_my_bool_instead() change_context_processor(uchar *cntx) + { context= (Name_resolution_context *)cntx; return (0); } + friend In_C_you_should_use_my_bool_instead() insert_fields(THD *thd, Name_resolution_context *context, + const char *db_name, + const char *table_name, List_iterator *it, + In_C_you_should_use_my_bool_instead() any_privileges); +}; +class Item_ident_for_show :public Item +{ +public: + Field *field; + const char *db_name; + const char *table_name; + Item_ident_for_show(Field *par_field, const char *db_arg, + const char *table_name_arg) + :field(par_field), db_name(db_arg), table_name(table_name_arg) + {} + enum Type type() const { return FIELD_ITEM; } + double val_real() { return field->val_real(); } + longlong val_int() { return field->val_int(); } + String *val_str(String *str) { return field->val_str(str); } + my_decimal *val_decimal(my_decimal *dec) { return field->val_decimal(dec); } + void make_field(Send_field *tmp_field); +}; +class Item_equal; +class COND_EQUAL; +class Item_field :public Item_ident +{ +protected: + void set_field(Field *field); +public: + Field *field,*result_field; + Item_equal *item_equal; + In_C_you_should_use_my_bool_instead() no_const_subst; + uint have_privileges; + In_C_you_should_use_my_bool_instead() any_privileges; + Item_field(Name_resolution_context *context_arg, + const char *db_arg,const char *table_name_arg, + const char *field_name_arg); + Item_field(THD *thd, Item_field *item); + Item_field(THD *thd, Name_resolution_context *context_arg, Field *field); + Item_field(Field *field); + enum Type type() const { return FIELD_ITEM; } + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + double val_real(); + longlong val_int(); + my_decimal *val_decimal(my_decimal *); + String *val_str(String*); + double val_result(); + longlong val_int_result(); + String *str_result(String* tmp); + my_decimal *val_decimal_result(my_decimal *); + In_C_you_should_use_my_bool_instead() val_bool_result(); + In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str_arg); + void reset_field(Field *f); + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + void make_field(Send_field *tmp_field); + int save_in_field(Field *field,In_C_you_should_use_my_bool_instead() no_conversions); + void save_org_in_field(Field *field); + table_map used_tables() const; + enum Item_result result_type () const + { + return field->result_type(); + } + Item_result cast_to_int_type() const + { + return field->cast_to_int_type(); + } + enum_field_types field_type() const + { + return field->type(); + } + enum_monotonicity_info get_monotonicity_info() const + { + return MONOTONIC_STRICT_INCREASING; + } + longlong val_int_endpoint(In_C_you_should_use_my_bool_instead() left_endp, In_C_you_should_use_my_bool_instead() *incl_endp); + Field *get_tmp_table_field() { return result_field; } + Field *tmp_table_field(TABLE *t_arg) { return result_field; } + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + In_C_you_should_use_my_bool_instead() get_date_result(MYSQL_TIME *ltime,uint fuzzydate); + In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *ltime); + In_C_you_should_use_my_bool_instead() is_null() { return field->is_null(); } + void update_null_value(); + Item *get_tmp_table_item(THD *thd); + In_C_you_should_use_my_bool_instead() collect_item_field_processor(uchar * arg); + In_C_you_should_use_my_bool_instead() find_item_in_field_list_processor(uchar *arg); + In_C_you_should_use_my_bool_instead() register_field_in_read_map(uchar *arg); + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);} + void cleanup(); + In_C_you_should_use_my_bool_instead() result_as_longlong() + { + return field->can_be_compared_as_longlong(); + } + Item_equal *find_item_equal(COND_EQUAL *cond_equal); + In_C_you_should_use_my_bool_instead() subst_argument_checker(uchar **arg); + Item *equal_fields_propagator(uchar *arg); + In_C_you_should_use_my_bool_instead() set_no_const_sub(uchar *arg); + Item *replace_equal_field(uchar *arg); + inline uint32 max_disp_length() { return field->max_display_length(); } + Item_field *filed_for_view_update() { return this; } + Item *safe_charset_converter(CHARSET_INFO *tocs); + int fix_outer_field(THD *thd, Field **field, Item **reference); + virtual Item *update_value_transformer(uchar *select_arg); + virtual void print(String *str, enum_query_type query_type); + Field::geometry_type get_geometry_type() const + { + assert(field_type() == MYSQL_TYPE_GEOMETRY); + return field->get_geometry_type(); + } + friend class Item_default_value; + friend class Item_insert_value; + friend class st_select_lex_unit; +}; +class Item_null :public Item_basic_constant +{ +public: + Item_null(char *name_par=0) + { + maybe_null= null_value= (1); + max_length= 0; + name= name_par ? name_par : (char*) "NULL"; + fixed= 1; + collation.set(&my_charset_bin, DERIVATION_IGNORABLE); + } + enum Type type() const { return NULL_ITEM; } + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + double val_real(); + longlong val_int(); + String *val_str(String *str); + my_decimal *val_decimal(my_decimal *); + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + int save_safe_in_field(Field *field); + In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str); + enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_NULL; } + In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; } + Item *clone_item() { return new Item_null(name); } + In_C_you_should_use_my_bool_instead() is_null() { return 1; } + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(("NULL"), ((size_t) (sizeof("NULL") - 1))); + } + Item *safe_charset_converter(CHARSET_INFO *tocs); + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);} +}; +class Item_null_result :public Item_null +{ +public: + Field *result_field; + Item_null_result() : Item_null(), result_field(0) {} + In_C_you_should_use_my_bool_instead() is_result_field() { return result_field != 0; } + void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions) + { + save_in_field(result_field, no_conversions); + } + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (1);} +}; +class Item_param :public Item +{ + char cnvbuf[(255*3 +1)]; + String cnvstr; + Item *cnvitem; +public: + enum enum_item_param_state + { + NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE, + STRING_VALUE, TIME_VALUE, LONG_DATA_VALUE, + DECIMAL_VALUE + } state; + String str_value_ptr; + my_decimal decimal_value; + union + { + longlong integer; + double real; + struct CONVERSION_INFO + { + CHARSET_INFO *character_set_client; + CHARSET_INFO *character_set_of_placeholder; + CHARSET_INFO *final_character_set_of_str_value; + } cs_info; + MYSQL_TIME time; + } value; + enum Item_result item_result_type; + enum Type item_type; + enum enum_field_types param_type; + uint pos_in_query; + Item_param(uint pos_in_query_arg); + enum Item_result result_type () const { return item_result_type; } + enum Type type() const { return item_type; } + enum_field_types field_type() const { return param_type; } + double val_real(); + longlong val_int(); + my_decimal *val_decimal(my_decimal*); + String *val_str(String*); + In_C_you_should_use_my_bool_instead() get_time(MYSQL_TIME *tm); + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *tm, uint fuzzydate); + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + void set_null(); + void set_int(longlong i, uint32 max_length_arg); + void set_double(double i); + void set_decimal(const char *str, ulong length); + In_C_you_should_use_my_bool_instead() set_str(const char *str, ulong length); + In_C_you_should_use_my_bool_instead() set_longdata(const char *str, ulong length); + void set_time(MYSQL_TIME *tm, timestamp_type type, uint32 max_length_arg); + In_C_you_should_use_my_bool_instead() set_from_user_var(THD *thd, const user_var_entry *entry); + void reset(); + void (*set_param_func)(Item_param *param, uchar **pos, ulong len); + const String *query_val_str(String *str) const; + In_C_you_should_use_my_bool_instead() convert_str_value(THD *thd); + virtual table_map used_tables() const + { return state != NO_VALUE ? (table_map)0 : (((table_map) 1) << (sizeof(table_map)*8-3)); } + virtual void print(String *str, enum_query_type query_type); + In_C_you_should_use_my_bool_instead() is_null() + { assert(state != NO_VALUE); return state == NULL_VALUE; } + In_C_you_should_use_my_bool_instead() basic_const_item() const; + Item *safe_charset_converter(CHARSET_INFO *tocs); + Item *clone_item(); + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + In_C_you_should_use_my_bool_instead() limit_clause_param; + void set_param_type_and_swap_value(Item_param *from); +}; +class Item_int :public Item_num +{ +public: + longlong value; + Item_int(int32 i,uint length= 11) + :value((longlong) i) + { max_length=length; fixed= 1; } + Item_int(longlong i,uint length= 21) + :value(i) + { max_length=length; fixed= 1; } + Item_int(ulonglong i, uint length= 21) + :value((longlong)i) + { max_length=length; fixed= 1; unsigned_flag= 1; } + Item_int(const char *str_arg,longlong i,uint length) :value(i) + { max_length=length; name=(char*) str_arg; fixed= 1; } + Item_int(const char *str_arg, uint length=64); + enum Type type() const { return INT_ITEM; } + enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } + longlong val_int() { assert(fixed == 1); return value; } + double val_real() { assert(fixed == 1); return (double) value; } + my_decimal *val_decimal(my_decimal *); + String *val_str(String*); + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; } + Item *clone_item() { return new Item_int(name,value,max_length); } + virtual void print(String *str, enum_query_type query_type); + Item_num *neg() { value= -value; return this; } + uint decimal_precision() const + { return (uint)(max_length - ((value < 0) ? 1 : 0)); } + In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const; + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (0);} +}; +class Item_uint :public Item_int +{ +public: + Item_uint(const char *str_arg, uint length); + Item_uint(ulonglong i) :Item_int((ulonglong) i, 10) {} + Item_uint(const char *str_arg, longlong i, uint length); + double val_real() + { assert(fixed == 1); return ((double) (ulonglong) ((ulonglong)value)); } + String *val_str(String*); + Item *clone_item() { return new Item_uint(name, value, max_length); } + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + virtual void print(String *str, enum_query_type query_type); + Item_num *neg (); + uint decimal_precision() const { return max_length; } + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (0);} +}; +class Item_decimal :public Item_num +{ +protected: + my_decimal decimal_value; +public: + Item_decimal(const char *str_arg, uint length, CHARSET_INFO *charset); + Item_decimal(const char *str, const my_decimal *val_arg, + uint decimal_par, uint length); + Item_decimal(my_decimal *value_par); + Item_decimal(longlong val, In_C_you_should_use_my_bool_instead() unsig); + Item_decimal(double val, int precision, int scale); + Item_decimal(const uchar *bin, int precision, int scale); + enum Type type() const { return DECIMAL_ITEM; } + enum Item_result result_type () const { return DECIMAL_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } + longlong val_int(); + double val_real(); + String *val_str(String*); + my_decimal *val_decimal(my_decimal *val) { return &decimal_value; } + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; } + Item *clone_item() + { + return new Item_decimal(name, &decimal_value, decimals, max_length); + } + virtual void print(String *str, enum_query_type query_type); + Item_num *neg() + { + my_decimal_neg(&decimal_value); + unsigned_flag= !decimal_value.sign(); + return this; + } + uint decimal_precision() const { return decimal_value.precision(); } + In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const; + void set_decimal_value(my_decimal *value_par); + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (0);} +}; +class Item_float :public Item_num +{ + char *presentation; +public: + double value; + Item_float(const char *str_arg, uint length); + Item_float(const char *str,double val_arg,uint decimal_par,uint length) + :value(val_arg) + { + presentation= name=(char*) str; + decimals=(uint8) decimal_par; + max_length=length; + fixed= 1; + } + Item_float(double value_par, uint decimal_par) :presentation(0), value(value_par) + { + decimals= (uint8) decimal_par; + fixed= 1; + } + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + enum Type type() const { return REAL_ITEM; } + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } + double val_real() { assert(fixed == 1); return value; } + longlong val_int() + { + assert(fixed == 1); + if (value <= (double) ((long long) 0x8000000000000000LL)) + { + return ((long long) 0x8000000000000000LL); + } + else if (value >= (double) (ulonglong) ((long long) 0x7FFFFFFFFFFFFFFFLL)) + { + return ((long long) 0x7FFFFFFFFFFFFFFFLL); + } + return (longlong) rint(value); + } + String *val_str(String*); + my_decimal *val_decimal(my_decimal *); + In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; } + Item *clone_item() + { return new Item_float(name, value, decimals, max_length); } + Item_num *neg() { value= -value; return this; } + virtual void print(String *str, enum_query_type query_type); + In_C_you_should_use_my_bool_instead() eq(const Item *, In_C_you_should_use_my_bool_instead() binary_cmp) const; +}; +class Item_static_float_func :public Item_float +{ + const char *func_name; +public: + Item_static_float_func(const char *str, double val_arg, uint decimal_par, + uint length) + :Item_float((char *) 0, val_arg, decimal_par, length), func_name(str) + {} + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(func_name); + } + Item *safe_charset_converter(CHARSET_INFO *tocs); +}; +class Item_string :public Item_basic_constant +{ +public: + Item_string(const char *str,uint length, + CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE, + uint repertoire= 3) + : m_cs_specified((0)) + { + str_value.set_or_copy_aligned(str, length, cs); + collation.set(cs, dv, repertoire); + max_length= str_value.numchars()*cs->mbmaxlen; + set_name(str, length, cs); + decimals=31; + fixed= 1; + } + Item_string(CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE) + : m_cs_specified((0)) + { + collation.set(cs, dv); + max_length= 0; + set_name(NULL, 0, cs); + decimals= 31; + fixed= 1; + } + Item_string(const char *name_par, const char *str, uint length, + CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE, + uint repertoire= 3) + : m_cs_specified((0)) + { + str_value.set_or_copy_aligned(str, length, cs); + collation.set(cs, dv, repertoire); + max_length= str_value.numchars()*cs->mbmaxlen; + set_name(name_par, 0, cs); + decimals=31; + fixed= 1; + } + void set_str_with_copy(const char *str_arg, uint length_arg) + { + str_value.copy(str_arg, length_arg, collation.collation); + max_length= str_value.numchars() * collation.collation->mbmaxlen; + } + void set_repertoire_from_value() + { + collation.repertoire= my_string_repertoire(str_value.charset(), + str_value.ptr(), + str_value.length()); + } + enum Type type() const { return STRING_ITEM; } + double val_real(); + longlong val_int(); + String *val_str(String*) + { + assert(fixed == 1); + return (String*) &str_value; + } + my_decimal *val_decimal(my_decimal *); + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } + In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; } + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + Item *clone_item() + { + return new Item_string(name, str_value.ptr(), + str_value.length(), collation.collation); + } + Item *safe_charset_converter(CHARSET_INFO *tocs); + inline void append(char *str, uint length) + { + str_value.append(str, length); + max_length= str_value.numchars() * collation.collation->mbmaxlen; + } + virtual void print(String *str, enum_query_type query_type); + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);} + inline In_C_you_should_use_my_bool_instead() is_cs_specified() const + { + return m_cs_specified; + } + inline void set_cs_specified(In_C_you_should_use_my_bool_instead() cs_specified) + { + m_cs_specified= cs_specified; + } +private: + In_C_you_should_use_my_bool_instead() m_cs_specified; +}; +class Item_static_string_func :public Item_string +{ + const char *func_name; +public: + Item_static_string_func(const char *name_par, const char *str, uint length, + CHARSET_INFO *cs, + Derivation dv= DERIVATION_COERCIBLE) + :Item_string((char *) 0, str, length, cs, dv), func_name(name_par) + {} + Item *safe_charset_converter(CHARSET_INFO *tocs); + virtual inline void print(String *str, enum_query_type query_type) + { + str->append(func_name); + } + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (1);} +}; +class Item_partition_func_safe_string: public Item_string +{ +public: + Item_partition_func_safe_string(const char *name, uint length, + CHARSET_INFO *cs= NULL): + Item_string(name, length, cs) + {} +}; +class Item_return_date_time :public Item_partition_func_safe_string +{ + enum_field_types date_time_field_type; +public: + Item_return_date_time(const char *name_arg, enum_field_types field_type_arg) + :Item_partition_func_safe_string(name_arg, 0, &my_charset_bin), + date_time_field_type(field_type_arg) + { } + enum_field_types field_type() const { return date_time_field_type; } +}; +class Item_blob :public Item_partition_func_safe_string +{ +public: + Item_blob(const char *name, uint length) : + Item_partition_func_safe_string(name, length, &my_charset_bin) + { max_length= length; } + enum Type type() const { return TYPE_HOLDER; } + enum_field_types field_type() const { return MYSQL_TYPE_BLOB; } +}; +class Item_empty_string :public Item_partition_func_safe_string +{ +public: + Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : + Item_partition_func_safe_string("",0, cs ? cs : &my_charset_utf8_general_ci) + { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } + void make_field(Send_field *field); +}; +class Item_return_int :public Item_int +{ + enum_field_types int_field_type; +public: + Item_return_int(const char *name_arg, uint length, + enum_field_types field_type_arg, longlong value= 0) + :Item_int(name_arg, value, length), int_field_type(field_type_arg) + { + unsigned_flag=1; + } + enum_field_types field_type() const { return int_field_type; } +}; +class Item_hex_string: public Item_basic_constant +{ +public: + Item_hex_string() {} + Item_hex_string(const char *str,uint str_length); + enum Type type() const { return VARBIN_ITEM; } + double val_real() + { + assert(fixed == 1); + return (double) (ulonglong) Item_hex_string::val_int(); + } + longlong val_int(); + In_C_you_should_use_my_bool_instead() basic_const_item() const { return 1; } + String *val_str(String*) { assert(fixed == 1); return &str_value; } + my_decimal *val_decimal(my_decimal *); + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + enum Item_result result_type () const { return STRING_RESULT; } + enum Item_result cast_to_int_type() const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; } + virtual void print(String *str, enum_query_type query_type); + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + virtual Item *safe_charset_converter(CHARSET_INFO *tocs); + In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *int_arg) {return (0);} +}; +class Item_bin_string: public Item_hex_string +{ +public: + Item_bin_string(const char *str,uint str_length); +}; +class Item_result_field :public Item +{ +public: + Field *result_field; + Item_result_field() :result_field(0) {} + Item_result_field(THD *thd, Item_result_field *item): + Item(thd, item), result_field(item->result_field) + {} + ~Item_result_field() {} + Field *get_tmp_table_field() { return result_field; } + Field *tmp_table_field(TABLE *t_arg) { return result_field; } + table_map used_tables() const { return 1; } + virtual void fix_length_and_dec()=0; + void set_result_field(Field *field) { result_field= field; } + In_C_you_should_use_my_bool_instead() is_result_field() { return 1; } + void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions) + { + save_in_field(result_field, no_conversions); + } + void cleanup(); +}; +class Item_ref :public Item_ident +{ +protected: + void set_properties(); +public: + enum Ref_Type { REF, DIRECT_REF, VIEW_REF, OUTER_REF }; + Field *result_field; + Item **ref; + Item_ref(Name_resolution_context *context_arg, + const char *db_arg, const char *table_name_arg, + const char *field_name_arg) + :Item_ident(context_arg, db_arg, table_name_arg, field_name_arg), + result_field(0), ref(0) {} + Item_ref(Name_resolution_context *context_arg, Item **item, + const char *table_name_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() alias_name_used_arg= (0)); + Item_ref(THD *thd, Item_ref *item) + :Item_ident(thd, item), result_field(item->result_field), ref(item->ref) {} + enum Type type() const { return REF_ITEM; } + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const + { + Item *it= ((Item *) item)->real_item(); + return ref && (*ref)->eq(it, binary_cmp); + } + double val_real(); + longlong val_int(); + my_decimal *val_decimal(my_decimal *); + In_C_you_should_use_my_bool_instead() val_bool(); + String *val_str(String* tmp); + In_C_you_should_use_my_bool_instead() is_null(); + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + double val_result(); + longlong val_int_result(); + String *str_result(String* tmp); + my_decimal *val_decimal_result(my_decimal *); + In_C_you_should_use_my_bool_instead() val_bool_result(); + In_C_you_should_use_my_bool_instead() send(Protocol *prot, String *tmp); + void make_field(Send_field *field); + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); + void save_org_in_field(Field *field); + enum Item_result result_type () const { return (*ref)->result_type(); } + enum_field_types field_type() const { return (*ref)->field_type(); } + Field *get_tmp_table_field() + { return result_field ? result_field : (*ref)->get_tmp_table_field(); } + Item *get_tmp_table_item(THD *thd); + table_map used_tables() const + { + return depended_from ? (((table_map) 1) << (sizeof(table_map)*8-2)) : (*ref)->used_tables(); + } + void update_used_tables() + { + if (!depended_from) + (*ref)->update_used_tables(); + } + table_map not_null_tables() const { return (*ref)->not_null_tables(); } + void set_result_field(Field *field) { result_field= field; } + In_C_you_should_use_my_bool_instead() is_result_field() { return 1; } + void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions) + { + (*ref)->save_in_field(result_field, no_conversions); + } + Item *real_item() + { + return ref ? (*ref)->real_item() : this; + } + In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *arg) + { return (*ref)->walk(processor, walk_subquery, arg); } + virtual void print(String *str, enum_query_type query_type); + In_C_you_should_use_my_bool_instead() result_as_longlong() + { + return (*ref)->result_as_longlong(); + } + void cleanup(); + Item_field *filed_for_view_update() + { return (*ref)->filed_for_view_update(); } + virtual Ref_Type ref_type() { return REF; } + uint cols() + { + return ref && result_type() == ROW_RESULT ? (*ref)->cols() : 1; + } + Item* element_index(uint i) + { + return ref && result_type() == ROW_RESULT ? (*ref)->element_index(i) : this; + } + Item** addr(uint i) + { + return ref && result_type() == ROW_RESULT ? (*ref)->addr(i) : 0; + } + In_C_you_should_use_my_bool_instead() check_cols(uint c) + { + return ref && result_type() == ROW_RESULT ? (*ref)->check_cols(c) + : Item::check_cols(c); + } + In_C_you_should_use_my_bool_instead() null_inside() + { + return ref && result_type() == ROW_RESULT ? (*ref)->null_inside() : 0; + } + void bring_value() + { + if (ref && result_type() == ROW_RESULT) + (*ref)->bring_value(); + } +}; +class Item_direct_ref :public Item_ref +{ +public: + Item_direct_ref(Name_resolution_context *context_arg, Item **item, + const char *table_name_arg, + const char *field_name_arg, + In_C_you_should_use_my_bool_instead() alias_name_used_arg= (0)) + :Item_ref(context_arg, item, table_name_arg, + field_name_arg, alias_name_used_arg) + {} + Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} + double val_real(); + longlong val_int(); + String *val_str(String* tmp); + my_decimal *val_decimal(my_decimal *); + In_C_you_should_use_my_bool_instead() val_bool(); + In_C_you_should_use_my_bool_instead() is_null(); + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime,uint fuzzydate); + virtual Ref_Type ref_type() { return DIRECT_REF; } +}; +class Item_direct_view_ref :public Item_direct_ref +{ +public: + Item_direct_view_ref(Name_resolution_context *context_arg, Item **item, + const char *table_name_arg, + const char *field_name_arg) + :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg) {} + Item_direct_view_ref(THD *thd, Item_direct_ref *item) + :Item_direct_ref(thd, item) {} + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + Item *get_tmp_table_item(THD *thd) + { + Item *item= Item_ref::get_tmp_table_item(thd); + item->name= name; + return item; + } + virtual Ref_Type ref_type() { return VIEW_REF; } +}; +class Item_sum; +class Item_outer_ref :public Item_direct_ref +{ +public: + Item *outer_ref; + Item_sum *in_sum_func; + In_C_you_should_use_my_bool_instead() found_in_select_list; + Item_outer_ref(Name_resolution_context *context_arg, + Item_field *outer_field_arg) + :Item_direct_ref(context_arg, 0, outer_field_arg->table_name, + outer_field_arg->field_name), + outer_ref(outer_field_arg), in_sum_func(0), + found_in_select_list(0) + { + ref= &outer_ref; + set_properties(); + fixed= 0; + } + Item_outer_ref(Name_resolution_context *context_arg, Item **item, + const char *table_name_arg, const char *field_name_arg, + In_C_you_should_use_my_bool_instead() alias_name_used_arg) + :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg, + alias_name_used_arg), + outer_ref(0), in_sum_func(0), found_in_select_list(1) + {} + void save_in_result_field(In_C_you_should_use_my_bool_instead() no_conversions) + { + outer_ref->save_org_in_field(result_field); + } + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + table_map used_tables() const + { + return (*ref)->const_item() ? 0 : (((table_map) 1) << (sizeof(table_map)*8-2)); + } + virtual Ref_Type ref_type() { return OUTER_REF; } +}; +class Item_in_subselect; +class Item_ref_null_helper: public Item_ref +{ +protected: + Item_in_subselect* owner; +public: + Item_ref_null_helper(Name_resolution_context *context_arg, + Item_in_subselect* master, Item **item, + const char *table_name_arg, const char *field_name_arg) + :Item_ref(context_arg, item, table_name_arg, field_name_arg), + owner(master) {} + double val_real(); + longlong val_int(); + String* val_str(String* s); + my_decimal *val_decimal(my_decimal *); + In_C_you_should_use_my_bool_instead() val_bool(); + In_C_you_should_use_my_bool_instead() get_date(MYSQL_TIME *ltime, uint fuzzydate); + virtual void print(String *str, enum_query_type query_type); + table_map used_tables() const + { + return (depended_from ? + (((table_map) 1) << (sizeof(table_map)*8-2)) : + (*ref)->used_tables() | (((table_map) 1) << (sizeof(table_map)*8-1))); + } +}; +class Item_int_with_ref :public Item_int +{ + Item *ref; +public: + Item_int_with_ref(longlong i, Item *ref_arg, my_bool unsigned_arg) : + Item_int(i), ref(ref_arg) + { + unsigned_flag= unsigned_arg; + } + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions) + { + return ref->save_in_field(field, no_conversions); + } + Item *clone_item(); + virtual Item *real_item() { return ref; } +}; +class Item_copy_string :public Item +{ + enum enum_field_types cached_field_type; +public: + Item *item; + Item_copy_string(Item *i) :item(i) + { + null_value=maybe_null=item->maybe_null; + decimals=item->decimals; + max_length=item->max_length; + name=item->name; + cached_field_type= item->field_type(); + } + enum Type type() const { return COPY_STR_ITEM; } + enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return cached_field_type; } + double val_real() + { + int err_not_used; + char *end_not_used; + return (null_value ? 0.0 : + ((str_value.charset())->cset->strntod((str_value.charset()),((char*) str_value.ptr()),(str_value.length()),(&end_not_used),(&err_not_used)))); + } + longlong val_int() + { + int err; + return null_value ? 0LL : ((str_value.charset())->cset->strntoll((str_value.charset()),(str_value.ptr()),(str_value.length()),(10),((char**) 0),(&err))); + } + String *val_str(String*); + my_decimal *val_decimal(my_decimal *); + void make_field(Send_field *field) { item->make_field(field); } + void copy(); + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions) + { + return save_str_value_in_field(field, &str_value); + } + table_map used_tables() const { return (table_map) 1L; } + In_C_you_should_use_my_bool_instead() const_item() const { return 0; } + In_C_you_should_use_my_bool_instead() is_null() { return null_value; } +}; +class Cached_item :public Sql_alloc +{ +public: + my_bool null_value; + Cached_item() :null_value(0) {} + virtual In_C_you_should_use_my_bool_instead() cmp(void)=0; + virtual ~Cached_item(); +}; +class Cached_item_str :public Cached_item +{ + Item *item; + String value,tmp_value; +public: + Cached_item_str(THD *thd, Item *arg); + In_C_you_should_use_my_bool_instead() cmp(void); + ~Cached_item_str(); +}; +class Cached_item_real :public Cached_item +{ + Item *item; + double value; +public: + Cached_item_real(Item *item_par) :item(item_par),value(0.0) {} + In_C_you_should_use_my_bool_instead() cmp(void); +}; +class Cached_item_int :public Cached_item +{ + Item *item; + longlong value; +public: + Cached_item_int(Item *item_par) :item(item_par),value(0) {} + In_C_you_should_use_my_bool_instead() cmp(void); +}; +class Cached_item_decimal :public Cached_item +{ + Item *item; + my_decimal value; +public: + Cached_item_decimal(Item *item_par); + In_C_you_should_use_my_bool_instead() cmp(void); +}; +class Cached_item_field :public Cached_item +{ + uchar *buff; + Field *field; + uint length; +public: + Cached_item_field(Item_field *item) + { + field= item->field; + buff= (uchar*) sql_calloc(length=field->pack_length()); + } + In_C_you_should_use_my_bool_instead() cmp(void); +}; +class Item_default_value : public Item_field +{ +public: + Item *arg; + Item_default_value(Name_resolution_context *context_arg) + :Item_field(context_arg, (const char *)NULL, (const char *)NULL, + (const char *)NULL), + arg(NULL) {} + Item_default_value(Name_resolution_context *context_arg, Item *a) + :Item_field(context_arg, (const char *)NULL, (const char *)NULL, + (const char *)NULL), + arg(a) {} + enum Type type() const { return DEFAULT_VALUE_ITEM; } + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + virtual void print(String *str, enum_query_type query_type); + int save_in_field(Field *field_arg, In_C_you_should_use_my_bool_instead() no_conversions); + table_map used_tables() const { return (table_map)0L; } + In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *args) + { + return arg->walk(processor, walk_subquery, args) || + (this->*processor)(args); + } + Item *transform(Item_transformer transformer, uchar *args); +}; +class Item_insert_value : public Item_field +{ +public: + Item *arg; + Item_insert_value(Name_resolution_context *context_arg, Item *a) + :Item_field(context_arg, (const char *)NULL, (const char *)NULL, + (const char *)NULL), + arg(a) {} + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + virtual void print(String *str, enum_query_type query_type); + int save_in_field(Field *field_arg, In_C_you_should_use_my_bool_instead() no_conversions) + { + return Item_field::save_in_field(field_arg, no_conversions); + } + table_map used_tables() const { return (((table_map) 1) << (sizeof(table_map)*8-1)); } + In_C_you_should_use_my_bool_instead() walk(Item_processor processor, In_C_you_should_use_my_bool_instead() walk_subquery, uchar *args) + { + return arg->walk(processor, walk_subquery, args) || + (this->*processor)(args); + } +}; +enum trg_action_time_type +{ + TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1, TRG_ACTION_MAX +}; +class Table_triggers_list; +class Item_trigger_field : public Item_field, + private Settable_routine_parameter +{ +public: + enum row_version_type {OLD_ROW, NEW_ROW}; + row_version_type row_version; + Item_trigger_field *next_trg_field; + uint field_idx; + Table_triggers_list *triggers; + Item_trigger_field(Name_resolution_context *context_arg, + row_version_type row_ver_arg, + const char *field_name_arg, + ulong priv, const In_C_you_should_use_my_bool_instead() ro) + :Item_field(context_arg, + (const char *)NULL, (const char *)NULL, field_name_arg), + row_version(row_ver_arg), field_idx((uint)-1), original_privilege(priv), + want_privilege(priv), table_grants(NULL), read_only (ro) + {} + void setup_field(THD *thd, TABLE *table, GRANT_INFO *table_grant_info); + enum Type type() const { return TRIGGER_FIELD_ITEM; } + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const; + In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **); + virtual void print(String *str, enum_query_type query_type); + table_map used_tables() const { return (table_map)0L; } + Field *get_tmp_table_field() { return 0; } + Item *copy_or_same(THD *thd) { return this; } + Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); } + void cleanup(); +private: + void set_required_privilege(In_C_you_should_use_my_bool_instead() rw); + In_C_you_should_use_my_bool_instead() set_value(THD *thd, sp_rcontext *ctx, Item **it); +public: + Settable_routine_parameter *get_settable_routine_parameter() + { + return (read_only ? 0 : this); + } + In_C_you_should_use_my_bool_instead() set_value(THD *thd, Item **it) + { + return set_value(thd, NULL, it); + } +private: + ulong original_privilege; + ulong want_privilege; + GRANT_INFO *table_grants; + In_C_you_should_use_my_bool_instead() read_only; +}; +class Item_cache: public Item_basic_constant +{ +protected: + Item *example; + table_map used_table_map; + Field *cached_field; + enum enum_field_types cached_field_type; +public: + Item_cache(): + example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING) + { + fixed= 1; + null_value= 1; + } + Item_cache(enum_field_types field_type_arg): + example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg) + { + fixed= 1; + null_value= 1; + } + void set_used_tables(table_map map) { used_table_map= map; } + virtual In_C_you_should_use_my_bool_instead() allocate(uint i) { return 0; } + virtual In_C_you_should_use_my_bool_instead() setup(Item *item) + { + example= item; + max_length= item->max_length; + decimals= item->decimals; + collation.set(item->collation); + unsigned_flag= item->unsigned_flag; + if (item->type() == FIELD_ITEM) + cached_field= ((Item_field *)item)->field; + return 0; + }; + virtual void store(Item *)= 0; + enum Type type() const { return CACHE_ITEM; } + enum_field_types field_type() const { return cached_field_type; } + static Item_cache* get_cache(const Item *item); + table_map used_tables() const { return used_table_map; } + virtual void keep_array() {} + virtual void print(String *str, enum_query_type query_type); + In_C_you_should_use_my_bool_instead() eq_def(Field *field) + { + return cached_field ? cached_field->eq_def (field) : (0); + } + In_C_you_should_use_my_bool_instead() eq(const Item *item, In_C_you_should_use_my_bool_instead() binary_cmp) const + { + return this == item; + } +}; +class Item_cache_int: public Item_cache +{ +protected: + longlong value; +public: + Item_cache_int(): Item_cache(), value(0) {} + Item_cache_int(enum_field_types field_type_arg): + Item_cache(field_type_arg), value(0) {} + void store(Item *item); + void store(Item *item, longlong val_arg); + double val_real() { assert(fixed == 1); return (double) value; } + longlong val_int() { assert(fixed == 1); return value; } + String* val_str(String *str); + my_decimal *val_decimal(my_decimal *); + enum Item_result result_type() const { return INT_RESULT; } + In_C_you_should_use_my_bool_instead() result_as_longlong() { return (1); } +}; +class Item_cache_real: public Item_cache +{ + double value; +public: + Item_cache_real(): Item_cache(), value(0) {} + void store(Item *item); + double val_real() { assert(fixed == 1); return value; } + longlong val_int(); + String* val_str(String *str); + my_decimal *val_decimal(my_decimal *); + enum Item_result result_type() const { return REAL_RESULT; } +}; +class Item_cache_decimal: public Item_cache +{ +protected: + my_decimal decimal_value; +public: + Item_cache_decimal(): Item_cache() {} + void store(Item *item); + double val_real(); + longlong val_int(); + String* val_str(String *str); + my_decimal *val_decimal(my_decimal *); + enum Item_result result_type() const { return DECIMAL_RESULT; } +}; +class Item_cache_str: public Item_cache +{ + char buffer[80]; + String *value, value_buff; + In_C_you_should_use_my_bool_instead() is_varbinary; +public: + Item_cache_str(const Item *item) : + Item_cache(), value(0), + is_varbinary(item->type() == FIELD_ITEM && + ((const Item_field *) item)->field->type() == + MYSQL_TYPE_VARCHAR && + !((const Item_field *) item)->field->has_charset()) + {} + void store(Item *item); + double val_real(); + longlong val_int(); + String* val_str(String *) { assert(fixed == 1); return value; } + my_decimal *val_decimal(my_decimal *); + enum Item_result result_type() const { return STRING_RESULT; } + CHARSET_INFO *charset() const { return value->charset(); }; + int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions); +}; +class Item_cache_row: public Item_cache +{ + Item_cache **values; + uint item_count; + In_C_you_should_use_my_bool_instead() save_array; +public: + Item_cache_row() + :Item_cache(), values(0), item_count(2), save_array(0) {} + In_C_you_should_use_my_bool_instead() allocate(uint num); + In_C_you_should_use_my_bool_instead() setup(Item *item); + void store(Item *item); + void illegal_method_call(const char *); + void make_field(Send_field *) + { + illegal_method_call((const char*)"make_field"); + }; + double val_real() + { + illegal_method_call((const char*)"val"); + return 0; + }; + longlong val_int() + { + illegal_method_call((const char*)"val_int"); + return 0; + }; + String *val_str(String *) + { + illegal_method_call((const char*)"val_str"); + return 0; + }; + my_decimal *val_decimal(my_decimal *val) + { + illegal_method_call((const char*)"val_decimal"); + return 0; + }; + enum Item_result result_type() const { return ROW_RESULT; } + uint cols() { return item_count; } + Item *element_index(uint i) { return values[i]; } + Item **addr(uint i) { return (Item **) (values + i); } + In_C_you_should_use_my_bool_instead() check_cols(uint c); + In_C_you_should_use_my_bool_instead() null_inside(); + void bring_value(); + void keep_array() { save_array= 1; } + void cleanup() + { + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Item_cache_row::cleanup","./sql/item.h",2898,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + Item_cache::cleanup(); + if (save_array) + bzero(values, item_count*sizeof(Item**)); + else + values= 0; + do {_db_return_ (2904, &_db_func_, &_db_file_, &_db_level_); return;} while(0); + } +}; +class Item_type_holder: public Item +{ +protected: + TYPELIB *enum_set_typelib; + enum_field_types fld_type; + Field::geometry_type geometry_type; + void get_full_info(Item *item); + int prev_decimal_int_part; +public: + Item_type_holder(THD*, Item*); + Item_result result_type() const; + enum_field_types field_type() const { return fld_type; }; + enum Type type() const { return TYPE_HOLDER; } + double val_real(); + longlong val_int(); + my_decimal *val_decimal(my_decimal *); + String *val_str(String*); + In_C_you_should_use_my_bool_instead() join_types(THD *thd, Item *); + Field *make_field_by_type(TABLE *table); + static uint32 display_length(Item *item); + static enum_field_types get_real_type(Item *); + Field::geometry_type get_geometry_type() const { return geometry_type; }; +}; +class st_select_lex; +void mark_select_range_as_dependent(THD *thd, + st_select_lex *last_select, + st_select_lex *current_sel, + Field *found_field, Item *found_item, + Item_ident *resolved_item); +extern Cached_item *new_Cached_item(THD *thd, Item *item); +extern Item_result item_cmp_type(Item_result a,Item_result b); +extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item); +extern In_C_you_should_use_my_bool_instead() field_is_equal_to_item(Field *field,Item *item); +extern my_decimal decimal_zero; +void free_items(Item *item); +void cleanup_items(Item *item); +class THD; +void close_thread_tables(THD *thd); +In_C_you_should_use_my_bool_instead() check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables); +In_C_you_should_use_my_bool_instead() check_single_table_access(THD *thd, ulong privilege, + TABLE_LIST *tables, In_C_you_should_use_my_bool_instead() no_errors); +In_C_you_should_use_my_bool_instead() check_routine_access(THD *thd,ulong want_access,char *db,char *name, + In_C_you_should_use_my_bool_instead() is_proc, In_C_you_should_use_my_bool_instead() no_errors); +In_C_you_should_use_my_bool_instead() check_some_access(THD *thd, ulong want_access, TABLE_LIST *table); +In_C_you_should_use_my_bool_instead() check_some_routine_access(THD *thd, const char *db, const char *name, In_C_you_should_use_my_bool_instead() is_proc); +In_C_you_should_use_my_bool_instead() multi_update_precheck(THD *thd, TABLE_LIST *tables); +In_C_you_should_use_my_bool_instead() multi_delete_precheck(THD *thd, TABLE_LIST *tables); +int mysql_multi_update_prepare(THD *thd); +int mysql_multi_delete_prepare(THD *thd); +In_C_you_should_use_my_bool_instead() mysql_insert_select_prepare(THD *thd); +In_C_you_should_use_my_bool_instead() update_precheck(THD *thd, TABLE_LIST *tables); +In_C_you_should_use_my_bool_instead() delete_precheck(THD *thd, TABLE_LIST *tables); +In_C_you_should_use_my_bool_instead() insert_precheck(THD *thd, TABLE_LIST *tables); +In_C_you_should_use_my_bool_instead() create_table_precheck(THD *thd, TABLE_LIST *tables, + TABLE_LIST *create_table); +int append_query_string(CHARSET_INFO *csinfo, + String const *from, String *to); +void get_default_definer(THD *thd, LEX_USER *definer); +LEX_USER *create_default_definer(THD *thd); +LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name); +LEX_USER *get_current_user(THD *thd, LEX_USER *user); +In_C_you_should_use_my_bool_instead() check_string_byte_length(LEX_STRING *str, const char *err_msg, + uint max_byte_length); +In_C_you_should_use_my_bool_instead() check_string_char_length(LEX_STRING *str, const char *err_msg, + uint max_char_length, CHARSET_INFO *cs, + In_C_you_should_use_my_bool_instead() no_error); +In_C_you_should_use_my_bool_instead() test_if_data_home_dir(const char *dir); +In_C_you_should_use_my_bool_instead() parse_sql(THD *thd, + class Lex_input_stream *lip, + class Object_creation_ctx *creation_ctx); +enum enum_mysql_completiontype { + ROLLBACK_RELEASE=-2, ROLLBACK=1, ROLLBACK_AND_CHAIN=7, + COMMIT_RELEASE=-1, COMMIT=0, COMMIT_AND_CHAIN=6 +}; +In_C_you_should_use_my_bool_instead() begin_trans(THD *thd); +In_C_you_should_use_my_bool_instead() end_active_trans(THD *thd); +int end_trans(THD *thd, enum enum_mysql_completiontype completion); +Item *negate_expression(THD *thd, Item *expr); +int vprint_msg_to_log(enum loglevel level, const char *format, va_list args); +void sql_print_error(const char *format, ...) __attribute__((format(printf, 1, 2))); +void sql_print_warning(const char *format, ...) __attribute__((format(printf, 1, 2))); +void sql_print_information(const char *format, ...) + __attribute__((format(printf, 1, 2))); +typedef void (*sql_print_message_func)(const char *format, ...) + __attribute__((format(printf, 1, 2))); +extern sql_print_message_func sql_print_message_handlers[]; +int error_log_print(enum loglevel level, const char *format, + va_list args); +In_C_you_should_use_my_bool_instead() slow_log_print(THD *thd, const char *query, uint query_length, + ulonglong current_utime); +In_C_you_should_use_my_bool_instead() general_log_print(THD *thd, enum enum_server_command command, + const char *format,...); +In_C_you_should_use_my_bool_instead() general_log_write(THD *thd, enum enum_server_command command, + const char *query, uint query_length); +#include "sql_class.h" +#include "log.h" +class Relay_log_info; +class Format_description_log_event; +class TC_LOG +{ + public: + int using_heuristic_recover(); + TC_LOG() {} + virtual ~TC_LOG() {} + virtual int open(const char *opt_name)=0; + virtual void close()=0; + virtual int log_xid(THD *thd, my_xid xid)=0; + virtual void unlog(ulong cookie, my_xid xid)=0; +}; +class TC_LOG_DUMMY: public TC_LOG +{ +public: + TC_LOG_DUMMY() {} + int open(const char *opt_name) { return 0; } + void close() { } + int log_xid(THD *thd, my_xid xid) { return 1; } + void unlog(ulong cookie, my_xid xid) { } +}; +class TC_LOG_MMAP: public TC_LOG +{ + public: + typedef enum { + POOL, + ERROR, + DIRTY + } PAGE_STATE; + private: + typedef struct st_page { + struct st_page *next; + my_xid *start, *end; + my_xid *ptr; + int size, free; + int waiters; + PAGE_STATE state; + pthread_mutex_t lock; + pthread_cond_t cond; + } PAGE; + char logname[512]; + File fd; + my_off_t file_length; + uint npages, inited; + uchar *data; + struct st_page *pages, *syncing, *active, *pool, *pool_last; + pthread_mutex_t LOCK_active, LOCK_pool, LOCK_sync; + pthread_cond_t COND_pool, COND_active; + public: + TC_LOG_MMAP(): inited(0) {} + int open(const char *opt_name); + void close(); + int log_xid(THD *thd, my_xid xid); + void unlog(ulong cookie, my_xid xid); + int recover(); + private: + void get_active_from_pool(); + int sync(); + int overflow(); +}; +extern TC_LOG *tc_log; +extern TC_LOG_MMAP tc_log_mmap; +extern TC_LOG_DUMMY tc_log_dummy; +class Relay_log_info; +typedef struct st_log_info +{ + char log_file_name[512]; + my_off_t index_file_offset, index_file_start_offset; + my_off_t pos; + In_C_you_should_use_my_bool_instead() fatal; + pthread_mutex_t lock; + st_log_info() + : index_file_offset(0), index_file_start_offset(0), + pos(0), fatal(0) + { + log_file_name[0] = '\0'; + pthread_mutex_init(&lock, NULL); + } + ~st_log_info() { pthread_mutex_destroy(&lock);} +} LOG_INFO; +class Log_event; +class Rows_log_event; +enum enum_log_type { LOG_UNKNOWN, LOG_NORMAL, LOG_BIN }; +enum enum_log_state { LOG_OPENED, LOG_CLOSED, LOG_TO_BE_OPENED }; +class MYSQL_LOG +{ +public: + MYSQL_LOG(); + void init_pthread_objects(); + void cleanup(); + In_C_you_should_use_my_bool_instead() open(const char *log_name, + enum_log_type log_type, + const char *new_name, + enum cache_type io_cache_type_arg); + void init(enum_log_type log_type_arg, + enum cache_type io_cache_type_arg); + void close(uint exiting); + inline In_C_you_should_use_my_bool_instead() is_open() { return log_state != LOG_CLOSED; } + const char *generate_name(const char *log_name, const char *suffix, + In_C_you_should_use_my_bool_instead() strip_ext, char *buff); + int generate_new_name(char *new_name, const char *log_name); + protected: + pthread_mutex_t LOCK_log; + char *name; + char log_file_name[512]; + char time_buff[20], db[(64*3) + 1]; + In_C_you_should_use_my_bool_instead() write_error, inited; + IO_CACHE log_file; + enum_log_type log_type; + volatile enum_log_state log_state; + enum cache_type io_cache_type; + friend class Log_event; +}; +class MYSQL_QUERY_LOG: public MYSQL_LOG +{ +public: + MYSQL_QUERY_LOG() : last_time(0) {} + void reopen_file(); + In_C_you_should_use_my_bool_instead() write(time_t event_time, const char *user_host, + uint user_host_len, int thread_id, + const char *command_type, uint command_type_len, + const char *sql_text, uint sql_text_len); + In_C_you_should_use_my_bool_instead() write(THD *thd, time_t current_time, time_t query_start_arg, + const char *user_host, uint user_host_len, + ulonglong query_utime, ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command, + const char *sql_text, uint sql_text_len); + In_C_you_should_use_my_bool_instead() open_slow_log(const char *log_name) + { + char buf[512]; + return open(generate_name(log_name, "-slow.log", 0, buf), LOG_NORMAL, 0, + WRITE_CACHE); + } + In_C_you_should_use_my_bool_instead() open_query_log(const char *log_name) + { + char buf[512]; + return open(generate_name(log_name, ".log", 0, buf), LOG_NORMAL, 0, + WRITE_CACHE); + } +private: + time_t last_time; +}; +class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG +{ + private: + pthread_mutex_t LOCK_index; + pthread_mutex_t LOCK_prep_xids; + pthread_cond_t COND_prep_xids; + pthread_cond_t update_cond; + ulonglong bytes_written; + IO_CACHE index_file; + char index_file_name[512]; + ulong max_size; + long prepared_xids; + uint file_id; + uint open_count; + int readers_count; + In_C_you_should_use_my_bool_instead() need_start_event; + In_C_you_should_use_my_bool_instead() no_auto_events; + ulonglong m_table_map_version; + int write_to_file(IO_CACHE *cache); + void new_file_without_locking(); + void new_file_impl(In_C_you_should_use_my_bool_instead() need_lock); +public: + MYSQL_LOG::generate_name; + MYSQL_LOG::is_open; + Format_description_log_event *description_event_for_exec, + *description_event_for_queue; + MYSQL_BIN_LOG(); + int open(const char *opt_name); + void close(); + int log_xid(THD *thd, my_xid xid); + void unlog(ulong cookie, my_xid xid); + int recover(IO_CACHE *log, Format_description_log_event *fdle); + In_C_you_should_use_my_bool_instead() is_table_mapped(TABLE *table) const + { + return table->s->table_map_version == table_map_version(); + } + ulonglong table_map_version() const { return m_table_map_version; } + void update_table_map_version() { ++m_table_map_version; } + int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event); + void reset_bytes_written() + { + bytes_written = 0; + } + void harvest_bytes_written(ulonglong* counter) + { + char buf1[22],buf2[22]; + const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("harvest_bytes_written","./sql/log.h",321,&_db_func_,&_db_file_,&_db_level_, &_db_framep_); + (*counter)+=bytes_written; + do {_db_pargs_(324,"info"); _db_doprnt_ ("counter: %s bytes_written: %s", llstr(*counter,buf1), llstr(bytes_written,buf2));} while(0); + bytes_written=0; + do {_db_return_ (326, &_db_func_, &_db_file_, &_db_level_); return;} while(0); + } + void set_max_size(ulong max_size_arg); + void signal_update(); + void wait_for_update(THD* thd, In_C_you_should_use_my_bool_instead() master_or_slave); + void set_need_start_event() { need_start_event = 1; } + void init(In_C_you_should_use_my_bool_instead() no_auto_events_arg, ulong max_size); + void init_pthread_objects(); + void cleanup(); + In_C_you_should_use_my_bool_instead() open(const char *log_name, + enum_log_type log_type, + const char *new_name, + enum cache_type io_cache_type_arg, + In_C_you_should_use_my_bool_instead() no_auto_events_arg, ulong max_size, + In_C_you_should_use_my_bool_instead() null_created); + In_C_you_should_use_my_bool_instead() open_index_file(const char *index_file_name_arg, + const char *log_name); + void new_file(); + In_C_you_should_use_my_bool_instead() write(Log_event* event_info); + In_C_you_should_use_my_bool_instead() write(THD *thd, IO_CACHE *cache, Log_event *commit_event); + int write_cache(IO_CACHE *cache, In_C_you_should_use_my_bool_instead() lock_log, In_C_you_should_use_my_bool_instead() flush_and_sync); + void start_union_events(THD *thd, query_id_t query_id_param); + void stop_union_events(THD *thd); + In_C_you_should_use_my_bool_instead() is_query_in_union(THD *thd, query_id_t query_id_param); + In_C_you_should_use_my_bool_instead() appendv(const char* buf,uint len,...); + In_C_you_should_use_my_bool_instead() append(Log_event* ev); + void make_log_name(char* buf, const char* log_ident); + In_C_you_should_use_my_bool_instead() is_active(const char* log_file_name); + int update_log_index(LOG_INFO* linfo, In_C_you_should_use_my_bool_instead() need_update_threads); + void rotate_and_purge(uint flags); + In_C_you_should_use_my_bool_instead() flush_and_sync(); + int purge_logs(const char *to_log, In_C_you_should_use_my_bool_instead() included, + In_C_you_should_use_my_bool_instead() need_mutex, In_C_you_should_use_my_bool_instead() need_update_threads, + ulonglong *decrease_log_space); + int purge_logs_before_date(time_t purge_time); + int purge_first_log(Relay_log_info* rli, In_C_you_should_use_my_bool_instead() included); + In_C_you_should_use_my_bool_instead() reset_logs(THD* thd); + void close(uint exiting); + int find_log_pos(LOG_INFO* linfo, const char* log_name, + In_C_you_should_use_my_bool_instead() need_mutex); + int find_next_log(LOG_INFO* linfo, In_C_you_should_use_my_bool_instead() need_mutex); + int get_current_log(LOG_INFO* linfo); + int raw_get_current_log(LOG_INFO* linfo); + uint next_file_id(); + inline char* get_index_fname() { return index_file_name;} + inline char* get_log_fname() { return log_file_name; } + inline char* get_name() { return name; } + inline pthread_mutex_t* get_log_lock() { return &LOCK_log; } + inline IO_CACHE* get_log_file() { return &log_file; } + inline void lock_index() { pthread_mutex_lock(&LOCK_index);} + inline void unlock_index() { pthread_mutex_unlock(&LOCK_index);} + inline IO_CACHE *get_index_file() { return &index_file;} + inline uint32 get_open_count() { return open_count; } +}; +class Log_event_handler +{ +public: + Log_event_handler() {} + virtual In_C_you_should_use_my_bool_instead() init()= 0; + virtual void cleanup()= 0; + virtual In_C_you_should_use_my_bool_instead() log_slow(THD *thd, time_t current_time, + time_t query_start_arg, const char *user_host, + uint user_host_len, ulonglong query_utime, + ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command, + const char *sql_text, uint sql_text_len)= 0; + virtual In_C_you_should_use_my_bool_instead() log_error(enum loglevel level, const char *format, + va_list args)= 0; + virtual In_C_you_should_use_my_bool_instead() log_general(THD *thd, time_t event_time, const char *user_host, + uint user_host_len, int thread_id, + const char *command_type, uint command_type_len, + const char *sql_text, uint sql_text_len, + CHARSET_INFO *client_cs)= 0; + virtual ~Log_event_handler() {} +}; +int check_if_log_table(uint db_len, const char *db, uint table_name_len, + const char *table_name, uint check_if_opened); +class Log_to_csv_event_handler: public Log_event_handler +{ + friend class LOGGER; +public: + Log_to_csv_event_handler(); + ~Log_to_csv_event_handler(); + virtual In_C_you_should_use_my_bool_instead() init(); + virtual void cleanup(); + virtual In_C_you_should_use_my_bool_instead() log_slow(THD *thd, time_t current_time, + time_t query_start_arg, const char *user_host, + uint user_host_len, ulonglong query_utime, + ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command, + const char *sql_text, uint sql_text_len); + virtual In_C_you_should_use_my_bool_instead() log_error(enum loglevel level, const char *format, + va_list args); + virtual In_C_you_should_use_my_bool_instead() log_general(THD *thd, time_t event_time, const char *user_host, + uint user_host_len, int thread_id, + const char *command_type, uint command_type_len, + const char *sql_text, uint sql_text_len, + CHARSET_INFO *client_cs); + int activate_log(THD *thd, uint log_type); +}; +class Log_to_file_event_handler: public Log_event_handler +{ + MYSQL_QUERY_LOG mysql_log; + MYSQL_QUERY_LOG mysql_slow_log; + In_C_you_should_use_my_bool_instead() is_initialized; +public: + Log_to_file_event_handler(): is_initialized((0)) + {} + virtual In_C_you_should_use_my_bool_instead() init(); + virtual void cleanup(); + virtual In_C_you_should_use_my_bool_instead() log_slow(THD *thd, time_t current_time, + time_t query_start_arg, const char *user_host, + uint user_host_len, ulonglong query_utime, + ulonglong lock_utime, In_C_you_should_use_my_bool_instead() is_command, + const char *sql_text, uint sql_text_len); + virtual In_C_you_should_use_my_bool_instead() log_error(enum loglevel level, const char *format, + va_list args); + virtual In_C_you_should_use_my_bool_instead() log_general(THD *thd, time_t event_time, const char *user_host, + uint user_host_len, int thread_id, + const char *command_type, uint command_type_len, + const char *sql_text, uint sql_text_len, + CHARSET_INFO *client_cs); + void flush(); + void init_pthread_objects(); + MYSQL_QUERY_LOG *get_mysql_slow_log() { return &mysql_slow_log; } + MYSQL_QUERY_LOG *get_mysql_log() { return &mysql_log; } +}; +class LOGGER +{ + pthread_rwlock_t LOCK_logger; + uint inited; + Log_to_csv_event_handler *table_log_handler; + Log_to_file_event_handler *file_log_handler; + Log_event_handler *error_log_handler_list[3 + 1]; + Log_event_handler *slow_log_handler_list[3 + 1]; + Log_event_handler *general_log_handler_list[3 + 1]; +public: + In_C_you_should_use_my_bool_instead() is_log_tables_initialized; + LOGGER() : inited(0), table_log_handler(NULL), + file_log_handler(NULL), is_log_tables_initialized((0)) + {} + void lock_shared() { pthread_rwlock_rdlock(&LOCK_logger); } + void lock_exclusive() { pthread_rwlock_wrlock(&LOCK_logger); } + void unlock() { pthread_rwlock_unlock(&LOCK_logger); } + In_C_you_should_use_my_bool_instead() is_log_table_enabled(uint log_table_type); + In_C_you_should_use_my_bool_instead() log_command(THD *thd, enum enum_server_command command); + void init_base(); + void init_log_tables(); + In_C_you_should_use_my_bool_instead() flush_logs(THD *thd); + void cleanup_base(); + void cleanup_end(); + In_C_you_should_use_my_bool_instead() error_log_print(enum loglevel level, const char *format, + va_list args); + In_C_you_should_use_my_bool_instead() slow_log_print(THD *thd, const char *query, uint query_length, + ulonglong current_utime); + In_C_you_should_use_my_bool_instead() general_log_print(THD *thd,enum enum_server_command command, + const char *format, va_list args); + In_C_you_should_use_my_bool_instead() general_log_write(THD *thd, enum enum_server_command command, + const char *query, uint query_length); + int set_handlers(uint error_log_printer, + uint slow_log_printer, + uint general_log_printer); + void init_error_log(uint error_log_printer); + void init_slow_log(uint slow_log_printer); + void init_general_log(uint general_log_printer); + void deactivate_log_handler(THD* thd, uint log_type); + In_C_you_should_use_my_bool_instead() activate_log_handler(THD* thd, uint log_type); + MYSQL_QUERY_LOG *get_slow_log_file_handler() + { + if (file_log_handler) + return file_log_handler->get_mysql_slow_log(); + return NULL; + } + MYSQL_QUERY_LOG *get_log_file_handler() + { + if (file_log_handler) + return file_log_handler->get_mysql_log(); + return NULL; + } +}; +enum enum_binlog_format { + BINLOG_FORMAT_MIXED= 0, + BINLOG_FORMAT_STMT= 1, + BINLOG_FORMAT_ROW= 2, + BINLOG_FORMAT_UNSPEC= 3 +}; +extern TYPELIB binlog_format_typelib; +#include "rpl_tblmap.h" +struct st_table; +typedef st_table TABLE; +class table_mapping { +private: + MEM_ROOT m_mem_root; +public: + enum enum_error { + ERR_NO_ERROR = 0, + ERR_LIMIT_EXCEEDED, + ERR_MEMORY_ALLOCATION + }; + table_mapping(); + ~table_mapping(); + TABLE* get_table(ulong table_id); + int set_table(ulong table_id, TABLE* table); + int remove_table(ulong table_id); + void clear_tables(); + ulong count() const { return m_table_ids.records; } +private: + struct entry { + ulong table_id; + union { + TABLE *table; + entry *next; + }; + }; + entry *find_entry(ulong table_id) + { + return (entry *)hash_search(&m_table_ids, + (uchar*)&table_id, + sizeof(table_id)); + } + int expand(); + entry *m_free; + HASH m_table_ids; +}; +class Reprepare_observer +{ +public: + In_C_you_should_use_my_bool_instead() report_error(THD *thd); + In_C_you_should_use_my_bool_instead() is_invalidated() const { return m_invalidated; } + void reset_reprepare_observer() { m_invalidated= (0); } +private: + In_C_you_should_use_my_bool_instead() m_invalidated; +}; +class Relay_log_info; +class Query_log_event; +class Load_log_event; +class Slave_log_event; +class sp_rcontext; +class sp_cache; +class Lex_input_stream; +class Rows_log_event; +enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; +enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME }; +enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE }; +enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON, + DELAY_KEY_WRITE_ALL }; +enum enum_slave_exec_mode { SLAVE_EXEC_MODE_STRICT, + SLAVE_EXEC_MODE_IDEMPOTENT, + SLAVE_EXEC_MODE_LAST_BIT}; +enum enum_mark_columns +{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE}; +extern char internal_table_name[2]; +extern char empty_c_string[1]; +extern const char **errmesg; +extern uint tc_heuristic_recover; +typedef struct st_user_var_events +{ + user_var_entry *user_var_event; + char *value; + ulong length; + Item_result type; + uint charset_number; +} BINLOG_USER_VAR_EVENT; +typedef struct st_copy_info { + ha_rows records; + ha_rows deleted; + ha_rows updated; + ha_rows copied; + ha_rows error_count; + ha_rows touched; + enum enum_duplicates handle_duplicates; + int escape_char, last_errno; + In_C_you_should_use_my_bool_instead() ignore; + List *update_fields; + List *update_values; + TABLE_LIST *view; +} COPY_INFO; +class Key_part_spec :public Sql_alloc { +public: + const char *field_name; + uint length; + Key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {} + In_C_you_should_use_my_bool_instead() operator==(const Key_part_spec& other) const; + Key_part_spec *clone(MEM_ROOT *mem_root) const + { return new (mem_root) Key_part_spec(*this); } +}; +class Alter_drop :public Sql_alloc { +public: + enum drop_type {KEY, COLUMN }; + const char *name; + enum drop_type type; + Alter_drop(enum drop_type par_type,const char *par_name) + :name(par_name), type(par_type) {} + Alter_drop *clone(MEM_ROOT *mem_root) const + { return new (mem_root) Alter_drop(*this); } +}; +class Alter_column :public Sql_alloc { +public: + const char *name; + Item *def; + Alter_column(const char *par_name,Item *literal) + :name(par_name), def(literal) {} + Alter_column *clone(MEM_ROOT *mem_root) const + { return new (mem_root) Alter_column(*this); } +}; +class Key :public Sql_alloc { +public: + enum Keytype { PRIMARY, UNIQUE, MULTIPLE, FULLTEXT, SPATIAL, FOREIGN_KEY}; + enum Keytype type; + KEY_CREATE_INFO key_create_info; + List columns; + const char *name; + In_C_you_should_use_my_bool_instead() generated; + Key(enum Keytype type_par, const char *name_arg, + KEY_CREATE_INFO *key_info_arg, + In_C_you_should_use_my_bool_instead() generated_arg, List &cols) + :type(type_par), key_create_info(*key_info_arg), columns(cols), + name(name_arg), generated(generated_arg) + {} + Key(const Key &rhs, MEM_ROOT *mem_root); + virtual ~Key() {} + friend In_C_you_should_use_my_bool_instead() foreign_key_prefix(Key *a, Key *b); + virtual Key *clone(MEM_ROOT *mem_root) const + { return new (mem_root) Key(*this, mem_root); } +}; +class Table_ident; +class Foreign_key: public Key { +public: + enum fk_match_opt { FK_MATCH_UNDEF, FK_MATCH_FULL, + FK_MATCH_PARTIAL, FK_MATCH_SIMPLE}; + enum fk_option { FK_OPTION_UNDEF, FK_OPTION_RESTRICT, FK_OPTION_CASCADE, + FK_OPTION_SET_NULL, FK_OPTION_NO_ACTION, FK_OPTION_DEFAULT}; + Table_ident *ref_table; + List ref_columns; + uint delete_opt, update_opt, match_opt; + Foreign_key(const char *name_arg, List &cols, + Table_ident *table, List &ref_cols, + uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg) + :Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols), + ref_table(table), ref_columns(ref_cols), + delete_opt(delete_opt_arg), update_opt(update_opt_arg), + match_opt(match_opt_arg) + {} + Foreign_key(const Foreign_key &rhs, MEM_ROOT *mem_root); + virtual Key *clone(MEM_ROOT *mem_root) const + { return new (mem_root) Foreign_key(*this, mem_root); } +}; +typedef struct st_mysql_lock +{ + TABLE **table; + uint table_count,lock_count; + THR_LOCK_DATA **locks; +} MYSQL_LOCK; +class LEX_COLUMN : public Sql_alloc +{ +public: + String column; + uint rights; + LEX_COLUMN (const String& x,const uint& y ): column (x),rights (y) {} +}; +#include "sql_lex.h" +class Table_ident; +class sql_exchange; +class LEX_COLUMN; +class sp_head; +class sp_name; +class sp_instr; +class sp_pcontext; +class st_alter_tablespace; +class partition_info; +class Event_parse_data; +enum enum_sql_command { + SQLCOM_SELECT, SQLCOM_CREATE_TABLE, SQLCOM_CREATE_INDEX, SQLCOM_ALTER_TABLE, + SQLCOM_UPDATE, SQLCOM_INSERT, SQLCOM_INSERT_SELECT, + SQLCOM_DELETE, SQLCOM_TRUNCATE, SQLCOM_DROP_TABLE, SQLCOM_DROP_INDEX, + SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS, + SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_STATUS, + SQLCOM_SHOW_ENGINE_LOGS, SQLCOM_SHOW_ENGINE_STATUS, SQLCOM_SHOW_ENGINE_MUTEX, + SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT, + SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS, + SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS, + SQLCOM_SHOW_TRIGGERS, + SQLCOM_LOAD,SQLCOM_SET_OPTION,SQLCOM_LOCK_TABLES,SQLCOM_UNLOCK_TABLES, + SQLCOM_GRANT, + SQLCOM_CHANGE_DB, SQLCOM_CREATE_DB, SQLCOM_DROP_DB, SQLCOM_ALTER_DB, + SQLCOM_REPAIR, SQLCOM_REPLACE, SQLCOM_REPLACE_SELECT, + SQLCOM_CREATE_FUNCTION, SQLCOM_DROP_FUNCTION, + SQLCOM_REVOKE,SQLCOM_OPTIMIZE, SQLCOM_CHECK, + SQLCOM_ASSIGN_TO_KEYCACHE, SQLCOM_PRELOAD_KEYS, + SQLCOM_FLUSH, SQLCOM_KILL, SQLCOM_ANALYZE, + SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT, + SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT, + SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP, + SQLCOM_BEGIN, SQLCOM_LOAD_MASTER_TABLE, SQLCOM_CHANGE_MASTER, + SQLCOM_RENAME_TABLE, SQLCOM_BACKUP_TABLE, SQLCOM_RESTORE_TABLE, + SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS, + SQLCOM_SHOW_OPEN_TABLES, SQLCOM_LOAD_MASTER_DATA, + SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ, + SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI, + SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO, + SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS, + SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES, + SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER, + SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM, + SQLCOM_CREATE_PROCEDURE, SQLCOM_CREATE_SPFUNCTION, SQLCOM_CALL, + SQLCOM_DROP_PROCEDURE, SQLCOM_ALTER_PROCEDURE,SQLCOM_ALTER_FUNCTION, + SQLCOM_SHOW_CREATE_PROC, SQLCOM_SHOW_CREATE_FUNC, + SQLCOM_SHOW_STATUS_PROC, SQLCOM_SHOW_STATUS_FUNC, + SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE, + SQLCOM_CREATE_VIEW, SQLCOM_DROP_VIEW, + SQLCOM_CREATE_TRIGGER, SQLCOM_DROP_TRIGGER, + SQLCOM_XA_START, SQLCOM_XA_END, SQLCOM_XA_PREPARE, + SQLCOM_XA_COMMIT, SQLCOM_XA_ROLLBACK, SQLCOM_XA_RECOVER, + SQLCOM_SHOW_PROC_CODE, SQLCOM_SHOW_FUNC_CODE, + SQLCOM_ALTER_TABLESPACE, + SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN, + SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT, + SQLCOM_SHOW_PLUGINS, + SQLCOM_SHOW_CONTRIBUTORS, + SQLCOM_CREATE_SERVER, SQLCOM_DROP_SERVER, SQLCOM_ALTER_SERVER, + SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT, + SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS, + SQLCOM_SHOW_CREATE_TRIGGER, + SQLCOM_ALTER_DB_UPGRADE, + SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES, + SQLCOM_END +}; +class Delayed_insert; +class select_result; +class Time_zone; +struct system_variables +{ + ulong dynamic_variables_version; + char* dynamic_variables_ptr; + uint dynamic_variables_head; + uint dynamic_variables_size; + ulonglong myisam_max_extra_sort_file_size; + ulonglong myisam_max_sort_file_size; + ulonglong max_heap_table_size; + ulonglong tmp_table_size; + ulonglong long_query_time; + ha_rows select_limit; + ha_rows max_join_size; + ulong auto_increment_increment, auto_increment_offset; + ulong bulk_insert_buff_size; + ulong join_buff_size; + ulong max_allowed_packet; + ulong max_error_count; + ulong max_length_for_sort_data; + ulong max_sort_length; + ulong max_tmp_tables; + ulong max_insert_delayed_threads; + ulong min_examined_row_limit; + ulong multi_range_count; + ulong myisam_repair_threads; + ulong myisam_sort_buff_size; + ulong myisam_stats_method; + ulong net_buffer_length; + ulong net_interactive_timeout; + ulong net_read_timeout; + ulong net_retry_count; + ulong net_wait_timeout; + ulong net_write_timeout; + ulong optimizer_prune_level; + ulong optimizer_search_depth; + ulong preload_buff_size; + ulong profiling_history_size; + ulong query_cache_type; + ulong read_buff_size; + ulong read_rnd_buff_size; + ulong div_precincrement; + ulong sortbuff_size; + ulong thread_handling; + ulong tx_isolation; + ulong completion_type; + ulong sql_mode; + ulong max_sp_recursion_depth; + ulong updatable_views_with_limit; + ulong default_week_format; + ulong max_seeks_for_key; + ulong range_alloc_block_size; + ulong query_alloc_block_size; + ulong query_prealloc_size; + ulong trans_alloc_block_size; + ulong trans_prealloc_size; + ulong log_warnings; + ulong group_concat_max_len; + ulong ndb_autoincrement_prefetch_sz; + ulong ndb_index_stat_cache_entries; + ulong ndb_index_stat_update_freq; + ulong binlog_format; + my_thread_id pseudo_thread_id; + my_bool low_priority_updates; + my_bool new_mode; + my_bool old_mode; + my_bool query_cache_wlock_invalidate; + my_bool engine_condition_pushdown; + my_bool keep_files_on_create; + my_bool ndb_force_send; + my_bool ndb_use_copying_alter_table; + my_bool ndb_use_exact_count; + my_bool ndb_use_transactions; + my_bool ndb_index_stat_enable; + my_bool old_alter_table; + my_bool old_passwords; + plugin_ref table_plugin; + CHARSET_INFO *character_set_filesystem; + CHARSET_INFO *character_set_client; + CHARSET_INFO *character_set_results; + CHARSET_INFO *collation_server; + CHARSET_INFO *collation_database; + CHARSET_INFO *collation_connection; + MY_LOCALE *lc_time_names; + Time_zone *time_zone; + DATE_TIME_FORMAT *date_format; + DATE_TIME_FORMAT *datetime_format; + DATE_TIME_FORMAT *time_format; + my_bool sysdate_is_now; +}; +typedef struct system_status_var +{ + ulonglong bytes_received; + ulonglong bytes_sent; + ulong com_other; + ulong com_stat[(uint) SQLCOM_END]; + ulong created_tmp_disk_tables; + ulong created_tmp_tables; + ulong ha_commit_count; + ulong ha_delete_count; + ulong ha_read_first_count; + ulong ha_read_last_count; + ulong ha_read_key_count; + ulong ha_read_next_count; + ulong ha_read_prev_count; + ulong ha_read_rnd_count; + ulong ha_read_rnd_next_count; + ulong ha_rollback_count; + ulong ha_update_count; + ulong ha_write_count; + ulong ha_prepare_count; + ulong ha_discover_count; + ulong ha_savepoint_count; + ulong ha_savepoint_rollback_count; + ulong key_blocks_changed; + ulong key_blocks_used; + ulong key_cache_r_requests; + ulong key_cache_read; + ulong key_cache_w_requests; + ulong key_cache_write; + ulong net_big_packet_count; + ulong opened_tables; + ulong opened_shares; + ulong select_full_join_count; + ulong select_full_range_join_count; + ulong select_range_count; + ulong select_range_check_count; + ulong select_scan_count; + ulong long_query_count; + ulong filesort_merge_passes; + ulong filesort_range_count; + ulong filesort_rows; + ulong filesort_scan_count; + ulong com_stmt_prepare; + ulong com_stmt_reprepare; + ulong com_stmt_execute; + ulong com_stmt_send_long_data; + ulong com_stmt_fetch; + ulong com_stmt_reset; + ulong com_stmt_close; + double last_query_cost; +} STATUS_VAR; +void mark_transaction_to_rollback(THD *thd, In_C_you_should_use_my_bool_instead() all); +#include "sql_acl.h" +#include "slave.h" +#include "log.h" +#include "my_list.h" +#include "rpl_filter.h" +#include "mysql.h" +#include "mysql_version.h" +#include "mysql_com.h" +#include "mysql_time.h" +#include "my_list.h" +extern unsigned int mysql_port; +extern char *mysql_unix_port; +typedef struct st_mysql_field { + char *name; + char *org_name; + char *table; + char *org_table; + char *db; + char *catalog; + char *def; + unsigned long length; + unsigned long max_length; + unsigned int name_length; + unsigned int org_name_length; + unsigned int table_length; + unsigned int org_table_length; + unsigned int db_length; + unsigned int catalog_length; + unsigned int def_length; + unsigned int flags; + unsigned int decimals; + unsigned int charsetnr; + enum enum_field_types type; + void *extension; +} MYSQL_FIELD; +typedef char **MYSQL_ROW; +typedef unsigned int MYSQL_FIELD_OFFSET; +#include "typelib.h" +typedef struct st_mysql_rows { + struct st_mysql_rows *next; + MYSQL_ROW data; + unsigned long length; +} MYSQL_ROWS; +typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; +#include "my_alloc.h" +typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; +typedef struct st_mysql_data { + MYSQL_ROWS *data; + struct embedded_query_result *embedded_info; + MEM_ROOT alloc; + my_ulonglong rows; + unsigned int fields; + void *extension; +} MYSQL_DATA; +enum mysql_option +{ + MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE, + MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, + MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, + MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, + MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, + MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, + MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, + MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, + MYSQL_OPT_SSL_VERIFY_SERVER_CERT +}; +struct st_mysql_options { + unsigned int connect_timeout, read_timeout, write_timeout; + unsigned int port, protocol; + unsigned long client_flag; + char *host,*user,*password,*unix_socket,*db; + struct st_dynamic_array *init_commands; + char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; + char *ssl_key; + char *ssl_cert; + char *ssl_ca; + char *ssl_capath; + char *ssl_cipher; + char *shared_memory_base_name; + unsigned long max_allowed_packet; + my_bool use_ssl; + my_bool compress,named_pipe; + my_bool rpl_probe; + my_bool rpl_parse; + my_bool no_master_reads; + my_bool separate_thread; + enum mysql_option methods_to_use; + char *client_ip; + my_bool secure_auth; + my_bool report_data_truncation; + int (*local_infile_init)(void **, const char *, void *); + int (*local_infile_read)(void *, char *, unsigned int); + void (*local_infile_end)(void *); + int (*local_infile_error)(void *, char *, unsigned int); + void *local_infile_userdata; + void *extension; +}; +enum mysql_status +{ + MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT +}; +enum mysql_protocol_type +{ + MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, + MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY +}; +enum mysql_rpl_type +{ + MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN +}; +typedef struct character_set +{ + unsigned int number; + unsigned int state; + const char *csname; + const char *name; + const char *comment; + const char *dir; + unsigned int mbminlen; + unsigned int mbmaxlen; +} MY_CHARSET_INFO; +struct st_mysql_methods; +struct st_mysql_stmt; +typedef struct st_mysql +{ + NET net; + unsigned char *connector_fd; + char *host,*user,*passwd,*unix_socket,*server_version,*host_info; + char *info, *db; + struct charset_info_st *charset; + MYSQL_FIELD *fields; + MEM_ROOT field_alloc; + my_ulonglong affected_rows; + my_ulonglong insert_id; + my_ulonglong extra_info; + unsigned long thread_id; + unsigned long packet_length; + unsigned int port; + unsigned long client_flag,server_capabilities; + unsigned int protocol_version; + unsigned int field_count; + unsigned int server_status; + unsigned int server_language; + unsigned int warning_count; + struct st_mysql_options options; + enum mysql_status status; + my_bool free_me; + my_bool reconnect; + char scramble[20 +1]; + my_bool rpl_pivot; + struct st_mysql* master, *next_slave; + struct st_mysql* last_used_slave; + struct st_mysql* last_used_con; + LIST *stmts; + const struct st_mysql_methods *methods; + void *thd; + my_bool *unbuffered_fetch_owner; + char *info_buffer; + void *extension; +} MYSQL; +typedef struct st_mysql_res { + my_ulonglong row_count; + MYSQL_FIELD *fields; + MYSQL_DATA *data; + MYSQL_ROWS *data_cursor; + unsigned long *lengths; + MYSQL *handle; + const struct st_mysql_methods *methods; + MYSQL_ROW row; + MYSQL_ROW current_row; + MEM_ROOT field_alloc; + unsigned int field_count, current_field; + my_bool eof; + my_bool unbuffered_fetch_cancelled; + void *extension; +} MYSQL_RES; +typedef struct st_mysql_manager +{ + NET net; + char *host, *user, *passwd; + char *net_buf, *net_buf_pos, *net_data_end; + unsigned int port; + int cmd_status; + int last_errno; + int net_buf_size; + my_bool free_me; + my_bool eof; + char last_error[256]; + void *extension; +} MYSQL_MANAGER; +typedef struct st_mysql_parameters +{ + unsigned long *p_max_allowed_packet; + unsigned long *p_net_buffer_length; + void *extension; +} MYSQL_PARAMETERS; +int mysql_server_init(int argc, char **argv, char **groups); +void mysql_server_end(void); +MYSQL_PARAMETERS * mysql_get_parameters(void); +my_bool mysql_thread_init(void); +void mysql_thread_end(void); +my_ulonglong mysql_num_rows(MYSQL_RES *res); +unsigned int mysql_num_fields(MYSQL_RES *res); +my_bool mysql_eof(MYSQL_RES *res); +MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES *res, + unsigned int fieldnr); +MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES *res); +MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES *res); +MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *res); +unsigned int mysql_field_count(MYSQL *mysql); +my_ulonglong mysql_affected_rows(MYSQL *mysql); +my_ulonglong mysql_insert_id(MYSQL *mysql); +unsigned int mysql_errno(MYSQL *mysql); +const char * mysql_error(MYSQL *mysql); +const char * mysql_sqlstate(MYSQL *mysql); +unsigned int mysql_warning_count(MYSQL *mysql); +const char * mysql_info(MYSQL *mysql); +unsigned long mysql_thread_id(MYSQL *mysql); +const char * mysql_character_set_name(MYSQL *mysql); +int mysql_set_character_set(MYSQL *mysql, const char *csname); +MYSQL * mysql_init(MYSQL *mysql); +my_bool mysql_ssl_set(MYSQL *mysql, const char *key, + const char *cert, const char *ca, + const char *capath, const char *cipher); +const char * mysql_get_ssl_cipher(MYSQL *mysql); +my_bool mysql_change_user(MYSQL *mysql, const char *user, + const char *passwd, const char *db); +MYSQL * mysql_real_connect(MYSQL *mysql, const char *host, + const char *user, + const char *passwd, + const char *db, + unsigned int port, + const char *unix_socket, + unsigned long clientflag); +int mysql_select_db(MYSQL *mysql, const char *db); +int mysql_query(MYSQL *mysql, const char *q); +int mysql_send_query(MYSQL *mysql, const char *q, + unsigned long length); +int mysql_real_query(MYSQL *mysql, const char *q, + unsigned long length); +MYSQL_RES * mysql_store_result(MYSQL *mysql); +MYSQL_RES * mysql_use_result(MYSQL *mysql); +my_bool mysql_master_query(MYSQL *mysql, const char *q, + unsigned long length); +my_bool mysql_master_send_query(MYSQL *mysql, const char *q, + unsigned long length); +my_bool mysql_slave_query(MYSQL *mysql, const char *q, + unsigned long length); +my_bool mysql_slave_send_query(MYSQL *mysql, const char *q, + unsigned long length); +void mysql_get_character_set_info(MYSQL *mysql, + MY_CHARSET_INFO *charset); +void +mysql_set_local_infile_handler(MYSQL *mysql, + int (*local_infile_init)(void **, const char *, + void *), + int (*local_infile_read)(void *, char *, + unsigned int), + void (*local_infile_end)(void *), + int (*local_infile_error)(void *, char*, + unsigned int), + void *); +void +mysql_set_local_infile_default(MYSQL *mysql); +void mysql_enable_rpl_parse(MYSQL* mysql); +void mysql_disable_rpl_parse(MYSQL* mysql); +int mysql_rpl_parse_enabled(MYSQL* mysql); +void mysql_enable_reads_from_master(MYSQL* mysql); +void mysql_disable_reads_from_master(MYSQL* mysql); +my_bool mysql_reads_from_master_enabled(MYSQL* mysql); +enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len); +my_bool mysql_rpl_probe(MYSQL* mysql); +int mysql_set_master(MYSQL* mysql, const char* host, + unsigned int port, + const char* user, + const char* passwd); +int mysql_add_slave(MYSQL* mysql, const char* host, + unsigned int port, + const char* user, + const char* passwd); +int mysql_shutdown(MYSQL *mysql, + enum mysql_enum_shutdown_level + shutdown_level); +int mysql_dump_debug_info(MYSQL *mysql); +int mysql_refresh(MYSQL *mysql, + unsigned int refresh_options); +int mysql_kill(MYSQL *mysql,unsigned long pid); +int mysql_set_server_option(MYSQL *mysql, + enum enum_mysql_set_option + option); +int mysql_ping(MYSQL *mysql); +const char * mysql_stat(MYSQL *mysql); +const char * mysql_get_server_info(MYSQL *mysql); +const char * mysql_get_client_info(void); +unsigned long mysql_get_client_version(void); +const char * mysql_get_host_info(MYSQL *mysql); +unsigned long mysql_get_server_version(MYSQL *mysql); +unsigned int mysql_get_proto_info(MYSQL *mysql); +MYSQL_RES * mysql_list_dbs(MYSQL *mysql,const char *wild); +MYSQL_RES * mysql_list_tables(MYSQL *mysql,const char *wild); +MYSQL_RES * mysql_list_processes(MYSQL *mysql); +int mysql_options(MYSQL *mysql,enum mysql_option option, + const void *arg); +void mysql_free_result(MYSQL_RES *result); +void mysql_data_seek(MYSQL_RES *result, + my_ulonglong offset); +MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES *result, + MYSQL_ROW_OFFSET offset); +MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES *result, + MYSQL_FIELD_OFFSET offset); +MYSQL_ROW mysql_fetch_row(MYSQL_RES *result); +unsigned long * mysql_fetch_lengths(MYSQL_RES *result); +MYSQL_FIELD * mysql_fetch_field(MYSQL_RES *result); +MYSQL_RES * mysql_list_fields(MYSQL *mysql, const char *table, + const char *wild); +unsigned long mysql_escape_string(char *to,const char *from, + unsigned long from_length); +unsigned long mysql_hex_string(char *to,const char *from, + unsigned long from_length); +unsigned long mysql_real_escape_string(MYSQL *mysql, + char *to,const char *from, + unsigned long length); +void mysql_debug(const char *debug); +void myodbc_remove_escape(MYSQL *mysql,char *name); +unsigned int mysql_thread_safe(void); +my_bool mysql_embedded(void); +MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con); +MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con, + const char* host, + const char* user, + const char* passwd, + unsigned int port); +void mysql_manager_close(MYSQL_MANAGER* con); +int mysql_manager_command(MYSQL_MANAGER* con, + const char* cmd, int cmd_len); +int mysql_manager_fetch_line(MYSQL_MANAGER* con, + char* res_buf, + int res_buf_size); +my_bool mysql_read_query_result(MYSQL *mysql); +enum enum_mysql_stmt_state +{ + MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, + MYSQL_STMT_FETCH_DONE +}; +typedef struct st_mysql_bind +{ + unsigned long *length; + my_bool *is_null; + void *buffer; + my_bool *error; + unsigned char *row_ptr; + void (*store_param_func)(NET *net, struct st_mysql_bind *param); + void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *, + unsigned char **row); + void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *, + unsigned char **row); + unsigned long buffer_length; + unsigned long offset; + unsigned long length_value; + unsigned int param_number; + unsigned int pack_length; + enum enum_field_types buffer_type; + my_bool error_value; + my_bool is_unsigned; + my_bool long_data_used; + my_bool is_null_value; + void *extension; +} MYSQL_BIND; +typedef struct st_mysql_stmt +{ + MEM_ROOT mem_root; + LIST list; + MYSQL *mysql; + MYSQL_BIND *params; + MYSQL_BIND *bind; + MYSQL_FIELD *fields; + MYSQL_DATA result; + MYSQL_ROWS *data_cursor; + int (*read_row_func)(struct st_mysql_stmt *stmt, + unsigned char **row); + my_ulonglong affected_rows; + my_ulonglong insert_id; + unsigned long stmt_id; + unsigned long flags; + unsigned long prefetch_rows; + unsigned int server_status; + unsigned int last_errno; + unsigned int param_count; + unsigned int field_count; + enum enum_mysql_stmt_state state; + char last_error[512]; + char sqlstate[5 +1]; + my_bool send_types_to_server; + my_bool bind_param_done; + unsigned char bind_result_done; + my_bool unbuffered_fetch_cancelled; + my_bool update_max_length; + void *extension; +} MYSQL_STMT; +enum enum_stmt_attr_type +{ + STMT_ATTR_UPDATE_MAX_LENGTH, + STMT_ATTR_CURSOR_TYPE, + STMT_ATTR_PREFETCH_ROWS +}; +typedef struct st_mysql_methods +{ + my_bool (*read_query_result)(MYSQL *mysql); + my_bool (*advanced_command)(MYSQL *mysql, + enum enum_server_command command, + const unsigned char *header, + unsigned long header_length, + const unsigned char *arg, + unsigned long arg_length, + my_bool skip_check, + MYSQL_STMT *stmt); + MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, + unsigned int fields); + MYSQL_RES * (*use_result)(MYSQL *mysql); + void (*fetch_lengths)(unsigned long *to, + MYSQL_ROW column, unsigned int field_count); + void (*flush_use_result)(MYSQL *mysql); + MYSQL_FIELD * (*list_fields)(MYSQL *mysql); + my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); + int (*stmt_execute)(MYSQL_STMT *stmt); + int (*read_binary_rows)(MYSQL_STMT *stmt); + int (*unbuffered_fetch)(MYSQL *mysql, char **row); + void (*free_embedded_thd)(MYSQL *mysql); + const char *(*read_statistics)(MYSQL *mysql); + my_bool (*next_result)(MYSQL *mysql); + int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd); + int (*read_rows_from_cursor)(MYSQL_STMT *stmt); +} MYSQL_METHODS; +MYSQL_STMT * mysql_stmt_init(MYSQL *mysql); +int mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, + unsigned long length); +int mysql_stmt_execute(MYSQL_STMT *stmt); +int mysql_stmt_fetch(MYSQL_STMT *stmt); +int mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, + unsigned int column, + unsigned long offset); +int mysql_stmt_store_result(MYSQL_STMT *stmt); +unsigned long mysql_stmt_param_count(MYSQL_STMT * stmt); +my_bool mysql_stmt_attr_set(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + const void *attr); +my_bool mysql_stmt_attr_get(MYSQL_STMT *stmt, + enum enum_stmt_attr_type attr_type, + void *attr); +my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); +my_bool mysql_stmt_close(MYSQL_STMT * stmt); +my_bool mysql_stmt_reset(MYSQL_STMT * stmt); +my_bool mysql_stmt_free_result(MYSQL_STMT *stmt); +my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, + unsigned int param_number, + const char *data, + unsigned long length); +MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT *stmt); +MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT *stmt); +unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); +const char * mysql_stmt_error(MYSQL_STMT * stmt); +const char * mysql_stmt_sqlstate(MYSQL_STMT * stmt); +MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT *stmt, + MYSQL_ROW_OFFSET offset); +MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT *stmt); +void mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); +my_ulonglong mysql_stmt_num_rows(MYSQL_STMT *stmt); +my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT *stmt); +my_ulonglong mysql_stmt_insert_id(MYSQL_STMT *stmt); +unsigned int mysql_stmt_field_count(MYSQL_STMT *stmt); +my_bool mysql_commit(MYSQL * mysql); +my_bool mysql_rollback(MYSQL * mysql); +my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode); +my_bool mysql_more_results(MYSQL *mysql); +int mysql_next_result(MYSQL *mysql); +void mysql_close(MYSQL *sock); +typedef struct st_table_rule_ent +{ + char* db; + char* tbl_name; + uint key_len; +} TABLE_RULE_ENT; +class Rpl_filter +{ +public: + Rpl_filter(); + ~Rpl_filter(); + Rpl_filter(Rpl_filter const&); + Rpl_filter& operator=(Rpl_filter const&); + In_C_you_should_use_my_bool_instead() tables_ok(const char* db, TABLE_LIST* tables); + In_C_you_should_use_my_bool_instead() db_ok(const char* db); + In_C_you_should_use_my_bool_instead() db_ok_with_wild_table(const char *db); + In_C_you_should_use_my_bool_instead() is_on(); + int add_do_table(const char* table_spec); + int add_ignore_table(const char* table_spec); + int add_wild_do_table(const char* table_spec); + int add_wild_ignore_table(const char* table_spec); + void add_do_db(const char* db_spec); + void add_ignore_db(const char* db_spec); + void add_db_rewrite(const char* from_db, const char* to_db); + void get_do_table(String* str); + void get_ignore_table(String* str); + void get_wild_do_table(String* str); + void get_wild_ignore_table(String* str); + const char* get_rewrite_db(const char* db, size_t *new_len); + I_List* get_do_db(); + I_List* get_ignore_db(); +private: + In_C_you_should_use_my_bool_instead() table_rules_on; + void init_table_rule_hash(HASH* h, In_C_you_should_use_my_bool_instead()* h_inited); + void init_table_rule_array(DYNAMIC_ARRAY* a, In_C_you_should_use_my_bool_instead()* a_inited); + int add_table_rule(HASH* h, const char* table_spec); + int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec); + void free_string_array(DYNAMIC_ARRAY *a); + void table_rule_ent_hash_to_str(String* s, HASH* h, In_C_you_should_use_my_bool_instead() inited); + void table_rule_ent_dynamic_array_to_str(String* s, DYNAMIC_ARRAY* a, + In_C_you_should_use_my_bool_instead() inited); + TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len); + HASH do_table; + HASH ignore_table; + DYNAMIC_ARRAY wild_do_table; + DYNAMIC_ARRAY wild_ignore_table; + In_C_you_should_use_my_bool_instead() do_table_inited; + In_C_you_should_use_my_bool_instead() ignore_table_inited; + In_C_you_should_use_my_bool_instead() wild_do_table_inited; + In_C_you_should_use_my_bool_instead() wild_ignore_table_inited; + I_List do_db; + I_List ignore_db; + I_List rewrite_db; +}; +extern Rpl_filter *rpl_filter; +extern Rpl_filter *binlog_filter; +#include "rpl_tblmap.h" +class Relay_log_info; +class Master_info; +extern ulong master_retry_count; +extern MY_BITMAP slave_error_mask; +extern In_C_you_should_use_my_bool_instead() use_slave_mask; +extern char *slave_load_tmpdir; +extern char *master_info_file, *relay_log_info_file; +extern char *opt_relay_logname, *opt_relaylog_index_name; +extern my_bool opt_skip_slave_start, opt_reckless_slave; +extern my_bool opt_log_slave_updates; +extern ulonglong relay_log_space_limit; +int init_slave(); +void init_slave_skip_errors(const char* arg); +In_C_you_should_use_my_bool_instead() flush_relay_log_info(Relay_log_info* rli); +int register_slave_on_master(MYSQL* mysql); +int terminate_slave_threads(Master_info* mi, int thread_mask, + In_C_you_should_use_my_bool_instead() skip_lock = 0); +int start_slave_threads(In_C_you_should_use_my_bool_instead() need_slave_mutex, In_C_you_should_use_my_bool_instead() wait_for_start, + Master_info* mi, const char* master_info_fname, + const char* slave_info_fname, int thread_mask); +int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock, + pthread_mutex_t *cond_lock, + pthread_cond_t* start_cond, + volatile uint *slave_running, + volatile ulong *slave_run_id, + Master_info* mi, + In_C_you_should_use_my_bool_instead() high_priority); +int mysql_table_dump(THD* thd, const char* db, + const char* tbl_name, int fd = -1); +int fetch_master_table(THD* thd, const char* db_name, const char* table_name, + Master_info* mi, MYSQL* mysql, In_C_you_should_use_my_bool_instead() overwrite); +In_C_you_should_use_my_bool_instead() show_master_info(THD* thd, Master_info* mi); +In_C_you_should_use_my_bool_instead() show_binlog_info(THD* thd); +In_C_you_should_use_my_bool_instead() rpl_master_has_bug(Relay_log_info *rli, uint bug_id, In_C_you_should_use_my_bool_instead() report=(1)); +In_C_you_should_use_my_bool_instead() rpl_master_erroneous_autoinc(THD* thd); +const char *print_slave_db_safe(const char *db); +int check_expected_error(THD* thd, Relay_log_info const *rli, int error_code); +void skip_load_data_infile(NET* net); +void end_slave(); +void clear_until_condition(Relay_log_info* rli); +void clear_slave_error(Relay_log_info* rli); +void end_relay_log_info(Relay_log_info* rli); +void lock_slave_threads(Master_info* mi); +void unlock_slave_threads(Master_info* mi); +void init_thread_mask(int* mask,Master_info* mi,In_C_you_should_use_my_bool_instead() inverse); +int init_relay_log_pos(Relay_log_info* rli,const char* log,ulonglong pos, + In_C_you_should_use_my_bool_instead() need_data_lock, const char** errmsg, + In_C_you_should_use_my_bool_instead() look_for_description_event); +int purge_relay_logs(Relay_log_info* rli, THD *thd, In_C_you_should_use_my_bool_instead() just_reset, + const char** errmsg); +void set_slave_thread_options(THD* thd); +void set_slave_thread_default_charset(THD *thd, Relay_log_info const *rli); +void rotate_relay_log(Master_info* mi); +int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli, + In_C_you_should_use_my_bool_instead() skip); + void * handle_slave_io(void *arg); + void * handle_slave_sql(void *arg); +extern In_C_you_should_use_my_bool_instead() volatile abort_loop; +extern Master_info main_mi, *active_mi; +extern LIST master_list; +extern my_bool replicate_same_server_id; +extern int disconnect_slave_event_count, abort_slave_event_count ; +extern uint master_port, master_connect_retry, report_port; +extern char * master_user, *master_password, *master_host; +extern char *master_info_file, *relay_log_info_file, *report_user; +extern char *report_host, *report_password; +extern my_bool master_ssl; +extern char *master_ssl_ca, *master_ssl_capath, *master_ssl_cert; +extern char *master_ssl_cipher, *master_ssl_key; +extern I_List threads; +enum mysql_db_table_field +{ + MYSQL_DB_FIELD_HOST = 0, + MYSQL_DB_FIELD_DB, + MYSQL_DB_FIELD_USER, + MYSQL_DB_FIELD_SELECT_PRIV, + MYSQL_DB_FIELD_INSERT_PRIV, + MYSQL_DB_FIELD_UPDATE_PRIV, + MYSQL_DB_FIELD_DELETE_PRIV, + MYSQL_DB_FIELD_CREATE_PRIV, + MYSQL_DB_FIELD_DROP_PRIV, + MYSQL_DB_FIELD_GRANT_PRIV, + MYSQL_DB_FIELD_REFERENCES_PRIV, + MYSQL_DB_FIELD_INDEX_PRIV, + MYSQL_DB_FIELD_ALTER_PRIV, + MYSQL_DB_FIELD_CREATE_TMP_TABLE_PRIV, + MYSQL_DB_FIELD_LOCK_TABLES_PRIV, + MYSQL_DB_FIELD_CREATE_VIEW_PRIV, + MYSQL_DB_FIELD_SHOW_VIEW_PRIV, + MYSQL_DB_FIELD_CREATE_ROUTINE_PRIV, + MYSQL_DB_FIELD_ALTER_ROUTINE_PRIV, + MYSQL_DB_FIELD_EXECUTE_PRIV, + MYSQL_DB_FIELD_EVENT_PRIV, + MYSQL_DB_FIELD_TRIGGER_PRIV, + MYSQL_DB_FIELD_COUNT +}; +extern TABLE_FIELD_W_TYPE mysql_db_table_fields[]; +extern time_t mysql_db_table_last_check; +struct acl_host_and_ip +{ + char *hostname; + long ip,ip_mask; +}; +class ACL_ACCESS { +public: + ulong sort; + ulong access; +}; +class ACL_HOST :public ACL_ACCESS +{ +public: + acl_host_and_ip host; + char *db; +}; +class ACL_USER :public ACL_ACCESS +{ +public: + acl_host_and_ip host; + uint hostname_length; + USER_RESOURCES user_resource; + char *user; + uint8 salt[20 +1]; + uint8 salt_len; + enum SSL_type ssl_type; + const char *ssl_cipher, *x509_issuer, *x509_subject; +}; +class ACL_DB :public ACL_ACCESS +{ +public: + acl_host_and_ip host; + char *user,*db; +}; +In_C_you_should_use_my_bool_instead() hostname_requires_resolving(const char *hostname); +my_bool acl_init(In_C_you_should_use_my_bool_instead() dont_read_acl_tables); +my_bool acl_reload(THD *thd); +void acl_free(In_C_you_should_use_my_bool_instead() end=0); +ulong acl_get(const char *host, const char *ip, + const char *user, const char *db, my_bool db_is_pattern); +int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd, + uint passwd_len); +In_C_you_should_use_my_bool_instead() acl_getroot_no_password(Security_context *sctx, char *user, char *host, + char *ip, char *db); +In_C_you_should_use_my_bool_instead() acl_check_host(const char *host, const char *ip); +int check_change_password(THD *thd, const char *host, const char *user, + char *password, uint password_len); +In_C_you_should_use_my_bool_instead() change_password(THD *thd, const char *host, const char *user, + char *password); +In_C_you_should_use_my_bool_instead() mysql_grant(THD *thd, const char *db, List &user_list, + ulong rights, In_C_you_should_use_my_bool_instead() revoke); +int mysql_table_grant(THD *thd, TABLE_LIST *table, List &user_list, + List &column_list, ulong rights, + In_C_you_should_use_my_bool_instead() revoke); +In_C_you_should_use_my_bool_instead() mysql_routine_grant(THD *thd, TABLE_LIST *table, In_C_you_should_use_my_bool_instead() is_proc, + List &user_list, ulong rights, + In_C_you_should_use_my_bool_instead() revoke, In_C_you_should_use_my_bool_instead() no_error); +my_bool grant_init(); +void grant_free(void); +my_bool grant_reload(THD *thd); +In_C_you_should_use_my_bool_instead() check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, + uint show_command, uint number, In_C_you_should_use_my_bool_instead() dont_print_error); +In_C_you_should_use_my_bool_instead() check_grant_column (THD *thd, GRANT_INFO *grant, + const char *db_name, const char *table_name, + const char *name, uint length, Security_context *sctx); +In_C_you_should_use_my_bool_instead() check_column_grant_in_table_ref(THD *thd, TABLE_LIST * table_ref, + const char *name, uint length); +In_C_you_should_use_my_bool_instead() check_grant_all_columns(THD *thd, ulong want_access, + Field_iterator_table_ref *fields); +In_C_you_should_use_my_bool_instead() check_grant_routine(THD *thd, ulong want_access, + TABLE_LIST *procs, In_C_you_should_use_my_bool_instead() is_proc, In_C_you_should_use_my_bool_instead() no_error); +In_C_you_should_use_my_bool_instead() check_grant_db(THD *thd,const char *db); +ulong get_table_grant(THD *thd, TABLE_LIST *table); +ulong get_column_grant(THD *thd, GRANT_INFO *grant, + const char *db_name, const char *table_name, + const char *field_name); +In_C_you_should_use_my_bool_instead() mysql_show_grants(THD *thd, LEX_USER *user); +void get_privilege_desc(char *to, uint max_length, ulong access); +void get_mqh(const char *user, const char *host, USER_CONN *uc); +In_C_you_should_use_my_bool_instead() mysql_create_user(THD *thd, List &list); +In_C_you_should_use_my_bool_instead() mysql_drop_user(THD *thd, List &list); +In_C_you_should_use_my_bool_instead() mysql_rename_user(THD *thd, List &list); +In_C_you_should_use_my_bool_instead() mysql_revoke_all(THD *thd, List &list); +void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, + const char *db, const char *table); +In_C_you_should_use_my_bool_instead() sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, + In_C_you_should_use_my_bool_instead() is_proc); +int sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, + In_C_you_should_use_my_bool_instead() is_proc); +In_C_you_should_use_my_bool_instead() check_routine_level_acl(THD *thd, const char *db, const char *name, + In_C_you_should_use_my_bool_instead() is_proc); +In_C_you_should_use_my_bool_instead() is_acl_user(const char *host, const char *user); +#include "tztime.h" +class Time_zone: public Sql_alloc +{ +public: + Time_zone() {} + virtual my_time_t TIME_to_gmt_sec(const MYSQL_TIME *t, + my_bool *in_dst_time_gap) const = 0; + virtual void gmt_sec_to_TIME(MYSQL_TIME *tmp, my_time_t t) const = 0; + virtual const String * get_name() const = 0; + virtual ~Time_zone() {}; +}; +extern Time_zone * my_tz_UTC; +extern Time_zone * my_tz_SYSTEM; +extern Time_zone * my_tz_OFFSET0; +extern Time_zone * my_tz_find(THD *thd, const String *name); +extern my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap); +extern void my_tz_free(); +extern my_time_t sec_since_epoch_TIME(MYSQL_TIME *t); +static const int MY_TZ_TABLES_COUNT= 4; +In_C_you_should_use_my_bool_instead() check_global_access(THD *thd, ulong want_access); +int get_quote_char_for_identifier(THD *thd, const char *name, uint length); +void sql_perror(const char *message); +In_C_you_should_use_my_bool_instead() fn_format_relative_to_data_home(char * to, const char *name, + const char *dir, const char *extension); +extern uint mysql_data_home_len; +extern char *mysql_data_home,server_version[60], + mysql_real_data_home[], mysql_unpacked_real_data_home[]; +extern CHARSET_INFO *character_set_filesystem; +extern char reg_ext[20]; +extern uint reg_ext_length; +extern ulong specialflag; +extern uint lower_case_table_names; +extern In_C_you_should_use_my_bool_instead() mysqld_embedded; +extern my_bool opt_large_pages; +extern uint opt_large_page_size; +extern struct system_variables global_system_variables; +uint strconvert(CHARSET_INFO *from_cs, const char *from, + CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors); +uint filename_to_tablename(const char *from, char *to, uint to_length); +uint tablename_to_filename(const char *from, char *to, uint to_length); From c20188e011915e1532dd8bf19b1509618e6fb3b8 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 17 Jun 2008 11:12:21 -0300 Subject: [PATCH 019/352] Bug#33873: Fast ALTER TABLE doesn't work with multibyte character sets The problem was that when comparing tables for a possible fast alter table, the comparison was being performed using the parsed information and not the final definition. The solution is to use the possible final table layout to compare if a fast alter is possible or not. --- mysql-test/include/mix1.inc | 50 +++++++++-------- mysql-test/r/alter_table.result | 39 +++++++++++++ mysql-test/r/innodb_mysql.result | 13 ----- mysql-test/t/alter_table.test | 34 +++++++++++ sql/sql_table.cc | 96 ++++++++++++++++++-------------- 5 files changed, 152 insertions(+), 80 deletions(-) diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index fdac8deb87e..c33cc5be588 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -1428,29 +1428,31 @@ DROP TABLE t1; # Bug#21704: Renaming column does not update FK definition. # ---disable_warnings -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; ---enable_warnings - -CREATE TABLE t1(id INT PRIMARY KEY) - ENGINE=innodb; - -CREATE TABLE t2( - t1_id INT PRIMARY KEY, - CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id)) - ENGINE=innodb; - ---echo - ---disable_result_log ---error ER_ERROR_ON_RENAME -ALTER TABLE t1 CHANGE id id2 INT; ---enable_result_log - ---echo - -DROP TABLE t2; -DROP TABLE t1; +# +# --disable_warnings +# DROP TABLE IF EXISTS t1; +# DROP TABLE IF EXISTS t2; +# --enable_warnings +# +# CREATE TABLE t1(id INT PRIMARY KEY) +# ENGINE=innodb; +# +# CREATE TABLE t2( +# t1_id INT PRIMARY KEY, +# CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id)) +# ENGINE=innodb; +# +# --echo +# +# --disable_result_log +# --error ER_ERROR_ON_RENAME +# ALTER TABLE t1 CHANGE id id2 INT; +# --enable_result_log +# +# --echo +# +# DROP TABLE t2; +# DROP TABLE t1; +# --echo End of 5.1 tests diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 3cec1f546d2..d6986f4a956 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1184,3 +1184,42 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (id int, c int) character set latin1; +INSERT INTO t1 VALUES (1,1); +ALTER TABLE t1 CHANGE c d int; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE d c int; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 MODIFY c VARCHAR(10); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE c d varchar(10); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE d c varchar(10); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (id int, c int) character set utf8; +INSERT INTO t1 VALUES (1,1); +ALTER TABLE t1 CHANGE c d int; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE d c int; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 MODIFY c VARCHAR(10); +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE c d varchar(10); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 CHANGE d c varchar(10); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index ab279933853..b6bcd7b0ada 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1640,19 +1640,6 @@ vid tid idx name type 3 1 2 c1 NULL 3 1 1 pk NULL DROP TABLE t1; -DROP TABLE IF EXISTS t1; -DROP TABLE IF EXISTS t2; -CREATE TABLE t1(id INT PRIMARY KEY) -ENGINE=innodb; -CREATE TABLE t2( -t1_id INT PRIMARY KEY, -CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id)) -ENGINE=innodb; - -ALTER TABLE t1 CHANGE id id2 INT; - -DROP TABLE t2; -DROP TABLE t1; End of 5.1 tests drop table if exists t1, t2, t3; create table t1(a int); diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 99c9ae23801..662f9095810 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -914,3 +914,37 @@ unlock tables; select * from t1; check table t1; drop table t1; + +# +# Bug#33873: Fast ALTER TABLE doesn't work with multibyte character sets +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +CREATE TABLE t1 (id int, c int) character set latin1; +INSERT INTO t1 VALUES (1,1); +--enable_info +ALTER TABLE t1 CHANGE c d int; +ALTER TABLE t1 CHANGE d c int; +ALTER TABLE t1 MODIFY c VARCHAR(10); +ALTER TABLE t1 CHANGE c d varchar(10); +ALTER TABLE t1 CHANGE d c varchar(10); +--disable_info +DROP TABLE t1; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +CREATE TABLE t1 (id int, c int) character set utf8; +INSERT INTO t1 VALUES (1,1); +--enable_info +ALTER TABLE t1 CHANGE c d int; +ALTER TABLE t1 CHANGE d c int; +ALTER TABLE t1 MODIFY c VARCHAR(10); +ALTER TABLE t1 CHANGE c d varchar(10); +ALTER TABLE t1 CHANGE d c varchar(10); +--disable_info +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7c847e0817c..77344aca987 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5145,51 +5145,51 @@ compare_tables(TABLE *table, Field **f_ptr, *field; uint changes= 0, tmp; uint key_count; - List_iterator_fast new_field_it(alter_info->create_list); - Create_field *new_field; + List_iterator_fast new_field_it, tmp_new_field_it; + Create_field *new_field, *tmp_new_field; KEY_PART_INFO *key_part; KEY_PART_INFO *end; + THD *thd= table->in_use; /* Remember if the new definition has new VARCHAR column; create_info->varchar will be reset in mysql_prepare_create_table. */ bool varchar= create_info->varchar; + /* + Create a copy of alter_info. + To compare the new and old table definitions, we need to "prepare" + the new definition - transform it from parser output to a format + that describes the final table layout (all column defaults are + initialized, duplicate columns are removed). This is done by + mysql_prepare_create_table. Unfortunately, + mysql_prepare_create_table performs its transformations + "in-place", that is, modifies the argument. Since we would + like to keep compare_tables() idempotent (not altering any + of the arguments) we create a copy of alter_info here and + pass it to mysql_prepare_create_table, then use the result + to evaluate possibility of fast ALTER TABLE, and then + destroy the copy. + */ + Alter_info tmp_alter_info(*alter_info, thd->mem_root); + uint db_options= 0; /* not used */ + DBUG_ENTER("compare_tables"); - { - THD *thd= table->in_use; - /* - Create a copy of alter_info. - To compare the new and old table definitions, we need to "prepare" - the new definition - transform it from parser output to a format - that describes the final table layout (all column defaults are - initialized, duplicate columns are removed). This is done by - mysql_prepare_create_table. Unfortunately, - mysql_prepare_create_table performs its transformations - "in-place", that is, modifies the argument. Since we would - like to keep compare_tables() idempotent (not altering any - of the arguments) we create a copy of alter_info here and - pass it to mysql_prepare_create_table, then use the result - to evaluate possibility of fast ALTER TABLE, and then - destroy the copy. - */ - Alter_info tmp_alter_info(*alter_info, thd->mem_root); - uint db_options= 0; /* not used */ - /* Create the prepared information. */ - if (mysql_prepare_create_table(thd, create_info, - &tmp_alter_info, - (table->s->tmp_table != NO_TMP_TABLE), - &db_options, - table->file, key_info_buffer, - &key_count, 0)) - DBUG_RETURN(1); - /* Allocate result buffers. */ - if (! (*index_drop_buffer= - (uint*) thd->alloc(sizeof(uint) * table->s->keys)) || - ! (*index_add_buffer= - (uint*) thd->alloc(sizeof(uint) * tmp_alter_info.key_list.elements))) - DBUG_RETURN(1); - } + /* Create the prepared information. */ + if (mysql_prepare_create_table(thd, create_info, + &tmp_alter_info, + (table->s->tmp_table != NO_TMP_TABLE), + &db_options, + table->file, key_info_buffer, + &key_count, 0)) + DBUG_RETURN(1); + /* Allocate result buffers. */ + if (! (*index_drop_buffer= + (uint*) thd->alloc(sizeof(uint) * table->s->keys)) || + ! (*index_add_buffer= + (uint*) thd->alloc(sizeof(uint) * tmp_alter_info.key_list.elements))) + DBUG_RETURN(1); + /* Some very basic checks. If number of fields changes, or the handler, we need to run full ALTER TABLE. In the future @@ -5232,19 +5232,29 @@ compare_tables(TABLE *table, DBUG_RETURN(0); } + /* + Use transformed info to evaluate possibility of fast ALTER TABLE + but use the preserved field to persist modifications. + */ + new_field_it.init(alter_info->create_list); + tmp_new_field_it.init(tmp_alter_info.create_list); + /* Go through fields and check if the original ones are compatible with new table. */ - for (f_ptr= table->field, new_field= new_field_it++; - (field= *f_ptr); f_ptr++, new_field= new_field_it++) + for (f_ptr= table->field, new_field= new_field_it++, + tmp_new_field= tmp_new_field_it++; + (field= *f_ptr); + f_ptr++, new_field= new_field_it++, + tmp_new_field= tmp_new_field_it++) { /* Make sure we have at least the default charset in use. */ if (!new_field->charset) new_field->charset= create_info->default_table_charset; /* Check that NULL behavior is same for old and new fields */ - if ((new_field->flags & NOT_NULL_FLAG) != + if ((tmp_new_field->flags & NOT_NULL_FLAG) != (uint) (field->flags & NOT_NULL_FLAG)) { *need_copy_table= ALTER_TABLE_DATA_CHANGED; @@ -5253,8 +5263,8 @@ compare_tables(TABLE *table, /* Don't pack rows in old tables if the user has requested this. */ if (create_info->row_type == ROW_TYPE_DYNAMIC || - (new_field->flags & BLOB_FLAG) || - new_field->sql_type == MYSQL_TYPE_VARCHAR && + (tmp_new_field->flags & BLOB_FLAG) || + tmp_new_field->sql_type == MYSQL_TYPE_VARCHAR && create_info->row_type != ROW_TYPE_FIXED) create_info->table_options|= HA_OPTION_PACK_RECORD; @@ -5262,11 +5272,11 @@ compare_tables(TABLE *table, field->flags&= ~FIELD_IS_RENAMED; if (my_strcasecmp(system_charset_info, field->field_name, - new_field->field_name)) + tmp_new_field->field_name)) field->flags|= FIELD_IS_RENAMED; /* Evaluate changes bitmap and send to check_if_incompatible_data() */ - if (!(tmp= field->is_equal(new_field))) + if (!(tmp= field->is_equal(tmp_new_field))) { *need_copy_table= ALTER_TABLE_DATA_CHANGED; DBUG_RETURN(0); From aa45d0c01fc8d9230dcc1defe35048045928cf4b Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 17 Jun 2008 19:04:10 -0600 Subject: [PATCH 020/352] Bug #37024: Wrong location of messagefiles make_binary_distribution.sh got clobbered by the 5.0 version during a merge. This caused a few packaging problems, including message files put in the wrong place and some missing files. Fix is just to revert back to the 5.1 version from before the merge. Problem introduced in ChangeSet 1.2606.2.1 2008/05/13 15:56:07 kent@kent-amd64.(none) This change was made in the 5.1.25 release clone in BK, but never made it to the main mysql-5.1 BK tree. I am adding it to mysql-5.1 bzr. --- scripts/make_binary_distribution.sh | 449 +++++++++++++++------------- 1 file changed, 237 insertions(+), 212 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 50cff8578c9..0a58f8b8ef1 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -14,36 +14,61 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# This is a script to create a TAR or ZIP binary distribution out of a -# built source tree. The output file will be put at the top level of -# the source tree, as "mysql-....{tar.gz,zip}" +############################################################################## # -# The temporary directory path given to "--tmp=" has to be -# absolute and with no spaces. +# This is a script to create a TAR or ZIP binary distribution out of a +# built source tree. The output file will be put at the top level of +# the source tree, as "mysql-....{tar.gz,zip}" +# +# Note that the structure created by this script is slightly different from +# what a normal "make install" would produce. No extra "mysql" sub directory +# will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or +# "$prefix/share/mysql". This is because the build system explicitly calls +# make with pkgdatadir=, etc. +# +# In GNU make/automake terms +# +# "pkglibdir" is set to the same as "libdir" +# "pkgincludedir" is set to the same as "includedir" +# "pkgdatadir" is set to the same as "datadir" +# "pkgplugindir" is set to "$pkglibdir/plugin" +# "pkgsuppdir" is set to "@prefix@/support-files", +# normally the same as "datadir" +# +# The temporary directory path given to "--tmp=" has to be +# absolute and with no spaces. +# +# Note that for best result, the original "make" should be done with +# the same arguments as used for "make install" below, especially the +# 'pkglibdir', as the RPATH should to be set correctly. +# +############################################################################## + +############################################################################## +# +# Read the command line arguments that control this script +# +############################################################################## machine=@MACHINE_TYPE@ system=@SYSTEM_TYPE@ -version=@VERSION@ SOURCE=`pwd` CP="cp -p" MV="mv" -STRIP=1 -DEBUG=0 +STRIP=1 # Option ignored SILENT=0 -MACHINE="" PLATFORM="" TMP=/tmp SUFFIX="" -NDBCLUSTER="" +NDBCLUSTER="" # Option ignored for arg do case "$arg" in - --debug) DEBUG=1;; --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; - --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; + --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;; --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; --silent) SILENT=1 ;; --with-ndbcluster) NDBCLUSTER=1 ;; @@ -54,53 +79,52 @@ for arg do esac done -# Remove vendor from $system -system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` +# ---------------------------------------------------------------------- +# Adjust "system" output from "uname" to be more human readable +# ---------------------------------------------------------------------- -# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) -system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` -system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` -system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` -system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` -system=`echo $system | sed -e 's/osf5.1b/tru64/g'` -system=`echo $system | sed -e 's/linux-gnu/linux/g'` -system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` -system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` +if [ x"$PLATFORM" = x"" ] ; then + # FIXME move this to the build tools + # Remove vendor from $system + system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` -if [ x"$MACHINE" != x"" ] ; then - machine=$MACHINE + # Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) + system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` + system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` + system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` + system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` + system=`echo $system | sed -e 's/osf5.1b/tru64/g'` + system=`echo $system | sed -e 's/linux-gnu/linux/g'` + system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` + system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` + + PLATFORM="$system-$machine" fi -if [ x"$PLATFORM" != x"" ] ; then - platform="$PLATFORM" -else - platform="$system-$machine" -fi +# Print the platform name for build logs +echo "PLATFORM NAME: $PLATFORM" -# FIXME This should really be integrated with automake and not duplicate the -# installation list. +case $PLATFORM in + *netware*) BASE_SYSTEM="netware" ;; +esac +# Change the distribution to a long descriptive name +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX + +# ---------------------------------------------------------------------- +# Define BASE, and remove the old BASE directory if any +# ---------------------------------------------------------------------- BASE=$TMP/my_dist$SUFFIX - if [ -d $BASE ] ; then rm -rf $BASE fi -BS="" -BIN_FILES="" -BASE_SYSTEM="any" -MYSQL_SHARE=$BASE/share/mysql - -case $system in - *netware*) - BASE_SYSTEM="netware" - BS=".nlm" - MYSQL_SHARE=$BASE/share - ;; -esac +# ---------------------------------------------------------------------- +# Find the TAR to use +# ---------------------------------------------------------------------- # This is needed to prefer GNU tar over platform tar because that can't # always handle long filenames @@ -127,24 +151,149 @@ which_1 () } tar=`which_1 gnutar gtar` -if [ "$?" = "1" -o x"$tar" = x"" ] ; then +if [ $? -ne 0 -o x"$tar" = x"" ] ; then tar=tar fi +############################################################################## +# +# Handle the Unix/Linux packaging using "make install" +# +############################################################################## + +if [ x"$BASE_SYSTEM" != x"netware" ] ; then + + # ---------------------------------------------------------------------- + # Terminate on any base level error + # ---------------------------------------------------------------------- + set -e + + # ---------------------------------------------------------------------- + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", + # i.e. makes access relative the current directory. This matches + # the documentation, so better not change this. And for another script, + # "mysql.server", we make some relative, others not. + # ---------------------------------------------------------------------- + + cd scripts + rm -f mysql_install_db + @MAKE@ mysql_install_db \ + prefix=. \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=./share \ + localstatedir=./data + cd .. + + cd support-files + rm -f mysql.server + @MAKE@ mysql.server \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=@pkgdatadir@ + cd .. + + # ---------------------------------------------------------------------- + # Do a install that we later are to pack. Use the same paths as in + # the build for the relevant directories. + # ---------------------------------------------------------------------- + @MAKE@ DESTDIR=$BASE install \ + pkglibdir=@pkglibdir@ \ + pkgincludedir=@pkgincludedir@ \ + pkgdatadir=@pkgdatadir@ \ + pkgplugindir=@pkgplugindir@ \ + pkgsuppdir=@pkgsuppdir@ \ + mandir=@mandir@ \ + infodir=@infodir@ + + # ---------------------------------------------------------------------- + # Rename top directory, and set DEST to the new directory + # ---------------------------------------------------------------------- + mv $BASE@prefix@ $BASE/$NEW_NAME + DEST=$BASE/$NEW_NAME + + # ---------------------------------------------------------------------- + # If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a + # ---------------------------------------------------------------------- + if [ x"@GXX@" = x"yes" ] ; then + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true + if [ -z "$gcclib" ] ; then + echo "Warning: Compiler doesn't tell libgcc.a!" + elif [ -f "$gcclib" ] ; then + $CP $gcclib $DEST/lib/libmygcc.a + else + echo "Warning: Compiler result '$gcclib' not found / no file!" + fi + fi + + # FIXME let this script be in "bin/", where it is in the RPMs? + # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html + mkdir $DEST/scripts + mv $DEST/bin/mysql_install_db $DEST/scripts/ + + # Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 + + # Copy readme and license files + cp README Docs/INSTALL-BINARY $DEST/ + if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then + cp COPYING EXCEPTIONS-CLIENT $DEST/ + elif [ -f LICENSE.mysql ] ; then + cp LICENSE.mysql $DEST/ + else + echo "ERROR: no license files found" + exit 1 + fi + + # FIXME should be handled by make file, and to other dir + mkdir -p $DEST/bin $DEST/support-files + cp scripts/mysqlaccess.conf $DEST/bin/ + cp support-files/magic $DEST/support-files/ + + # Create empty data directories, set permission (FIXME why?) + mkdir $DEST/data $DEST/data/mysql $DEST/data/test + chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test + + # ---------------------------------------------------------------------- + # Create the result tar file + # ---------------------------------------------------------------------- + + echo "Using $tar to create archive" + OPT=cvf + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + + echo "Creating and compressing archive" + rm -f $NEW_NAME.tar.gz + (cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz + echo "$NEW_NAME.tar.gz created" + + echo "Removing temporary directory" + rm -rf $BASE + exit 0 +fi + + +############################################################################## +# +# Handle the Netware case, until integrated above +# +############################################################################## + +BS=".nlm" +MYSQL_SHARE=$BASE/share + mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ $BASE/mysql-test/suite -if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ - $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test - - chmod o-rwx $BASE/data $BASE/data/* -fi - # Copy files if they exists, warn for those that don't. # Note that when listing files to copy, we might list the file name # twice, once in the directory location where it is built, and a @@ -176,12 +325,13 @@ copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - myisam/myisam_ftdump$BS \ + storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ + storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysqld-debug$BS \ sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ + client/mysqlslap$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ client/mysqlbinlog$BS client/mysql_upgrade$BS \ @@ -191,42 +341,16 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ "; # Platform-specific bin dir files: -if [ $BASE_SYSTEM = "netware" ] ; then - BIN_FILES="$BIN_FILES \ +BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ + netware/init_db.sql netware/test_db.sql \ netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; -# For all other platforms: -else - BIN_FILES="$BIN_FILES \ - server-tools/instance-manager/.libs/mysqlmanager \ - client/mysqltestmanagerc \ - client/mysqltestmanager-pwgen tools/mysqltestmanager \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqldump client/.libs/mysqlimport \ - client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog client/.libs/mysqltestmanagerc \ - client/.libs/mysqltestmanager-pwgen tools/.libs/mysqltestmanager \ - tests/.libs/mysql_client_test \ - libmysqld/examples/.libs/mysql_client_test_embedded \ - libmysqld/examples/.libs/mysqltest_embedded \ - "; -fi copyfileto $BASE/bin $BIN_FILES -if [ x$STRIP = x1 ] ; then - strip $BASE/bin/* -fi - -# Copy not binary files -copyfileto $BASE/bin sql/mysqld.sym.gz - -if [ $BASE_SYSTEM = "netware" ] ; then - $CP netware/*.pl $BASE/scripts - $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl -fi +$CP netware/*.pl $BASE/scripts +$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl copyfileto $BASE/lib \ libmysql/.libs/libmysqlclient.a \ @@ -248,31 +372,17 @@ copyfileto $BASE/lib \ zlib/.libs/libz.a # convert the .a to .lib for NetWare -if [ $BASE_SYSTEM = "netware" ] ; then - for i in $BASE/lib/*.a - do - libname=`basename $i .a` - $MV $i $BASE/lib/$libname.lib - done - rm -f $BASE/lib/*.la -fi +for i in $BASE/lib/*.a +do + libname=`basename $i .a` + $MV $i $BASE/lib/$libname.lib +done +rm -f $BASE/lib/*.la -copyfileto $BASE/include include/* + +copyfileto $BASE/include config.h include/* rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h -if [ $BASE_SYSTEM != "netware" ] ; then - rm -f $BASE/include/config-netware.h -fi - -if [ $BASE_SYSTEM != "netware" ] ; then - if [ -d tests ] ; then - $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests - fi - if [ -d man ] ; then - $CP man/*.1 $BASE/man/man1 - $CP man/*.8 $BASE/man/man8 - fi -fi copyfileto $BASE/support-files support-files/* @@ -291,43 +401,29 @@ copyfileto $BASE/mysql-test \ $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/include/*.sql $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/t/*.def $BASE/mysql-test/t +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ + mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ + mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ + mysql-test/std_data/Index.xml \ + mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ + mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ + $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.imtest \ mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r -# Copy the additional suites and data "as is", they are in flux -$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) -$tar cf - mysql-test/std_data | ( cd $BASE ; $tar xf - ) +# Copy the additional suites "as is", they are in flux +$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) # Clean up if we did this from a bk tree if [ -d mysql-test/SCCS ] ; then find $BASE/mysql-test -name SCCS -print | xargs rm -rf fi -if [ $BASE_SYSTEM != "netware" ] ; then - chmod a+x $BASE/bin/* - copyfileto $BASE/bin scripts/* - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ - ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ - @HOSTNAME@ \@pkgdatadir\@ ./share \ - < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ - \@sbindir\@ ./bin \@libexecdir\@ ./bin \ - \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \ - \@HOSTNAME\@ @HOSTNAME@ \ - < support-files/mysql.server.sh > $BASE/support-files/mysql.server - $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe - mv $BASE/support-files/binary-configure $BASE/configure - chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-log-rotate \ - $BASE/support-files/*.server $BASE/configure - $CP -r sql-bench/* $BASE/sql-bench - rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la - rm -f $BASE/bin/*.sql -fi - rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ $BASE/bin/setsomevars $BASE/support-files/Makefile* \ @@ -336,29 +432,19 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # # Copy system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql -fi +./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql # # Remove system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - rm -f $BASE/support-files/magic \ +rm -f $BASE/support-files/magic \ $BASE/support-files/mysql.server \ $BASE/support-files/mysql*.spec \ $BASE/support-files/mysql-log-rotate \ $BASE/support-files/binary-configure \ $BASE/support-files/build-tags \ $BASE/support-files/MySQL-shared-compat.spec \ - $BASE/support-files/ndb-config-2-node.ini \ $BASE/INSTALL-BINARY -fi - -# Make safe_mysqld a symlink to mysqld_safe for backwards portability -if [ $BASE_SYSTEM != "netware" ] ; then - (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -fi # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then @@ -366,78 +452,17 @@ if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi -# NDB Cluster -if [ x$NDBCLUSTER = x1 ]; then - ( cd ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. - $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. - $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP $BASE/ndb-stage@pkgdatadir@/* $BASE/share/mysql/. - $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include - $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 - rm -rf $BASE/ndb-stage -fi - -# Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX - -# Print the platform name for build logs -echo "PLATFORM NAME: $platform" - BASE2=$TMP/$NEW_NAME rm -rf $BASE2 mv $BASE $BASE2 BASE=$BASE2 + # -# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a +# Create a zip file for NetWare users # - -if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true - if [ -z "$gcclib" ] ; then - echo "Warning: Compiler doesn't tell libgcc.a!" - elif [ -f "$gcclib" ] ; then - $CP $gcclib $BASE/lib/libmygcc.a - else - echo "Warning: Compiler result '$gcclib' not found / no file!" - fi -fi - -#if we are debugging, do not do tar/gz -if [ x$DEBUG = x1 ] ; then - exit -fi - -if [ $BASE_SYSTEM != "netware" ] ; then - - # - # Create the result tar file - # - - echo "Using $tar to create archive" - - OPT=cvf - if [ x$SILENT = x1 ] ; then - OPT=cf - fi - - echo "Creating and compressing archive" - rm -f $NEW_NAME.tar.gz - (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz - echo "$NEW_NAME.tar.gz created" - -else - - # - # Create a zip file for NetWare users - # - - rm -f $NEW_NAME.zip - (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) - echo "$NEW_NAME.zip created" - -fi +rm -f $NEW_NAME.zip +(cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) +echo "$NEW_NAME.zip created" echo "Removing temporary directory" rm -rf $BASE From 3847e5c820f68a64a7f8d8acbbcb1ba6bd1a6992 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 17 Jun 2008 19:05:56 -0600 Subject: [PATCH 021/352] fix typo This change was committed to the 5.1.25 release clone, but never made it to the mysql-5.1 BK tree. I'm committing it to mysql-5.1 bzr now. --- mysql-test/r/repair.result | 2 +- sql/sql_table.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index dce37230d42..609733b2b02 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -130,7 +130,7 @@ test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" to fix # REPAIR old table USE_FRM should fail REPAIR TABLE t1 USE_FRM; Table Op Msg_type Msg_text -t1 repair error Failed reparing incompatible .FRM file +t1 repair error Failed repairing incompatible .frm file # Run REPAIR TABLE to upgrade .frm file REPAIR TABLE t1; Table Op Msg_type Msg_text diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7c847e0817c..9993ef0d854 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4024,7 +4024,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, if (table->s->frm_version != FRM_VER_TRUE_VARCHAR) { error= send_check_errmsg(thd, table_list, "repair", - "Failed reparing incompatible .FRM file"); + "Failed repairing incompatible .frm file"); goto end; } From 203dd193c406a1f3a744315042eb772035b6ca66 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Wed, 18 Jun 2008 15:43:03 +0530 Subject: [PATCH 022/352] Removed the references to mysql_h.ic in include/Makefile.am --- include/Makefile.am | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index 6f3e559cb23..bf89659c391 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -41,7 +41,6 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \ # Remove built files and the symlinked directories CLEANFILES = $(BUILT_SOURCES) readline openssl -EXTRA_DIST = mysql_h.ic # Some include files that may be moved and patched by configure DISTCLEANFILES = sched.h $(CLEANFILES) @@ -63,18 +62,5 @@ my_config.h: config.h dist-hook: $(RM) -f $(distdir)/mysql_version.h $(distdir)/my_config.h -# -# Rules for checking that ABI has not changed -# - -# Create a icheck file and compare it to the reference -abi_check: $(HEADERS_ABI) mysql_version.h mysql_h.ic - @set -ex; \ - if [ @ICHECK@ != no ] ; then \ - @ICHECK@ --canonify --skip-from-re /usr/ -o $@ $(HEADERS_ABI); \ - @ICHECK@ --compare mysql_h.ic $@; \ - fi; \ - touch abi_check; - # Don't update the files from bitkeeper %::SCCS/s.% From 30bd1d7cb37926b99c0d5683a5c1912a4b853762 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 18 Jun 2008 13:17:15 -0300 Subject: [PATCH 023/352] Bug#37003 Tests sporadically crashes with embedded server The problem was that when a embedded linked version of mysqltest crashed there was no way to obtain a stack trace if no core file is available. Another problem is that the embedded version of libmysql was not behaving (crash) the same as the non-embedded with respect to sending commands to a explicitly closed connection. The solution is to generate a mysqltest's stack trace on crash and to enable "reconnect" if the connection handle was explicitly closed so the behavior matches the non-embedded one. --- client/CMakeLists.txt | 8 +- client/Makefile.am | 12 ++- client/mysqltest.c | 92 +++++++++++++++++++ configure.in | 12 ++- include/Makefile.am | 2 +- include/my_stacktrace.h | 61 ++++++++++++ libmysqld/CMakeLists.txt | 3 +- libmysqld/Makefile.am | 2 +- libmysqld/lib_sql.cc | 9 ++ .../t/sql_low_priority_updates_func.test | 1 + mysys/CMakeLists.txt | 2 +- mysys/Makefile.am | 2 +- {sql => mysys}/stacktrace.c | 47 ++++++---- sql/CMakeLists.txt | 2 +- sql/Makefile.am | 4 +- sql/mysqld.cc | 14 +-- sql/stacktrace.h | 69 -------------- 17 files changed, 227 insertions(+), 115 deletions(-) create mode 100644 include/my_stacktrace.h rename {sql => mysys}/stacktrace.c (95%) delete mode 100644 sql/stacktrace.h diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index a20db4134c2..cbd4a1f306b 100755 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -15,7 +15,7 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") # We use the "mysqlclient_notls" library here just as safety, in case -# any of the clients here would go beond the client API and access the +# any of the clients here would go beyond the client API and access the # Thread Local Storage directly. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") @@ -32,9 +32,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c) TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32) -ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c - ../mysys/my_copy.c ../mysys/my_mkdir.c) -TARGET_LINK_LIBRARIES(mysqltest mysqlclient_notls regex wsock32) +ADD_EXECUTABLE(mysqltest mysqltest.c) +SET_SOURCE_FILES_PROPERTIES(mysqltest.c PROPERTIES COMPILE_FLAGS "-DTHREADS") +TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex wsock32 dbug) ADD_EXECUTABLE(mysqlcheck mysqlcheck.c) TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient_notls wsock32) diff --git a/client/Makefile.am b/client/Makefile.am index c57a5673367..940766ac66c 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -86,11 +86,13 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ $(LIBMYSQLCLIENT_LA) \ $(top_builddir)/mysys/libmysys.a -mysqltest_SOURCES= mysqltest.c \ - $(top_srcdir)/mysys/my_getsystime.c \ - $(top_srcdir)/mysys/my_copy.c \ - $(top_srcdir)/mysys/my_mkdir.c -mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) +mysqltest_SOURCES= mysqltest.c +mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK +mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ + @CLIENT_EXTRA_LDFLAGS@ \ + $(LIBMYSQLCLIENT_LA) \ + $(top_builddir)/mysys/libmysys.a \ + $(top_builddir)/regex/libregex.a mysql_upgrade_SOURCES= mysql_upgrade.c \ $(top_srcdir)/mysys/my_getpagesize.c diff --git a/client/mysqltest.c b/client/mysqltest.c index bd7a84e2d6a..5cc0951cdf5 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -48,7 +48,14 @@ #ifdef __WIN__ #include #endif +#include +#ifdef __WIN__ +#include +#define SIGNAL_FMT "exception 0x%x" +#else +#define SIGNAL_FMT "signal %d" +#endif /* Use cygwin for --exec and --system before 5.0 */ #if MYSQL_VERSION_ID < 50000 @@ -214,6 +221,7 @@ struct st_connection /* Used when creating views and sp, to avoid implicit commit */ MYSQL* util_mysql; char *name; + size_t name_len; MYSQL_STMT* stmt; #ifdef EMBEDDED_LIBRARY @@ -4436,6 +4444,7 @@ void do_connect(struct st_command *command) ds_connection_name.str)); if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME)))) die("Out of memory"); + con_slot->name_len= strlen(con_slot->name); cur_con= con_slot; if (con_slot == next_con) @@ -6839,6 +6848,87 @@ void mark_progress(struct st_command* command __attribute__((unused)), } +static sig_handler dump_backtrace(int sig) +{ + struct st_connection *conn= cur_con; + + fprintf(stderr, "mysqltest got " SIGNAL_FMT "\n", sig); + my_safe_print_str("read_command_buf", read_command_buf, + sizeof(read_command_buf)); + if (conn) + { + my_safe_print_str("conn->name", conn->name, conn->name_len); +#ifdef EMBEDDED_LIBRARY + my_safe_print_str("conn->cur_query", conn->cur_query, conn->cur_query_len); +#endif + } + fputs("Attempting backtrace...\n", stderr); + my_print_stacktrace(NULL, my_thread_stack_size); +} + +#ifdef __WIN__ + +LONG WINAPI exception_filter(EXCEPTION_POINTERS *exp) +{ + __try + { + my_set_exception_pointers(exp); + dump_backtrace(exp->ExceptionRecord->ExceptionCode); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + fputs("Got exception in exception handler!\n", stderr); + } + + return EXCEPTION_CONTINUE_SEARCH; +} + + +static void init_signal_handling(void) +{ + UINT mode; + + /* Set output destination of messages to the standard error stream. */ + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); + + /* Do not not display the a error message box. */ + mode= SetErrorMode(0) | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX; + SetErrorMode(mode); + + SetUnhandledExceptionFilter(exception_filter); +} + +#else /* __WIN__ */ + +static void init_signal_handling(void) +{ + struct sigaction sa; + DBUG_ENTER("init_signal_handling"); + + my_init_stacktrace(); + + sa.sa_flags = SA_RESETHAND | SA_NODEFER; + sigemptyset(&sa.sa_mask); + sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL); + + sa.sa_handler= dump_backtrace; + + sigaction(SIGSEGV, &sa, NULL); + sigaction(SIGABRT, &sa, NULL); +#ifdef SIGBUS + sigaction(SIGBUS, &sa, NULL); +#endif + sigaction(SIGILL, &sa, NULL); + sigaction(SIGFPE, &sa, NULL); +} + +#endif /* !__WIN__ */ + int main(int argc, char **argv) { struct st_command *command; @@ -6851,6 +6941,8 @@ int main(int argc, char **argv) save_file[0]= 0; TMPDIR[0]= 0; + init_signal_handling(); + /* Init expected errors */ memset(&saved_expected_errors, 0, sizeof(saved_expected_errors)); diff --git a/configure.in b/configure.in index af23b6035eb..033cabf1875 100644 --- a/configure.in +++ b/configure.in @@ -2341,10 +2341,20 @@ then fi AC_MSG_RESULT("$netinet_inc") +AC_CACHE_CHECK([support for weak symbols], mysql_cv_weak_symbol, +[AC_TRY_LINK([],[ + extern void __attribute__((weak)) foo(void); +], [mysql_cv_weak_symbol=yes], [mysql_cv_weak_symbol=no])]) + +if test "x$mysql_cv_weak_symbol" = xyes; then + AC_DEFINE(HAVE_WEAK_SYMBOL, 1, + [Define to 1 if compiler supports weak symbol attribute.]) +fi + AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(cxxabi.h) -AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle, +AC_CACHE_CHECK([for abi::__cxa_demangle], mysql_cv_cxa_demangle, [AC_TRY_LINK([#include ], [ char *foo= 0; int bar= 0; foo= abi::__cxa_demangle(foo, foo, 0, &bar); diff --git a/include/Makefile.am b/include/Makefile.am index 6f3e559cb23..f04afa06cb1 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -36,7 +36,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \ mysql_version.h.in my_handler.h my_time.h \ my_vle.h my_user.h my_atomic.h atomic/nolock.h \ atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \ - atomic/gcc_builtins.h my_libwrap.h + atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h # Remove built files and the symlinked directories CLEANFILES = $(BUILT_SOURCES) readline openssl diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h new file mode 100644 index 00000000000..3d51ba92ee1 --- /dev/null +++ b/include/my_stacktrace.h @@ -0,0 +1,61 @@ +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _my_stacktrace_h_ +#define _my_stacktrace_h_ + +#include + +#ifdef TARGET_OS_LINUX +#if defined (__x86_64__) || defined (__i386__) || \ + (defined(__alpha__) && defined(__GNUC__)) +#define HAVE_STACKTRACE 1 +#endif +#elif defined(__WIN__) +#define HAVE_STACKTRACE 1 +#endif + +#if !defined(__NETWARE__) +#define HAVE_WRITE_CORE +#endif + +#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \ + HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \ + HAVE_WEAK_SYMBOL +#define BACKTRACE_DEMANGLE 1 +#endif + +C_MODE_START + +#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE) +void my_init_stacktrace(); +void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack); +void my_safe_print_str(const char* name, const char* val, int max_len); +void my_write_core(int sig); +#if BACKTRACE_DEMANGLE +char *my_demangle(const char *mangled_name, int *status); +#endif +#ifdef __WIN__ +void my_set_exception_pointers(EXCEPTION_POINTERS *ep); +#endif +#endif + +#ifdef HAVE_WRITE_CORE +void my_write_core(int sig); +#endif + +C_MODE_END + +#endif /* _my_stacktrace_h_ */ diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 97c718627d1..1582f0898d8 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -185,8 +185,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/partition_info.cc ../sql/sql_connect.cc - ../sql/scheduler.cc ../sql/stacktrace.c - ../sql/event_parse_data.cc + ../sql/scheduler.cc ../sql/event_parse_data.cc ${GEN_SOURCES} ${LIB_SOURCES}) diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 504980cbd07..ef2fab2da6d 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -69,7 +69,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ sql_select.cc sql_do.cc sql_show.cc set_var.cc \ sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \ sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \ - unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ + unireg.cc uniques.cc sql_union.cc hash_filo.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \ sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 591b76f61ad..e1c8ab5abb4 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -79,6 +79,15 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, my_bool result= 1; THD *thd=(THD *) mysql->thd; NET *net= &mysql->net; + my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE; + + if (!thd) + { + /* Do "reconnect" if possible */ + if (mysql_reconnect(mysql) || stmt_skip) + return 1; + thd= (THD *) mysql->thd; + } #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) thd->profiling.start_new_query(); diff --git a/mysql-test/t/sql_low_priority_updates_func.test b/mysql-test/t/sql_low_priority_updates_func.test index a427adf3ad3..6ff684af6cd 100644 --- a/mysql-test/t/sql_low_priority_updates_func.test +++ b/mysql-test/t/sql_low_priority_updates_func.test @@ -19,6 +19,7 @@ # # ############################################################################### +--source include/not_embedded.inc ################################################################ # sql_low_priority_updates was renamed to low_priority_updates # diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 60e75c96b75..545278485d1 100755 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -39,7 +39,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_ my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c - my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c + my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c stacktrace.c rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c) diff --git a/mysys/Makefile.am b/mysys/Makefile.am index 1c50160c3f4..3312c692c09 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -51,7 +51,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ my_gethostbyname.c rijndael.c my_aes.c sha1.c \ my_handler.c my_netware.c my_largepage.c \ - my_memmem.c \ + my_memmem.c stacktrace.c \ my_windac.c my_access.c base64.c my_libwrap.c EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \ thr_mutex.c thr_rwlock.c \ diff --git a/sql/stacktrace.c b/mysys/stacktrace.c similarity index 95% rename from sql/stacktrace.c rename to mysys/stacktrace.c index 5c3411aa8b1..7466dcb416e 100644 --- a/sql/stacktrace.c +++ b/mysys/stacktrace.c @@ -17,7 +17,7 @@ #define DONT_DEFINE_VOID 1 #include -#include "stacktrace.h" +#include #ifndef __WIN__ #include @@ -33,16 +33,22 @@ #define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end) -char *heap_start; +static char *heap_start; +extern char *__bss_start; -void safe_print_str(const char* name, const char* val, int max_len) +void my_init_stacktrace() +{ + heap_start = (char*) &__bss_start; +} + +void my_safe_print_str(const char* name, const char* val, int max_len) { char *heap_end= (char*) sbrk(0); fprintf(stderr, "%s at %p ", name, val); if (!PTR_SANE(val)) { - fprintf(stderr, " is invalid pointer\n"); + fprintf(stderr, "is an invalid pointer\n"); return; } @@ -103,6 +109,12 @@ inline uint32* find_prev_pc(uint32* pc, uchar** fp) #endif /* defined(__alpha__) && defined(__GNUC__) */ #if BACKTRACE_DEMANGLE + +char __attribute__ ((weak)) *my_demangle(const char *mangled_name, int *status) +{ + return NULL; +} + static void my_demangle_symbols(char **addrs, int n) { int status, i; @@ -158,7 +170,7 @@ static void backtrace_current_thread(void) #endif -void print_stacktrace(uchar* stack_bottom, ulong thread_stack) +void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack) { #if HAVE_BACKTRACE backtrace_current_thread(); @@ -281,16 +293,7 @@ end: #endif /* HAVE_STACKTRACE */ /* Produce a core for the thread */ - -#ifdef NOT_USED /* HAVE_LINUXTHREADS */ -void write_core(int sig) -{ - signal(sig, SIG_DFL); - if (fork() != 0) exit(1); /* Abort main program */ - /* Core will be written at exit */ -} -#else -void write_core(int sig) +void my_write_core(int sig) { signal(sig, SIG_DFL); #ifdef HAVE_gcov @@ -308,7 +311,7 @@ void write_core(int sig) sigsend(P_PID,P_MYID,sig); #endif } -#endif + #else /* __WIN__*/ #include @@ -356,6 +359,10 @@ static EXCEPTION_POINTERS *exception_ptrs; #define MODULE64_SIZE_WINXP 576 #define STACKWALK_MAX_FRAMES 64 +void my_init_stacktrace() +{ +} + /* Dynamically load dbghelp functions */ @@ -395,7 +402,7 @@ BOOL init_dbghelp_functions() return rc; } -void set_exception_pointers(EXCEPTION_POINTERS *ep) +void my_set_exception_pointers(EXCEPTION_POINTERS *ep) { exception_ptrs = ep; } @@ -405,7 +412,7 @@ void set_exception_pointers(EXCEPTION_POINTERS *ep) #define SYMOPT_NO_PROMPTS 0 #endif -void print_stacktrace(uchar* unused1, ulong unused2) +void my_print_stacktrace(uchar* unused1, ulong unused2) { HANDLE hProcess= GetCurrentProcess(); HANDLE hThread= GetCurrentThread(); @@ -513,7 +520,7 @@ void print_stacktrace(uchar* unused1, ulong unused2) file name is constructed from executable name plus ".dmp" extension */ -void write_core(int unused) +void my_write_core(int unused) { char path[MAX_PATH]; char dump_fname[MAX_PATH]= "core.dmp"; @@ -560,7 +567,7 @@ void write_core(int unused) } -void safe_print_str(const char *name, const char *val, int len) +void my_safe_print_str(const char *name, const char *val, int len) { fprintf(stderr,"%s at %p", name, val); __try diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 128fcbeddf0..5ab29aff69c 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -43,7 +43,7 @@ ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN -DHAVE_EVENT_SCHEDULER) ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc - discover.cc ../libmysql/errmsg.c field.cc stacktrace.c stacktrace.h field_conv.cc + discover.cc ../libmysql/errmsg.c field.cc field_conv.cc filesort.cc gstream.cc ha_partition.cc handler.cc hash_filo.cc hash_filo.h diff --git a/sql/Makefile.am b/sql/Makefile.am index 5b5f7aa1c5d..b9de9b279a3 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -66,7 +66,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ sql_repl.h slave.h rpl_filter.h rpl_injector.h \ log_event.h rpl_record.h \ log_event_old.h rpl_record_old.h \ - stacktrace.h sql_sort.h sql_cache.h set_var.h \ + sql_sort.h sql_cache.h set_var.h \ spatial.h gstream.h client_settings.h tzfile.h \ tztime.h my_decimal.h\ sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \ @@ -110,7 +110,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ rpl_reporting.cc \ sql_union.cc sql_derived.cc \ sql_client.cc \ - stacktrace.c repl_failsafe.h repl_failsafe.cc \ + repl_failsafe.h repl_failsafe.cc \ sql_olap.cc sql_view.cc \ gstream.cc spatial.cc sql_help.cc sql_cursor.cc \ tztime.cc my_decimal.cc\ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e34356215e2..0bbd0abe9b9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -22,7 +22,7 @@ #include "sql_repl.h" #include "rpl_filter.h" #include "repl_failsafe.h" -#include "stacktrace.h" +#include #include "mysqld_suffix.h" #include "mysys_err.h" #include "events.h" @@ -2049,7 +2049,7 @@ LONG WINAPI my_unhandler_exception_filter(EXCEPTION_POINTERS *ex_pointers) #endif /* DEBUG_UNHANDLED_EXCEPTION_FILTER */ __try { - set_exception_pointers(ex_pointers); + my_set_exception_pointers(ex_pointers); handle_segfault(ex_pointers->ExceptionRecord->ExceptionCode); } __except(EXCEPTION_EXECUTE_HANDLER) @@ -2432,8 +2432,8 @@ the thread stack. Please read http://dev.mysql.com/doc/mysql/en/linux.html\n\n", Attempting backtrace. You can use the following information to find out\n\ where mysqld died. If you see no messages after this, something went\n\ terribly wrong...\n"); - print_stacktrace(thd ? (uchar*) thd->thread_stack : (uchar*) 0, - my_thread_stack_size); + my_print_stacktrace(thd ? (uchar*) thd->thread_stack : NULL, + my_thread_stack_size); } if (thd) { @@ -2457,7 +2457,7 @@ terribly wrong...\n"); } fprintf(stderr, "Trying to get some variables.\n\ Some pointers may be invalid and cause the dump to abort...\n"); - safe_print_str("thd->query", thd->query, 1024); + my_safe_print_str("thd->query", thd->query, 1024); fprintf(stderr, "thd->thread_id=%lu\n", (ulong) thd->thread_id); fprintf(stderr, "thd->killed=%s\n", kreason); } @@ -2504,7 +2504,7 @@ bugs.\n"); { fprintf(stderr, "Writing a core file\n"); fflush(stderr); - write_core(sig); + my_write_core(sig); } #endif @@ -2538,7 +2538,7 @@ static void init_signals(void) sigemptyset(&sa.sa_mask); sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL); - init_stacktrace(); + my_init_stacktrace(); #if defined(__amiga__) sa.sa_handler=(void(*)())handle_segfault; #else diff --git a/sql/stacktrace.h b/sql/stacktrace.h deleted file mode 100644 index 498f4f197fc..00000000000 --- a/sql/stacktrace.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 2000 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE -#define BACKTRACE_DEMANGLE 1 -#endif - -#if BACKTRACE_DEMANGLE -char *my_demangle(const char *mangled_name, int *status); -#endif - -#ifdef TARGET_OS_LINUX -#if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) -#undef HAVE_STACKTRACE -#define HAVE_STACKTRACE - -extern char* __bss_start; -extern char* heap_start; - -#define init_stacktrace() do { \ - heap_start = (char*) &__bss_start; \ - } while(0); -void check_thread_lib(void); -#endif /* defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */ -#elif defined (__WIN__) -#define HAVE_STACKTRACE -extern void set_exception_pointers(EXCEPTION_POINTERS *ep); -#define init_stacktrace() {} -#endif - -#ifdef HAVE_STACKTRACE -void print_stacktrace(uchar* stack_bottom, ulong thread_stack); -void safe_print_str(const char* name, const char* val, int max_len); -#else -/* Define empty prototypes for functions that are not implemented */ -#define init_stacktrace() {} -#define print_stacktrace(A,B) {} -#define safe_print_str(A,B,C) {} -#endif /* HAVE_STACKTRACE */ - - -#if !defined(__NETWARE__) -#define HAVE_WRITE_CORE -#endif - -#ifdef HAVE_WRITE_CORE -void write_core(int sig); -#endif - - -#ifdef __cplusplus -} -#endif From ccd534c3ea41415af672a60033493a23ffc7501f Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Wed, 18 Jun 2008 21:09:30 +0200 Subject: [PATCH 024/352] Bug#21226 FLUSH PRIVILEGES does not provided feedback when it fails. If during a FLUSH PRIVILEGES the server fails to load the new privilege tables, the error message is lost. This patch is a back port from 5.1 which adresses this issue by setting the server in an error state if a failure occurrs. This patch also corrects an incorrect variable assignment which might cause an error state to be reverted by coincidence. --- sql/sql_parse.cc | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 98e04e45bdd..a192bcc38f2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7054,11 +7054,23 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, thd->thread_stack= (char*) &tmp_thd; thd->store_globals(); } + if (thd) { - (void)acl_reload(thd); - (void)grant_reload(thd); + bool reload_acl_failed= acl_reload(thd); + bool reload_grants_failed= grant_reload(thd); + + if (reload_acl_failed || reload_grants_failed) + { + result= 1; + /* + When an error is returned, my_message may have not been called and + the client will hang waiting for a response. + */ + my_error(ER_UNKNOWN_ERROR, MYF(0), "FLUSH PRIVILEGES failed"); + } } + if (tmp_thd) { delete tmp_thd; @@ -7144,8 +7156,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, tmp_write_to_binlog= 0; if (lock_global_read_lock(thd)) return 1; // Killed - result=close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, - tables); + if (close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, + tables)) + result= 1; + if (make_global_read_lock_block_commit(thd)) // Killed { /* Don't leave things in a half-locked state */ @@ -7154,7 +7168,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, } } else - result=close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, tables); + { + if (close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, tables)) + result= 1; + } my_dbopt_cleanup(); } if (options & REFRESH_HOSTS) @@ -7178,8 +7195,8 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, #ifdef OPENSSL if (options & REFRESH_DES_KEY_FILE) { - if (des_key_file) - result=load_des_key_file(des_key_file); + if (des_key_file && load_des_key_file(des_key_file)) + result= 1; } #endif #ifdef HAVE_REPLICATION From 71be65dd114d0a2bd914bcdb1879015fd76ba2b4 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Thu, 19 Jun 2008 02:40:35 +0200 Subject: [PATCH 025/352] Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning This bugs clarifies a warning message issued when the query cache data size becomes smaller than the minium allowed size. --- mysql-test/r/query_cache.result | 8 ++++---- sql/set_var.cc | 7 +------ sql/share/errmsg.txt | 14 +++++++------- sql/sql_cache.cc | 29 +++++++++++++++++++++++++++++ sql/sql_cache.h | 2 ++ 5 files changed, 43 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index fa80a44c177..c40e75fc29b 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -564,7 +564,7 @@ select * from t1; a set GLOBAL query_cache_size=1024; Warnings: -Warning 1282 Query cache failed to set size 1024; new query cache size is 0 +Warning 1282 Query cache failed to set size 1024 (minimal value: 41297); new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -572,7 +572,7 @@ select * from t1; a set GLOBAL query_cache_size=10240; Warnings: -Warning 1282 Query cache failed to set size 10240; new query cache size is 0 +Warning 1282 Query cache failed to set size 10240 (minimal value: 41297); new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -580,7 +580,7 @@ select * from t1; a set GLOBAL query_cache_size=20480; Warnings: -Warning 1282 Query cache failed to set size 20480; new query cache size is 0 +Warning 1282 Query cache failed to set size 20480 (minimal value: 41297); new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -588,7 +588,7 @@ select * from t1; a set GLOBAL query_cache_size=40960; Warnings: -Warning 1282 Query cache failed to set size 40960; new query cache size is 0 +Warning 1282 Query cache failed to set size 40960 (minimal value: 41297); new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 diff --git a/sql/set_var.cc b/sql/set_var.cc index 84766e511ca..fd9beff35b7 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1342,12 +1342,7 @@ static void fix_net_retry_count(THD *thd __attribute__((unused)), static void fix_query_cache_size(THD *thd, enum_var_type type) { #ifdef HAVE_QUERY_CACHE - ulong requested= query_cache_size; - query_cache.resize(query_cache_size); - if (requested != query_cache_size) - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), - requested, query_cache_size); + query_cache_size= query_cache.resize(query_cache_size); #endif } diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 7d345d633c6..0cb6672732c 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -4992,13 +4992,13 @@ ER_WRONG_NAME_FOR_CATALOG 42000 spa "Nombre de catalog incorrecto '%-.100s'" swe "Felaktigt katalog namn '%-.100s'" ER_WARN_QC_RESIZE - eng "Query cache failed to set size %lu; new query cache size is %lu" - ger "Änderung der Query-Cache-Größe auf %lu fehlgeschlagen; neue Query-Cache-Größe ist %lu" - por "Falha em Query cache para configurar tamanho %lu, novo tamanho de query cache é %lu" - rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu, ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" - spa "Query cache fallada para configurar tamaño %lu, nuevo tamaño de query cache es %lu" - swe "Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu" - ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu, ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" + eng "Query cache failed to set size %lu (minimal value: %lu); new query cache size is %lu" + ger "Änderung der Query-Cache-Größe auf %lu (Minimale Zahl: %lu) fehlgeschlagen; neue Query-Cache-Größe ist %lu" + por "Falha em Query cache para configurar tamanho %lu (Número mínimo: %lu), novo tamanho de query cache é %lu" + rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu (minimal value: %lu), ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" + spa "Query cache fallada para configurar tamaño %lu (Número mínimo: %lu), nuevo tamaño de query cache es %lu" + swe "Storleken av "Query cache" kunde inte sättas till %lu (minsta värde: %lu); ny storlek är %lu" + ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu (minimal value: %lu), ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" ER_BAD_FT_COLUMN eng "Column '%-.64s' cannot be part of FULLTEXT index" ger "Feld '%-.64s' kann nicht Teil eines FULLTEXT-Index sein" diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f8906a17c12..cce5123aef3 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -816,6 +816,16 @@ ulong Query_cache::resize(ulong query_cache_size_arg) free_cache(); query_cache_size= query_cache_size_arg; ::query_cache_size= init_cache(); + + if (::query_cache_size != query_cache_size_arg) + { + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), + query_cache_size_arg, + get_minimal_size_limit(), + ::query_cache_size); + } + STRUCT_UNLOCK(&structure_guard_mutex); DBUG_RETURN(::query_cache_size); } @@ -1614,6 +1624,25 @@ void Query_cache::init() } +/** + Return the lowest possible query cache size. +*/ + +ulong Query_cache::get_minimal_size_limit() +{ + ulong approx_additional_data_size= (sizeof(Query_cache) + + sizeof(gptr)*(def_query_hash_size+ + def_table_hash_size)); + + ulong data_size= (min_allocation_unit << QUERY_CACHE_MEM_BIN_STEP_PWR2 << + QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) + + ALIGN_SIZE(1) - 1 + + (1 << QUERY_CACHE_MEM_BIN_STEP_PWR2) - 1 + + (1 << QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) - 1; + + return(data_size + approx_additional_data_size); +} + ulong Query_cache::init_cache() { uint mem_bin_count, num, step; diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 34fc3a5c8d5..c5d89780af3 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -245,6 +245,8 @@ private: void free_query_internal(Query_cache_block *point); + ulong get_minimal_size_limit(); + protected: /* The following mutex is locked when searching or changing global From d6c476b8c865447e49ec8f447346a24b46bb732c Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 05:08:41 +0200 Subject: [PATCH 026/352] Fixed bug #37004. The value of JOIN::tables must be set to 0 when there is no matching min/max row. --- mysql-test/r/subselect.result | 7 +++++++ mysql-test/t/subselect.test | 12 ++++++++++++ sql/sql_select.cc | 2 ++ 3 files changed, 21 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index ce4ac00b791..923bc2254bd 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4391,3 +4391,10 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); s1 a DROP TABLE t1; +CREATE TABLE t1(c int, KEY(c)); +CREATE TABLE t2(a int, b int); +INSERT INTO t2 VALUES (1, 10), (2, NULL); +INSERT INTO t1 VALUES (1), (3); +SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); +a b +DROP TABLE t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index ee3a7428d4a..daaba671f34 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3273,3 +3273,15 @@ INSERT INTO t1 VALUES ('a'); SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); DROP TABLE t1; +# +# Bug #37004: NOT IN subquery with MAX over an empty set +# + +CREATE TABLE t1(c int, KEY(c)); +CREATE TABLE t2(a int, b int); +INSERT INTO t2 VALUES (1, 10), (2, NULL); +INSERT INTO t1 VALUES (1), (3); + +SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); + +DROP TABLE t1,t2; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2ef7aa13dd8..2ee92018410 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -888,6 +888,7 @@ JOIN::optimize() { DBUG_PRINT("info",("No matching min/max row")); zero_result_cause= "No matching min/max row"; + tables= 0; error=0; DBUG_RETURN(0); } @@ -901,6 +902,7 @@ JOIN::optimize() { DBUG_PRINT("info",("No matching min/max row")); zero_result_cause= "No matching min/max row"; + tables= 0; error=0; DBUG_RETURN(0); } From 40e413636e77b429d8bb94a7941bf4db2d432290 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 05:12:28 +0200 Subject: [PATCH 027/352] Bug#35480: BOM detection code crashes mysql CLI with zero-sized input MySQL client crashed if no input was passed to it. --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 234180c3c75..2ef987492b7 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1821,7 +1821,7 @@ static int read_and_execute(bool interactive) the very beginning of a text file when you save the file using "Unicode UTF-8" format. */ - if (!line_number && + if (line && !line_number && (uchar) line[0] == 0xEF && (uchar) line[1] == 0xBB && (uchar) line[2] == 0xBF) From 5d7c155c6e53b40db7fbe6c4ee5613ccf1700de3 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 06:44:22 +0200 Subject: [PATCH 028/352] Bug#36434: ha_innodb.so is installed in the wrong directory ha_innodb.so was incorrectly installed in the lib/mysql directory rather than in lib/mysql/plugin. Amending CS for 31736. --- storage/innobase/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am index 563522cd032..b5e5c5375dc 100644 --- a/storage/innobase/Makefile.am +++ b/storage/innobase/Makefile.am @@ -159,7 +159,7 @@ libinnobase_a_CXXFLAGS= $(AM_CFLAGS) libinnobase_a_CFLAGS = $(AM_CFLAGS) EXTRA_LTLIBRARIES = ha_innodb.la -pkglib_LTLIBRARIES = @plugin_innobase_shared_target@ +pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@ ha_innodb_la_LDFLAGS = -module -rpath $(pkgplugindir) ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN From 0905d04071ec525630b43d0c43bd71dce3846e47 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 12:39:48 +0200 Subject: [PATCH 029/352] re 36818: rpl_server_id1 fails expecting slave has stopped On a slow environment like valgrind the test is vulnerable because it does not check if slave has stopped at time of the new session is requested `start slave;' -- disabling test till it is fixed. --- mysql-test/suite/rpl/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index e107651c6d0..a356d45c2cc 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,3 +12,4 @@ rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_innodb_bug28430 : Failure on Solaris Bug #36793 +rpl_server_id1 : Bug #36818 rpl_server_id1 fails expecting slave has stopped (azundris) From 954fba4739630580daff90b566f1ee1612131b8d Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Thu, 19 Jun 2008 18:02:04 +0500 Subject: [PATCH 030/352] Fixed bug #37076: TIMESTAMP/DATETIME/DATE values are not replicated correctly between machines with mixed endiannes --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 16 ++ .../suite/rpl/r/rpl_row_basic_2myisam.result | 10 + .../suite/rpl/r/rpl_row_basic_3innodb.result | 10 + .../suite/rpl_ndb/r/rpl_row_basic_7ndb.result | 10 + sql/field.h | 182 +++++++++++------- 5 files changed, 162 insertions(+), 66 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 48ddbaf244a..f2142ccc4d4 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -265,6 +265,22 @@ eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; +# BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly +# between machines with mixed endiannes +# (regression test) + +--echo **** Test for BUG#37076 **** +--echo **** On Master **** +connection master; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); +INSERT INTO t1 VALUES( + '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); + +--echo **** On Slave **** +sync_slave_with_master slave; +SELECT * FROM t1; + # # cleanup # diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index 22284a26412..ecd59005b59 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -440,4 +440,14 @@ Last_SQL_Error 0 SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +**** Test for BUG#37076 **** +**** On Master **** +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); +INSERT INTO t1 VALUES( +'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); +**** On Slave **** +SELECT * FROM t1; +a b c +2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index f7b9e5d627a..4fc2bc6d714 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -440,4 +440,14 @@ Last_SQL_Error 0 SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +**** Test for BUG#37076 **** +**** On Master **** +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); +INSERT INTO t1 VALUES( +'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); +**** On Slave **** +SELECT * FROM t1; +a b c +2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result index 08232817e92..b1554bec156 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result @@ -440,4 +440,14 @@ Last_SQL_Error 0 SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 +**** Test for BUG#37076 **** +**** On Master **** +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE); +INSERT INTO t1 VALUES( +'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14'); +**** On Slave **** +SELECT * FROM t1; +a b c +2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; diff --git a/sql/field.h b/sql/field.h index 479a71dfee5..c71f54d8165 100644 --- a/sql/field.h +++ b/sql/field.h @@ -529,6 +529,77 @@ private: */ virtual int do_save_field_metadata(uchar *metadata_ptr) { return 0; } + +protected: + /* + Helper function to pack()/unpack() int32 values + */ + static void handle_int32(uchar *to, const uchar *from, + bool low_byte_first_from, bool low_byte_first_to) + { + int32 val; +#ifdef WORDS_BIGENDIAN + if (low_byte_first_from) + val = sint4korr(from); + else +#endif + longget(val, from); + +#ifdef WORDS_BIGENDIAN + if (low_byte_first_to) + int4store(to, val); + else +#endif + longstore(to, val); + } + + /* + Helper function to pack()/unpack() int64 values + */ + static void handle_int64(uchar* to, const uchar *from, + bool low_byte_first_from, bool low_byte_first_to) + { + int64 val; +#ifdef WORDS_BIGENDIAN + if (low_byte_first_from) + val = sint8korr(from); + else +#endif + longlongget(val, from); + +#ifdef WORDS_BIGENDIAN + if (low_byte_first_to) + int8store(to, val); + else +#endif + longlongstore(to, val); + } + + uchar *pack_int32(uchar *to, const uchar *from, bool low_byte_first_to) + { + handle_int32(to, from, table->s->db_low_byte_first, low_byte_first_to); + return to + sizeof(int32); + } + + const uchar *unpack_int32(uchar* to, const uchar *from, + bool low_byte_first_from) + { + handle_int32(to, from, low_byte_first_from, table->s->db_low_byte_first); + return from + sizeof(int32); + } + + uchar *pack_int64(uchar* to, const uchar *from, bool low_byte_first_to) + { + handle_int64(to, from, table->s->db_low_byte_first, low_byte_first_to); + return to + sizeof(int64); + } + + const uchar *unpack_int64(uchar* to, const uchar *from, + bool low_byte_first_from) + { + handle_int64(to, from, low_byte_first_from, table->s->db_low_byte_first); + return from + sizeof(int64); + } }; @@ -916,43 +987,16 @@ public: void sql_type(String &str) const; uint32 max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; } virtual uchar *pack(uchar* to, const uchar *from, - uint max_length, bool low_byte_first) + uint max_length __attribute__((unused)), + bool low_byte_first) { - int32 val; -#ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) - val = sint4korr(from); - else -#endif - longget(val, from); - -#ifdef WORDS_BIGENDIAN - if (low_byte_first) - int4store(to, val); - else -#endif - longstore(to, val); - return to + sizeof(val); + return pack_int32(to, from, low_byte_first); } - virtual const uchar *unpack(uchar* to, const uchar *from, - uint param_data, bool low_byte_first) + uint param_data __attribute__((unused)), + bool low_byte_first) { - int32 val; -#ifdef WORDS_BIGENDIAN - if (low_byte_first) - val = sint4korr(from); - else -#endif - longget(val, from); - -#ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) - int4store(to, val); - else -#endif - longstore(to, val); - return from + sizeof(val); + return unpack_int32(to, from, low_byte_first); } }; @@ -997,43 +1041,16 @@ public: bool can_be_compared_as_longlong() const { return TRUE; } uint32 max_display_length() { return 20; } virtual uchar *pack(uchar* to, const uchar *from, - uint max_length, bool low_byte_first) + uint max_length __attribute__((unused)), + bool low_byte_first) { - int64 val; -#ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) - val = sint8korr(from); - else -#endif - longlongget(val, from); - -#ifdef WORDS_BIGENDIAN - if (low_byte_first) - int8store(to, val); - else -#endif - longlongstore(to, val); - return to + sizeof(val); + return pack_int64(to, from, low_byte_first); } - virtual const uchar *unpack(uchar* to, const uchar *from, - uint param_data, bool low_byte_first) + uint param_data __attribute__((unused)), + bool low_byte_first) { - int64 val; -#ifdef WORDS_BIGENDIAN - if (low_byte_first) - val = sint8korr(from); - else -#endif - longlongget(val, from); - -#ifdef WORDS_BIGENDIAN - if (table->s->db_low_byte_first) - int8store(to, val); - else -#endif - longlongstore(to, val); - return from + sizeof(val); + return unpack_int64(to, from, low_byte_first); } }; #endif @@ -1207,6 +1224,17 @@ public: bool get_date(MYSQL_TIME *ltime,uint fuzzydate); bool get_time(MYSQL_TIME *ltime); timestamp_auto_set_type get_auto_set_type() const; + uchar *pack(uchar *to, const uchar *from, + uint max_length __attribute__((unused)), bool low_byte_first) + { + return pack_int32(to, from, low_byte_first); + } + const uchar *unpack(uchar* to, const uchar *from, + uint param_data __attribute__((unused)), + bool low_byte_first) + { + return unpack_int32(to, from, low_byte_first); + } }; @@ -1261,6 +1289,17 @@ public: void sql_type(String &str) const; bool can_be_compared_as_longlong() const { return TRUE; } bool zero_pack() const { return 1; } + uchar *pack(uchar* to, const uchar *from, + uint max_length __attribute__((unused)), bool low_byte_first) + { + return pack_int32(to, from, low_byte_first); + } + const uchar *unpack(uchar* to, const uchar *from, + uint param_data __attribute__((unused)), + bool low_byte_first) + { + return unpack_int32(to, from, low_byte_first); + } }; @@ -1374,6 +1413,17 @@ public: bool zero_pack() const { return 1; } bool get_date(MYSQL_TIME *ltime,uint fuzzydate); bool get_time(MYSQL_TIME *ltime); + uchar *pack(uchar* to, const uchar *from, + uint max_length __attribute__((unused)), bool low_byte_first) + { + return pack_int64(to, from, low_byte_first); + } + const uchar *unpack(uchar* to, const uchar *from, + uint param_data __attribute__((unused)), + bool low_byte_first) + { + return unpack_int64(to, from, low_byte_first); + } }; From e7f3c5fc44c168f0a574719722aa3763d22f7668 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 19 Jun 2008 11:02:32 -0300 Subject: [PATCH 031/352] Bug#37003 Tests sporadically crashes with embedded server Another problem is that the backtrace facility wasn't being enabled for non-Linux targets even if the target OS has the backtrace functions. Also, the stacktrace functions inside mysqltest were being used without proper checks for their presence in the build. --- client/mysqltest.c | 26 ++++++-- configure.in | 11 ++++ include/my_stacktrace.h | 5 ++ mysys/stacktrace.c | 134 ++++++++++++++++++++-------------------- sql/mysqld.cc | 2 + 5 files changed, 107 insertions(+), 71 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 5cc0951cdf5..f5a5c05b236 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -48,6 +48,7 @@ #ifdef __WIN__ #include #endif +#include #include #ifdef __WIN__ @@ -6847,12 +6848,12 @@ void mark_progress(struct st_command* command __attribute__((unused)), } +#ifdef HAVE_STACKTRACE -static sig_handler dump_backtrace(int sig) +static void dump_backtrace(void) { struct st_connection *conn= cur_con; - fprintf(stderr, "mysqltest got " SIGNAL_FMT "\n", sig); my_safe_print_str("read_command_buf", read_command_buf, sizeof(read_command_buf)); if (conn) @@ -6866,6 +6867,21 @@ static sig_handler dump_backtrace(int sig) my_print_stacktrace(NULL, my_thread_stack_size); } +#else + +static void dump_backtrace(void) +{ + fputs("Backtrace not available.\n", stderr); +} + +#endif + +static sig_handler signal_handler(int sig) +{ + fprintf(stderr, "mysqltest got " SIGNAL_FMT "\n", sig); + dump_backtrace(); +} + #ifdef __WIN__ LONG WINAPI exception_filter(EXCEPTION_POINTERS *exp) @@ -6873,7 +6889,7 @@ LONG WINAPI exception_filter(EXCEPTION_POINTERS *exp) __try { my_set_exception_pointers(exp); - dump_backtrace(exp->ExceptionRecord->ExceptionCode); + signal_handler(exp->ExceptionRecord->ExceptionCode); } __except(EXCEPTION_EXECUTE_HANDLER) { @@ -6910,13 +6926,15 @@ static void init_signal_handling(void) struct sigaction sa; DBUG_ENTER("init_signal_handling"); +#ifdef HAVE_STACKTRACE my_init_stacktrace(); +#endif sa.sa_flags = SA_RESETHAND | SA_NODEFER; sigemptyset(&sa.sa_mask); sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL); - sa.sa_handler= dump_backtrace; + sa.sa_handler= signal_handler; sigaction(SIGSEGV, &sa, NULL); sigaction(SIGABRT, &sa, NULL); diff --git a/configure.in b/configure.in index 033cabf1875..54817c3c253 100644 --- a/configure.in +++ b/configure.in @@ -2351,6 +2351,17 @@ if test "x$mysql_cv_weak_symbol" = xyes; then [Define to 1 if compiler supports weak symbol attribute.]) fi +AC_CACHE_CHECK([whether __bss_start is defined], mysql_cv_bss_start, +[AC_TRY_LINK([],[ + extern char *__bss_start; + return __bss_start ? 1 : 0; +], [mysql_cv_bss_start=yes], [mysql_cv_bss_start=no])]) + +if test "x$mysql_cv_bss_start" = xyes; then + AC_DEFINE(HAVE_BSS_START, 1, + [Define to 1 if compiler defines __bss_start.]) +fi + AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADERS(cxxabi.h) diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h index 3d51ba92ee1..e7ce42c1f4f 100644 --- a/include/my_stacktrace.h +++ b/include/my_stacktrace.h @@ -27,6 +27,11 @@ #define HAVE_STACKTRACE 1 #endif +#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD) +#undef HAVE_STACKTRACE +#define HAVE_STACKTRACE 1 +#endif + #if !defined(__NETWARE__) #define HAVE_WRITE_CORE #endif diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 7466dcb416e..9ae3d88ef50 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -34,11 +34,16 @@ #define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end) static char *heap_start; + +#ifdef HAVE_BSS_START extern char *__bss_start; +#endif void my_init_stacktrace() { +#ifdef HAVE_BSS_START heap_start = (char*) &__bss_start; +#endif } void my_safe_print_str(const char* name, const char* val, int max_len) @@ -58,7 +63,68 @@ void my_safe_print_str(const char* name, const char* val, int max_len) fputc('\n', stderr); } -#ifdef TARGET_OS_LINUX +#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD) + +#if BACKTRACE_DEMANGLE + +char __attribute__ ((weak)) *my_demangle(const char *mangled_name, int *status) +{ + return NULL; +} + +static void my_demangle_symbols(char **addrs, int n) +{ + int status, i; + char *begin, *end, *demangled; + + for (i= 0; i < n; i++) + { + demangled= NULL; + begin= strchr(addrs[i], '('); + end= begin ? strchr(begin, '+') : NULL; + + if (begin && end) + { + *begin++= *end++= '\0'; + demangled= my_demangle(begin, &status); + if (!demangled || status) + { + demangled= NULL; + begin[-1]= '('; + end[-1]= '+'; + } + } + + if (demangled) + fprintf(stderr, "%s(%s+%s\n", addrs[i], demangled, end); + else + fprintf(stderr, "%s\n", addrs[i]); + } +} + +#endif /* BACKTRACE_DEMANGLE */ + +void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack) +{ + void *addrs[128]; + char **strings= NULL; + int n = backtrace(addrs, array_elements(addrs)); +#if BACKTRACE_DEMANGLE + if ((strings= backtrace_symbols(addrs, n))) + { + my_demangle_symbols(strings, n); + free(strings); + } +#endif +#if HAVE_BACKTRACE_SYMBOLS_FD + if (!strings) + { + backtrace_symbols_fd(addrs, n, fileno(stderr)); + } +#endif +} + +#elif defined(TARGET_OS_LINUX) #ifdef __i386__ #define SIGRETURN_FRAME_OFFSET 17 @@ -108,74 +174,8 @@ inline uint32* find_prev_pc(uint32* pc, uchar** fp) } #endif /* defined(__alpha__) && defined(__GNUC__) */ -#if BACKTRACE_DEMANGLE - -char __attribute__ ((weak)) *my_demangle(const char *mangled_name, int *status) -{ - return NULL; -} - -static void my_demangle_symbols(char **addrs, int n) -{ - int status, i; - char *begin, *end, *demangled; - - for (i= 0; i < n; i++) - { - demangled= NULL; - begin= strchr(addrs[i], '('); - end= begin ? strchr(begin, '+') : NULL; - - if (begin && end) - { - *begin++= *end++= '\0'; - demangled= my_demangle(begin, &status); - if (!demangled || status) - { - demangled= NULL; - begin[-1]= '('; - end[-1]= '+'; - } - } - - if (demangled) - fprintf(stderr, "%s(%s+%s\n", addrs[i], demangled, end); - else - fprintf(stderr, "%s\n", addrs[i]); - } -} -#endif - - -#if HAVE_BACKTRACE -static void backtrace_current_thread(void) -{ - void *addrs[128]; - char **strings= NULL; - int n = backtrace(addrs, array_elements(addrs)); -#if BACKTRACE_DEMANGLE - if ((strings= backtrace_symbols(addrs, n))) - { - my_demangle_symbols(strings, n); - free(strings); - } -#endif -#if HAVE_BACKTRACE_SYMBOLS_FD - if (!strings) - { - backtrace_symbols_fd(addrs, n, fileno(stderr)); - } -#endif -} -#endif - - void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack) { -#if HAVE_BACKTRACE - backtrace_current_thread(); - return; -#endif uchar** fp; uint frame_count = 0, sigreturn_frame_count; #if defined(__alpha__) && defined(__GNUC__) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0bbd0abe9b9..d223b50c99f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2538,7 +2538,9 @@ static void init_signals(void) sigemptyset(&sa.sa_mask); sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL); +#ifdef HAVE_STACKTRACE my_init_stacktrace(); +#endif #if defined(__amiga__) sa.sa_handler=(void(*)())handle_segfault; #else From 8254727b444a5165d0af236a153f779ab4f899a9 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 19 Jun 2008 13:00:53 -0300 Subject: [PATCH 032/352] Silence unused variable warning by printing the variables value. --- mysys/stacktrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 9ae3d88ef50..5b941bbd7d6 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -109,6 +109,8 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack) void *addrs[128]; char **strings= NULL; int n = backtrace(addrs, array_elements(addrs)); + fprintf(stderr, "stack_bottom = %p thread_stack 0x%lx\n", + stack_bottom, thread_stack); #if BACKTRACE_DEMANGLE if ((strings= backtrace_symbols(addrs, n))) { From b8d449505d4cb3cf8a380d3d78fdc465f36123c5 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Thu, 19 Jun 2008 21:47:59 +0300 Subject: [PATCH 033/352] Bug#36443 Server crashes when executing insert when insert trigger on table The crash appeared to be a result of allocating an instance of Discrete_interval automatically that that was referred in out-of-declaration scope. Fixed with correcting backing up and restoring scheme of auto_inc_intervals_forced, introduced by bug#33029, by means of shallow copying; added simulation code that forces executing those fixes of the former bug that targeted at master-and-slave having incompatible bug#33029-prone versions. --- mysql-test/suite/bugs/r/rpl_bug33029.result | 15 ++++++ mysql-test/suite/bugs/t/rpl_bug33029.test | 25 ++++++++++ sql/slave.cc | 1 + sql/sql_class.cc | 8 ++-- sql/structs.h | 53 +++++++++++++-------- 5 files changed, 77 insertions(+), 25 deletions(-) create mode 100644 mysql-test/suite/bugs/r/rpl_bug33029.result create mode 100644 mysql-test/suite/bugs/t/rpl_bug33029.test diff --git a/mysql-test/suite/bugs/r/rpl_bug33029.result b/mysql-test/suite/bugs/r/rpl_bug33029.result new file mode 100644 index 00000000000..d11ae1cc0be --- /dev/null +++ b/mysql-test/suite/bugs/r/rpl_bug33029.result @@ -0,0 +1,15 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table `t1` (`id` int not null auto_increment primary key); +create trigger `trg` before insert on `t1` for each row begin end; +set @@global.debug="+d,simulate_bug33029"; +stop slave; +start slave; +insert into `t1` values (); +select * from t1; +id +1 diff --git a/mysql-test/suite/bugs/t/rpl_bug33029.test b/mysql-test/suite/bugs/t/rpl_bug33029.test new file mode 100644 index 00000000000..494cef42ce0 --- /dev/null +++ b/mysql-test/suite/bugs/t/rpl_bug33029.test @@ -0,0 +1,25 @@ +# +# Bug #36443 Server crashes when executing insert when insert trigger on table +# +# Emulating the former bug#33029 situation to see that there is no crash anymore. +# + + +source include/master-slave.inc; + +create table `t1` (`id` int not null auto_increment primary key); +create trigger `trg` before insert on `t1` for each row begin end; + +sync_slave_with_master; +set @@global.debug="+d,simulate_bug33029"; + +stop slave; +start slave; + +connection master; + +insert into `t1` values (); + +sync_slave_with_master; +select * from t1; + diff --git a/sql/slave.cc b/sql/slave.cc index dcc808625c0..a6d7758c8de 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4136,6 +4136,7 @@ bool rpl_master_erroneous_autoinc(THD *thd) if (active_mi && active_mi->rli.sql_thd == thd) { Relay_log_info *rli= &active_mi->rli; + DBUG_EXECUTE_IF("simulate_bug33029", return TRUE;); return rpl_master_has_bug(rli, 33029, FALSE); } return FALSE; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index afa9777e00a..b54aea94424 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2882,8 +2882,8 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup, */ if (rpl_master_erroneous_autoinc(this)) { - backup->auto_inc_intervals_forced= auto_inc_intervals_forced; - auto_inc_intervals_forced.empty(); + DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0); + auto_inc_intervals_forced.swap(&backup->auto_inc_intervals_forced); } #endif @@ -2931,8 +2931,8 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) */ if (rpl_master_erroneous_autoinc(this)) { - auto_inc_intervals_forced= backup->auto_inc_intervals_forced; - backup->auto_inc_intervals_forced.empty(); + backup->auto_inc_intervals_forced.swap(&auto_inc_intervals_forced); + DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0); } #endif diff --git a/sql/structs.h b/sql/structs.h index 809175fdde4..0a20eee0e9a 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -314,31 +314,22 @@ private: */ Discrete_interval *current; uint elements; // number of elements - - /* helper function for copy construct and assignment operator */ - void copy_(const Discrete_intervals_list& from) - { - for (Discrete_interval *i= from.head; i; i= i->next) - { - Discrete_interval j= *i; - append(&j); - } + void set_members(Discrete_interval *h, Discrete_interval *t, + Discrete_interval *c, uint el) + { + head= h; + tail= t; + current= c; + elements= el; } + void operator=(Discrete_intervals_list &); /* prevent use of these */ + Discrete_intervals_list(const Discrete_intervals_list &); + public: Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {}; - Discrete_intervals_list(const Discrete_intervals_list& from) - { - copy_(from); - } - void operator=(const Discrete_intervals_list& from) - { - empty(); - copy_(from); - } void empty_no_free() { - head= current= NULL; - elements= 0; + set_members(NULL, NULL, NULL, 0); } void empty() { @@ -350,7 +341,24 @@ public: } empty_no_free(); } - + void copy_shallow(const Discrete_intervals_list * dli) + { + head= dli->get_head(); + tail= dli->get_tail(); + current= dli->get_current(); + elements= dli->nb_elements(); + } + void swap (Discrete_intervals_list * dli) + { + Discrete_interval *h, *t, *c; + uint el; + h= dli->get_head(); + t= dli->get_tail(); + c= dli->get_current(); + el= dli->nb_elements(); + dli->copy_shallow(this); + set_members(h, t, c, el); + } const Discrete_interval* get_next() { Discrete_interval *tmp= current; @@ -364,4 +372,7 @@ public: ulonglong minimum() const { return (head ? head->minimum() : 0); }; ulonglong maximum() const { return (head ? tail->maximum() : 0); }; uint nb_elements() const { return elements; } + Discrete_interval* get_head() const { return head; }; + Discrete_interval* get_tail() const { return tail; }; + Discrete_interval* get_current() const { return current; }; }; From a51718eeb67b0647b3cdaca76054527dfb4e644b Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 20 Jun 2008 14:54:48 +0200 Subject: [PATCH 034/352] Raise version number after cloning 5.1.26 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index af23b6035eb..e684fad4584 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.26-rc) +AM_INIT_AUTOMAKE(mysql, 5.1.28) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 6e179694e392798245d1fee1cc3c369da4289f66 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 20 Jun 2008 15:00:11 +0200 Subject: [PATCH 035/352] No 'rc' status any more --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index af23b6035eb..1ef636ffa3c 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.26-rc) +AM_INIT_AUTOMAKE(mysql, 5.1.26) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 44811bbaa053e3c5bbe76202f62af0aa818dc847 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 20 Jun 2008 18:08:24 +0300 Subject: [PATCH 036/352] Bug#33812: mysql client incorrectly parsing DELIMITER Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements --- client/mysql.cc | 31 ------------------------------- mysql-test/r/mysql.result | 2 ++ mysql-test/t/mysql_delimiter.sql | 6 ++++++ 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 2ef987492b7..20ad769e9b4 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2101,37 +2101,6 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } - else if (!*ml_comment && !*in_string && - (end_of_line - pos) >= 10 && - !my_strnncoll(charset_info, (uchar*) pos, 10, - (const uchar*) "delimiter ", 10)) - { - // Flush previously accepted characters - if (out != line) - { - buffer.append(line, (uint32) (out - line)); - out= line; - } - - // Flush possible comments in the buffer - if (!buffer.is_empty()) - { - if (com_go(&buffer, 0) > 0) // < 0 is not fatal - DBUG_RETURN(1); - buffer.length(0); - } - - /* - Delimiter wants the get rest of the given line as argument to - allow one to change ';' to ';;' and back - */ - buffer.append(pos); - if (com_delimiter(&buffer, pos) > 0) - DBUG_RETURN(1); - - buffer.length(0); - break; - } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index a4d96c1c243..6fe35d5c9f9 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,6 +38,8 @@ t2 t3 Tables_in_test t1 +delimiter +1 _ Test delimiter : from command line a diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index db679c3b06b..8caa7cebc2f 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -59,3 +59,9 @@ source t/mysql_delimiter_19799.sql use test// show tables// delimiter ; # Reset delimiter + +# +# Bug #33812: mysql client incorrectly parsing DELIMITER +# +select a as delimiter from t1 +delimiter ; # Reset delimiter From 5128b787c45d60c84ab14ea71ab2596022683e2f Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Fri, 20 Jun 2008 18:58:14 +0200 Subject: [PATCH 037/352] Bug#33812: mysql client incorrectly parsing DELIMITER Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements. --- client/mysql.cc | 31 ------------------------------- mysql-test/r/mysql.result | 2 ++ mysql-test/t/mysql_delimiter.sql | 6 ++++++ 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 2ef987492b7..20ad769e9b4 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2101,37 +2101,6 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } - else if (!*ml_comment && !*in_string && - (end_of_line - pos) >= 10 && - !my_strnncoll(charset_info, (uchar*) pos, 10, - (const uchar*) "delimiter ", 10)) - { - // Flush previously accepted characters - if (out != line) - { - buffer.append(line, (uint32) (out - line)); - out= line; - } - - // Flush possible comments in the buffer - if (!buffer.is_empty()) - { - if (com_go(&buffer, 0) > 0) // < 0 is not fatal - DBUG_RETURN(1); - buffer.length(0); - } - - /* - Delimiter wants the get rest of the given line as argument to - allow one to change ';' to ';;' and back - */ - buffer.append(pos); - if (com_delimiter(&buffer, pos) > 0) - DBUG_RETURN(1); - - buffer.length(0); - break; - } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index a4d96c1c243..6fe35d5c9f9 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,6 +38,8 @@ t2 t3 Tables_in_test t1 +delimiter +1 _ Test delimiter : from command line a diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index db679c3b06b..8caa7cebc2f 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -59,3 +59,9 @@ source t/mysql_delimiter_19799.sql use test// show tables// delimiter ; # Reset delimiter + +# +# Bug #33812: mysql client incorrectly parsing DELIMITER +# +select a as delimiter from t1 +delimiter ; # Reset delimiter From 3f33b44aaa4fd5b2b3c5c62ff057debe2d8d61ea Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 20 Jun 2008 19:06:03 +0200 Subject: [PATCH 038/352] Correct the version number, after cloning 5.1.26 the next one is 27 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e684fad4584..4441362020a 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.28) +AM_INIT_AUTOMAKE(mysql, 5.1.27) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 7ad63a7202dbeba44d7e646b94fc9d98a915e1e4 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Tue, 24 Jun 2008 19:32:06 +0500 Subject: [PATCH 039/352] Bug #36244: MySQL CLI doesn't recognize standalone -- as a commentary mysql client has been modified to interpret EOL after standalone -- commentary strings like whitespace character (according to http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html) --- client/mysql.cc | 9 ++++++++- mysql-test/t/mysql_delimiter.sql | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index a4706a1c580..5348941b92f 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2156,7 +2156,14 @@ static bool add_line(String &buffer,char *line,char *in_string, } else if (!*ml_comment && (!*in_string && (inchar == '#' || inchar == '-' && pos[1] == '-' && - my_isspace(charset_info,pos[2])))) + /* + The third byte is either whitespace or is the + end of the line -- which would occur only + because of the user sending newline -- which is + itself whitespace and should also match. + */ + (my_isspace(charset_info,pos[2]) || + !pos[2])))) { // Flush previously accepted characters if (out != line) diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index db679c3b06b..533ac2ce093 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -59,3 +59,10 @@ source t/mysql_delimiter_19799.sql use test// show tables// delimiter ; # Reset delimiter + +# +# Bug #36244: MySQL CLI doesn't recognize standalone -- as comment +# before DELIMITER statement +# +-- +DELIMITER ; From 9ffe2c02bff82837a6674fae277b2e218811cb74 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Tue, 24 Jun 2008 21:03:17 +0500 Subject: [PATCH 040/352] back-port from 5.1. Bug#33812: mysql client incorrectly parsing DELIMITER Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements. --- client/mysql.cc | 31 ------------------------------- mysql-test/r/mysql.result | 2 ++ mysql-test/t/mysql_delimiter.sql | 6 ++++++ 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 5348941b92f..b373b9125a0 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2081,37 +2081,6 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } - else if (!*ml_comment && !*in_string && - (end_of_line - pos) >= 10 && - !my_strnncoll(charset_info, (uchar*) pos, 10, - (const uchar*) "delimiter ", 10)) - { - // Flush previously accepted characters - if (out != line) - { - buffer.append(line, (uint32) (out - line)); - out= line; - } - - // Flush possible comments in the buffer - if (!buffer.is_empty()) - { - if (com_go(&buffer, 0) > 0) // < 0 is not fatal - DBUG_RETURN(1); - buffer.length(0); - } - - /* - Delimiter wants the get rest of the given line as argument to - allow one to change ';' to ';;' and back - */ - buffer.append(pos); - if (com_delimiter(&buffer, pos) > 0) - DBUG_RETURN(1); - - buffer.length(0); - break; - } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index eded1a3fc3b..bc50c686ac6 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,6 +38,8 @@ t2 t3 Tables_in_test t1 +delimiter +1 _ Test delimiter : from command line a diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index 533ac2ce093..917401275a2 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -60,6 +60,12 @@ use test// show tables// delimiter ; # Reset delimiter +# +# Bug #33812: mysql client incorrectly parsing DELIMITER +# +select a as delimiter from t1 +delimiter ; # Reset delimiter + # # Bug #36244: MySQL CLI doesn't recognize standalone -- as comment # before DELIMITER statement From 748a9b1a4b0e130afd25df0613f9334a9293e607 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Tue, 24 Jun 2008 21:05:56 +0500 Subject: [PATCH 041/352] back-port from 5.1. Bug#35480: BOM detection code crashes mysql CLI with zero-sized input MySQL client crashed if no input was passed to it. --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index b373b9125a0..c8d5522628d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1779,7 +1779,7 @@ static int read_and_execute(bool interactive) the very beginning of a text file when you save the file using "Unicode UTF-8" format. */ - if (!line_number && + if (line && !line_number && (uchar) line[0] == 0xEF && (uchar) line[1] == 0xBB && (uchar) line[2] == 0xBF) From 0632a93e08de60427624cc3e6178eb625d8c215a Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 24 Jun 2008 19:25:23 -0600 Subject: [PATCH 042/352] Bug #20748: Configuration files should not be read more than once Normalize directory names before adding them to default_directories. --- mysys/default.c | 298 ++++++++++++++++++++++-------------------------- 1 file changed, 136 insertions(+), 162 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index e58903d6d64..eb7721acaed 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -48,13 +48,12 @@ char *my_defaults_extra_file=0; /* Which directories are searched for options (and in which order) */ #define MAX_DEFAULT_DIRS 6 -const char *default_directories[MAX_DEFAULT_DIRS + 1]; +#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ +static const char **default_directories = NULL; #ifdef __WIN__ static const char *f_extensions[]= { ".ini", ".cnf", 0 }; #define NEWLINE "\r\n" -static char system_dir[FN_REFLEN], shared_system_dir[FN_REFLEN], - config_dir[FN_REFLEN]; #else static const char *f_extensions[]= { ".cnf", 0 }; #define NEWLINE "\n" @@ -85,19 +84,34 @@ static int search_default_file_with_ext(Process_option_func func, const char *config_file, int recursion_level); - /** Create the list of default directories. + @param alloc MEM_ROOT where the list of directories is stored + @details + The directories searched, in order, are: + - Windows: GetSystemWindowsDirectory() + - Windows: GetWindowsDirectory() + - Windows: C:/ + - Windows: Directory above where the executable is located + - Netware: sys:/etc/ + - Unix & OS/2: /etc/ + - Unix: --sysconfdir= (compile-time option) + - OS/2: getenv(ETC) + - ALL: getenv(DEFAULT_HOME_ENV) + - ALL: --defaults-extra-file= (run-time option) + - Unix: ~/ + On all systems, if a directory is already in the list, it will be moved to the end of the list. This avoids reading defaults files multiple times, while ensuring the correct precedence. - @return void + @retval NULL Failure (out of memory, probably) + @retval other Pointer to NULL-terminated array of default directories */ -static void (*init_default_directories)(); +static const char **init_default_directories(MEM_ROOT *alloc); static char *remove_end_comment(char *ptr); @@ -386,8 +400,9 @@ int load_defaults(const char *conf_file, const char **groups, struct handle_option_ctx ctx; DBUG_ENTER("load_defaults"); - init_default_directories(); init_alloc_root(&alloc,512,0); + if ((default_directories= init_default_directories(&alloc)) == NULL) + goto err; /* Check if the user doesn't want any default option processing --no-defaults is always the first option @@ -864,34 +879,49 @@ void my_print_default_files(const char *conf_file) my_bool have_ext= fn_ext(conf_file)[0] != 0; const char **exts_to_use= have_ext ? empty_list : f_extensions; char name[FN_REFLEN], **ext; - const char **dirs; - init_default_directories(); puts("\nDefault options are read from the following files in the given order:"); if (dirname_length(conf_file)) fputs(conf_file,stdout); else { - for (dirs=default_directories ; *dirs; dirs++) + /* + If default_directories is already initialized, use it. Otherwise, + use a private MEM_ROOT. + */ + const char **dirs = default_directories; + MEM_ROOT alloc; + init_alloc_root(&alloc,512,0); + + if (!dirs && (dirs= init_default_directories(&alloc)) == NULL) { - for (ext= (char**) exts_to_use; *ext; ext++) + fputs("Internal error initializing default directories list", stdout); + } + else + { + for ( ; *dirs; dirs++) { - const char *pos; - char *end; - if (**dirs) - pos= *dirs; - else if (my_defaults_extra_file) - pos= my_defaults_extra_file; - else - continue; - end= convert_dirname(name, pos, NullS); - if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ - *end++='.'; - strxmov(end, conf_file, *ext, " ", NullS); - fputs(name,stdout); + for (ext= (char**) exts_to_use; *ext; ext++) + { + const char *pos; + char *end; + if (**dirs) + pos= *dirs; + else if (my_defaults_extra_file) + pos= my_defaults_extra_file; + else + continue; + end= convert_dirname(name, pos, NullS); + if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ + *end++= '.'; + strxmov(end, conf_file, *ext, " ", NullS); + fputs(name, stdout); + } } } + + free_root(&alloc, MYF(0)); } puts(""); } @@ -928,32 +958,23 @@ void print_defaults(const char *conf_file, const char **groups) #include -/* - This extra complexity is to avoid declaring 'rc' if it won't be - used. -*/ -#define ADD_DIRECTORY_INTERNAL(DIR) \ - array_append_string_unique((DIR), default_directories, \ - array_elements(default_directories)) -#ifdef DBUG_OFF -# define ADD_DIRECTORY(DIR) (void) ADD_DIRECTORY_INTERNAL(DIR) -#else -#define ADD_DIRECTORY(DIR) \ - do { \ - my_bool rc= ADD_DIRECTORY_INTERNAL(DIR); \ - DBUG_ASSERT(rc == FALSE); /* Success */ \ - } while (0) -#endif +static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) +{ + char buf[FN_REFLEN]; + uint len; + char *p; + my_bool err __attribute__((unused)); + /* Normalize directory name */ + len= unpack_dirname(buf, dir); + if (!(p= strmake_root(alloc, buf, len))) + return 1; /* Failure */ + /* Should never fail if DEFAULT_DIRS_SIZE is correct size */ + err= array_append_string_unique(p, dirs, DEFAULT_DIRS_SIZE); + DBUG_ASSERT(err == FALSE); -#define ADD_COMMON_DIRECTORIES() \ - do { \ - char *env; \ - if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) \ - ADD_DIRECTORY(env); \ - /* Placeholder for --defaults-extra-file= */ \ - ADD_DIRECTORY(""); \ - } while (0) + return 0; +} #ifdef __WIN__ @@ -992,138 +1013,91 @@ static uint my_get_system_windows_directory(char *buffer, uint size) } -/** - Initialize default directories for Microsoft Windows - - @details - 1. GetSystemWindowsDirectory() - 2. GetWindowsDirectory() - 3. C:/ - 4. Directory above where the executable is located - 5. getenv(DEFAULT_HOME_ENV) - 6. --defaults-extra-file= (run-time option) -*/ - -static void init_default_directories_win() +static const char *my_get_module_parent(char *buf, size_t size) { - bzero((char *) default_directories, sizeof(default_directories)); + if (!GetModuleFileName(NULL, buf, size)) + return NULL; - if (my_get_system_windows_directory(shared_system_dir, - sizeof(shared_system_dir))) - ADD_DIRECTORY(shared_system_dir); - - if (GetWindowsDirectory(system_dir,sizeof(system_dir))) - ADD_DIRECTORY(system_dir); - - ADD_DIRECTORY("C:/"); - - if (GetModuleFileName(NULL, config_dir, sizeof(config_dir))) + char *last= NULL, *end= strend(buf); + /* + Look for the second-to-last \ in the filename, but hang on + to a pointer after the last \ in case we're in the root of + a drive. + */ + for ( ; end > buf; end--) { - char *last= NULL, *end= strend(config_dir); - /* - Look for the second-to-last \ in the filename, but hang on - to a pointer after the last \ in case we're in the root of - a drive. - */ - for ( ; end > config_dir; end--) + if (*end == FN_LIBCHAR) { - if (*end == FN_LIBCHAR) + if (last) { - if (last) - { - if (end != config_dir) - { - /* Keep the last '\' as this works both with D:\ and a directory */ - end[1]= 0; - } - else - { - /* No parent directory (strange). Use current dir + '\' */ - last[1]= 0; - } - break; - } - last= end; + /* Keep the last '\' as this works both with D:\ and a directory */ + end[1]= 0; + break; } + last= end; } - ADD_DIRECTORY(config_dir); } - ADD_COMMON_DIRECTORIES(); + return buf; } +#endif /* __WIN__ */ -static void (*init_default_directories)()= init_default_directories_win; + +static const char **init_default_directories(MEM_ROOT *alloc) +{ + const char **dirs; + char *env; + int errors= 0; + + dirs= (const char **)alloc_root(alloc, DEFAULT_DIRS_SIZE * sizeof(char *)); + if (dirs == NULL) + return NULL; + bzero((char *) dirs, DEFAULT_DIRS_SIZE * sizeof(char *)); + +#ifdef __WIN__ + + { + char fname_buffer[FN_REFLEN]; + if (my_get_system_windows_directory(fname_buffer, sizeof(fname_buffer))) + errors += add_directory(alloc, fname_buffer, dirs); + + if (GetWindowsDirectory(fname_buffer, sizeof(fname_buffer))) + errors += add_directory(alloc, fname_buffer, dirs); + + errors += add_directory(alloc, "C:/", dirs); + + if (my_get_module_parent(fname_buffer, sizeof(fname_buffer)) != NULL) + errors += add_directory(alloc, fname_buffer, dirs); + } #elif defined(__NETWARE__) -/** - Initialize default directories for Novell Netware - - @details - 1. sys:/etc/ - 2. getenv(DEFAULT_HOME_ENV) - 3. --defaults-extra-file= (run-time option) -*/ - -static void init_default_directories_netware() -{ - bzero((char *) default_directories, sizeof(default_directories)); - ADD_DIRECTORY("sys:/etc/"); - ADD_COMMON_DIRECTORIES(); -} - -static void (*init_default_directories)()= init_default_directories_netware; - -#elif defined(__EMX__) || defined(OS2) - -/** - Initialize default directories for OS/2 - - @details - 1. /etc/ - 2. getenv(ETC) - 3. getenv(DEFAULT_HOME_ENV) - 4. --defaults-extra-file= (run-time option) -*/ - -static void init_default_directories_os2() -{ - const char *env; - - bzero((char *) default_directories, sizeof(default_directories)); - ADD_DIRECTORY("/etc/"); - if ((env= getenv("ETC"))) - ADD_DIRECTORY(env); - ADD_COMMON_DIRECTORIES(); -} - -static void (*init_default_directories)()= init_default_directories_os2; + errors += add_directory(alloc, "sys:/etc/", dirs); #else -/** - Initialize default directories for Unix + errors += add_directory(alloc, "/etc/", dirs); - @details - 1. /etc/ - 2. --sysconfdir= (compile-time option) - 3. getenv(DEFAULT_HOME_ENV) - 4. --defaults-extra-file= (run-time option) - 5. "~/" -*/ - -static void init_default_directories_unix() -{ - bzero((char *) default_directories, sizeof(default_directories)); - ADD_DIRECTORY("/etc/"); -#ifdef DEFAULT_SYSCONFDIR +#if defined(__EMX__) || defined(OS2) + if ((env= getenv("ETC"))) + errors += add_directory(alloc, env, dirs); +#elif defined(DEFAULT_SYSCONFDIR) if (DEFAULT_SYSCONFDIR != "") - ADD_DIRECTORY(DEFAULT_SYSCONFDIR); + errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); +#endif /* __EMX__ || __OS2__ */ + #endif - ADD_COMMON_DIRECTORIES(); - ADD_DIRECTORY("~/"); + + if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV)))) + errors += add_directory(alloc, env, dirs); + + /* Placeholder for --defaults-extra-file= */ + errors += add_directory(alloc, "", dirs); + +#if !defined(__WIN__) && !defined(__NETWARE__) && \ + !defined(__EMX__) && !defined(OS2) + errors += add_directory(alloc, "~/", dirs); +#endif + + return (errors > 0 ? NULL : dirs); } - -static void (*init_default_directories)()= init_default_directories_unix; - -#endif From 69a1c78eba45ebfc141fd14d6f11e745a778ce00 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Wed, 25 Jun 2008 16:59:38 +0200 Subject: [PATCH 043/352] Fix for Bug#37492 timing bug in subselect.test + similar weaknesses found during testing + replace error numbers by error names --- mysql-test/include/wait_condition.inc | 59 +++++++ mysql-test/t/subselect.test | 229 ++++++++++++++------------ 2 files changed, 180 insertions(+), 108 deletions(-) create mode 100644 mysql-test/include/wait_condition.inc diff --git a/mysql-test/include/wait_condition.inc b/mysql-test/include/wait_condition.inc new file mode 100644 index 00000000000..a41d8080c9b --- /dev/null +++ b/mysql-test/include/wait_condition.inc @@ -0,0 +1,59 @@ +# include/wait_condition.inc +# +# SUMMARY +# +# Waits until the passed statement returns true, or the operation +# times out. +# +# USAGE +# +# let $wait_condition= +# SELECT c = 3 FROM t; +# --source include/wait_condition.inc +# +# OR +# +# let $wait_timeout= 60; # Override default 30 seconds with 60. +# let $wait_condition= +# SELECT c = 3 FROM t; +# --source include/wait_condition.inc +# --echo Executed the test condition $wait_condition_reps times +# +# EXAMPLE +# events_bugs.test, events_time_zone.test +# + +--disable_query_log + +let $wait_counter= 300; +if ($wait_timeout) +{ + let $wait_counter= `SELECT $wait_timeout * 10`; +} +# Reset $wait_timeout so that its value won't be used on subsequent +# calls, and default will be used instead. +let $wait_timeout= 0; + +# Keep track of how many times the wait condition is tested +# This is used by some tests (e.g., main.status) +let $wait_condition_reps= 0; +while ($wait_counter) +{ + let $success= `$wait_condition`; + inc $wait_condition_reps; + if ($success) + { + let $wait_counter= 0; + } + if (!$success) + { + real_sleep 0.1; + dec $wait_counter; + } +} +if (!$success) +{ + echo Timeout in wait_condition.inc for $wait_condition; +} + +--enable_query_log diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 78b4de6e816..4d9507f1231 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -9,28 +9,28 @@ SELECT (SELECT 1) UNION SELECT (SELECT 2); explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); SELECT (SELECT (SELECT 0 UNION SELECT 0)); explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); --- error 1247 +-- error ER_ILLEGAL_REFERENCE SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; --- error 1247 +-- error ER_ILLEGAL_REFERENCE SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; SELECT (SELECT 1),MAX(1) FROM (SELECT 1) as a; --- error 1247 +-- error ER_ILLEGAL_REFERENCE SELECT (SELECT a) as a; EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; --- error 1054 +-- error ER_BAD_FIELD_ERROR SELECT (SELECT 1), a; SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1; --- error 1054 +-- error ER_BAD_FIELD_ERROR SELECT 1 FROM (SELECT (SELECT a) b) c; SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT * FROM (SELECT 1) a WHERE 1 IN (SELECT 1,1); SELECT 1 IN (SELECT 1); SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); --- error 1221 +-- error ER_WRONG_USAGE select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); --- error 1108 +-- error ER_WRONG_PARAMETERS_TO_PROCEDURE SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); -- error ER_BAD_FIELD_ERROR SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; @@ -53,7 +53,7 @@ SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a); SELECT 1 as a,(SELECT a+a) b,(SELECT b); @@ -65,7 +65,7 @@ create table t4 (a int not null, b int not null); insert into t1 values (2); insert into t2 values (1,7),(2,7); insert into t4 values (4,8),(3,8),(5,9); --- error 1247 +-- error ER_ILLEGAL_REFERENCE select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1; select (select a from t1 where t1.a=t2.a), a from t2; select (select a from t1 where t1.a=t2.b), a from t2; @@ -105,9 +105,9 @@ select * from t3 where a >= any (select b from t2); explain extended select * from t3 where a >= any (select b from t2); select * from t3 where a >= all (select b from t2); delete from t2 where a=100; --- error 1241 +-- error ER_OPERAND_COLUMNS select * from t3 where a in (select a,b from t2); --- error 1241 +-- error ER_OPERAND_COLUMNS select * from t3 where a in (select * from t2); insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10); # empty set @@ -123,7 +123,7 @@ select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) insert into t5 values (2); select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); create table t7( uq int primary key, name char(25)); @@ -133,7 +133,7 @@ select * from t6 where exists (select * from t7 where uq = clinic_uq); explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq); # not unique fields --- error 1052 +-- error ER_NON_UNIQ_ERROR select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); # different tipes & group functions @@ -160,14 +160,14 @@ INSERT INTO t8 (pseudo,email) VALUES ('joce','test'); INSERT INTO t8 (pseudo,email) VALUES ('joce1','test1'); INSERT INTO t8 (pseudo,email) VALUES ('2joce1','2test1'); EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce')) FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM t8 WHERE pseudo='joce'); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT pseudo FROM t8 WHERE pseudo=(SELECT * FROM t8 WHERE pseudo='joce'); SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo LIKE '%joce%'); drop table if exists t1,t2,t3,t4,t5,t6,t7,t8; @@ -187,7 +187,7 @@ EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1; --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1); drop table t1; @@ -213,9 +213,9 @@ CREATE TABLE `t2` ( INSERT INTO t2 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce'); select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); SELECT numeropost,maxnumrep FROM t1 WHERE exists (SELECT 1 FROM t2 WHERE (mot='joce') AND date >= '2002-10-21' AND t1.numeropost = t2.topic) ORDER BY maxnumrep DESC LIMIT 0, 20; --- error 1054 +-- error ER_BAD_FIELD_ERROR SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) b; --- error 1054 +-- error ER_BAD_FIELD_ERROR SELECT 1 IN (SELECT 1 FROM t2 HAVING a); SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic); @@ -244,9 +244,9 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM ROW_FORMAT=FIXED; INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1); drop table t1; @@ -258,7 +258,7 @@ drop table t1; #iftest CREATE TABLE t1 (field char(1) NOT NULL DEFAULT 'b'); INSERT INTO t1 VALUES (); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW SELECT field FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) a HAVING field='b'); drop table t1; @@ -271,13 +271,13 @@ CREATE TABLE `t1` ( UNIQUE KEY `numreponse` (`numreponse`), KEY `pseudo` (`pseudo`,`numeropost`) ) ENGINE=MyISAM; --- error 1247 +-- error ER_ILLEGAL_REFERENCE SELECT (SELECT numeropost FROM t1 HAVING numreponse=a),numreponse FROM (SELECT * FROM t1) as a; --- error 1054 +-- error ER_BAD_FIELD_ERROR SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=a) FROM (SELECT * FROM t1) as a; SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=1) FROM (SELECT * FROM t1) as a; INSERT INTO t1 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test'); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1'); EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); @@ -294,9 +294,9 @@ create table t2 (a int NOT NULL, b int, primary key (a)); insert into t1 values (0, 10),(1, 11),(2, 12); insert into t2 values (1, 21),(2, 22),(3, 23); select * from t1; --- error 1093 +-- error ER_UPDATE_TABLE_USED update t1 set b= (select b from t1); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW update t1 set b= (select b from t2); update t1 set b= (select b from t2 where t1.a = t2.a); select * from t1; @@ -309,9 +309,9 @@ insert into t1 values (0, 10),(1, 11),(2, 12); insert into t2 values (1, 21),(2, 12),(3, 23); select * from t1; select * from t1 where b = (select b from t2 where t1.a = t2.a); --- error 1093 +-- error ER_UPDATE_TABLE_USED delete from t1 where b = (select b from t1); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW delete from t1 where b = (select b from t2); delete from t1 where b = (select b from t2 where t1.a = t2.a); select * from t1; @@ -327,9 +327,9 @@ insert into t12 values (33, 10),(22, 11),(2, 12); insert into t2 values (1, 21),(2, 12),(3, 23); select * from t11; select * from t12; --- error 1093 +-- error ER_UPDATE_TABLE_USED delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2); delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a); select * from t11; @@ -342,25 +342,29 @@ create table t2 (a int); create table t3 (b int); insert into t2 values (1); insert into t3 values (1),(2); --- error 1093 +-- error ER_UPDATE_TABLE_USED INSERT INTO t1 (x) VALUES ((SELECT x FROM t1)); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW INSERT INTO t1 (x) VALUES ((SELECT b FROM t3)); INSERT INTO t1 (x) VALUES ((SELECT a FROM t2)); select * from t1; insert into t2 values (1); +let $row_count_before= `SELECT COUNT(*) FROM t1`; INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2)); --- sleep 1 +let $wait_condition= SELECT COUNT(*) <> $row_count_before FROM t1; +--source include/wait_condition.inc select * from t1; INSERT INTO t1 (x) select (SELECT SUM(a)+1 FROM t2) FROM t2; select * from t1; # After this, only data based on old t1 records should have been added. INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2; select * from t1; --- error 1054 +-- error ER_BAD_FIELD_ERROR INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2)); +let $row_count_before= `SELECT COUNT(*) FROM t1`; INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2)); --- sleep 1 +let $wait_condition= SELECT COUNT(*) <> $row_count_before FROM t1; +--source include/wait_condition.inc select * from t1; # #TODO: should be uncommented after bug 380 fix pushed @@ -375,25 +379,30 @@ create table t3 (a int); insert into t2 values (1); insert into t3 values (1),(2); select * from t1; --- error 1093 +-- error ER_UPDATE_TABLE_USED replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2)); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2)); replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2)); select * from t1; replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+2 FROM t2)); select * from t1; +let $row_count_before= `SELECT COUNT(*) FROM t1`; replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a FROM t2)); --- sleep 1 +# We get one additional row +let $wait_condition= SELECT COUNT(*) <> $row_count_before FROM t1; +--source include/wait_condition.inc select * from t1; +let $row_count_before= `SELECT COUNT(*) FROM t1 WHERE y = 2`; replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a+1 FROM t2)); --- sleep 1 +let $wait_condition= SELECT COUNT(*) <> $row_count_before FROM t1 WHERE y = 2; +--source include/wait_condition.inc select * from t1; replace LOW_PRIORITY into t1 (x, y) VALUES ((SELECT a+1 FROM t2), (SELECT a FROM t2)); select * from t1; drop table t1, t2, t3; --- error 1096 +-- error ER_NO_TABLES_USED SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *); CREATE TABLE t2 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1; @@ -406,14 +415,14 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1)); EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); --- error 1093 +-- error ER_UPDATE_TABLE_USED INSERT INTO t2 VALUES ((SELECT * FROM t2)); --- error 1093 +-- error ER_UPDATE_TABLE_USED INSERT INTO t2 VALUES ((SELECT id FROM t2)); SELECT * FROM t2; CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 values (1),(1); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW UPDATE t2 SET id=(SELECT * FROM t1); drop table t2, t1; @@ -481,9 +490,9 @@ drop table t1,t2,t3; #LIMIT is not supported now create table t1 (a float); --- error 1235 +-- error ER_NOT_SUPPORTED_YET select 10.5 IN (SELECT * from t1 LIMIT 1); --- error 1235 +-- error ER_NOT_SUPPORTED_YET select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); drop table t1; @@ -507,7 +516,7 @@ select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null); select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a'); select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a'); select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a'); --- error 1235 +-- error ER_NOT_SUPPORTED_YET select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2); drop table t1; @@ -522,14 +531,14 @@ set @a:=2; set @a:=(SELECT a from t1); select @a; drop table t1; --- error 1146 +-- error ER_NO_SUCH_TABLE do (SELECT a from t1); --- error 1146 +-- error ER_NO_SUCH_TABLE set @a:=(SELECT a from t1); CREATE TABLE t1 (a int, KEY(a)); HANDLER t1 OPEN; --- error 1064 +-- error ER_PARSE_ERROR HANDLER t1 READ a=((SELECT 1)); HANDLER t1 CLOSE; drop table t1; @@ -627,7 +636,7 @@ drop table t1; # # error in IN # --- error 1146 +-- error ER_NO_SUCH_TABLE select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent); # @@ -698,7 +707,7 @@ CREATE TABLE `t1` ( INSERT INTO t1 VALUES (1); UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); --- error 1054 +-- error ER_BAD_FIELD_ERROR UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); select * from t1; drop table t1; @@ -855,7 +864,7 @@ create table t1 (s1 int); create table t2 (s1 int); insert into t1 values (1); insert into t2 values (1); --- error 1054 +-- error ER_BAD_FIELD_ERROR update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A); DROP TABLE t1, t2; @@ -865,9 +874,9 @@ DROP TABLE t1, t2; CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci, s2 CHAR(5) COLLATE latin1_swedish_ci); INSERT INTO t1 VALUES ('z','?'); --- error 1267 +-- error ER_CANT_AGGREGATE_2COLLATIONS select * from t1 where s1 > (select max(s2) from t1); --- error 1267 +-- error ER_CANT_AGGREGATE_2COLLATIONS select * from t1 where s1 > any (select max(s2) from t1); drop table t1; @@ -885,7 +894,7 @@ drop table t1, t2; # row union # create table t1 (s1 char(5)); --- error 1241 +-- error ER_OPERAND_COLUMNS select (select 'a','b' from t1 union select 'a','b' from t1) from t1; insert into t1 values ('tttt'); select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1); @@ -963,7 +972,7 @@ CREATE TABLE t1 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1),(5); CREATE TABLE t2 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t2 VALUES (2),(6); --- error 1241 +-- error ER_OPERAND_COLUMNS select * from t1 where (1,2,6) in (select * from t2); DROP TABLE t1,t2; @@ -973,7 +982,7 @@ DROP TABLE t1,t2; create table t1 (s1 int); insert into t1 values (1); insert into t1 values (2); --- error 1242 +-- error ER_SUBQUERY_NO_1_ROW set sort_buffer_size = (select s1 from t1); do (select * from t1); drop table t1; @@ -1003,11 +1012,11 @@ drop table t1, t2; # create table t1 (s1 int); create table t2 (s1 int); --- error 1054 +-- error ER_BAD_FIELD_ERROR select * from t1 where (select count(*) from t2 where t1.s2) = 1; --- error 1054 +-- error ER_BAD_FIELD_ERROR select * from t1 where (select count(*) from t2 group by t1.s2) = 1; --- error 1054 +-- error ER_BAD_FIELD_ERROR select count(*) from t2 group by t1.s2; drop table t1, t2; @@ -1032,9 +1041,13 @@ DROP TABLE t1; create table t1 (a int, b decimal(13, 3)); insert into t1 values (1, 0.123); +let $outfile = $MYSQLTEST_VARDIR/master-data/test/subselect.out.file.1; +--error 0,1 +--remove_file $outfile select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1; delete from t1; load data infile "subselect.out.file.1" into table t1; +--remove_file $outfile select * from t1; drop table t1; @@ -1123,7 +1136,7 @@ drop table t1; create table t1(id int); create table t2(id int); create table t3(flag int); --- error 1064 +-- error ER_PARSE_ERROR select (select * from t3 where id not null) from t1, t2; drop table t1,t2,t3; @@ -1212,31 +1225,31 @@ SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FR SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); # row tests # < > >= <= and = ALL/ <> ANY do not support row operation --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE a > ANY (SELECT a,2 FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a,2 FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE a > ALL (SELECT a,2 FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a,2 FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) = ALL (SELECT a,2 FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) <> ANY (SELECT a,2 FROM t1 WHERE b = 2); # following should be converted to IN --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE a = ANY (SELECT a,2 FROM t1 WHERE b = 2); SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a FROM t1 WHERE b = 2); --- error 1241 +-- error ER_OPERAND_COLUMNS SELECT a FROM t1 WHERE a <> ALL (SELECT a,2 FROM t1 WHERE b = 2); SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a,2 FROM t1 WHERE b = 2); SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2); @@ -1441,7 +1454,7 @@ CREATE TABLE `t1` ( `master` int(10) unsigned NOT NULL default '0', `map` smalli INSERT INTO `t1` VALUES (1,0,0,700),(1,1,1,400),(1,5,5,400),(1,12,12,400),(1,12,32,400),(4,12,32,400); CREATE TABLE `t2` ( `id` int(10) unsigned NOT NULL default '0', `pid` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `level` tinyint(4) unsigned NOT NULL default '0', `title` varchar(255) default NULL, PRIMARY KEY (`id`,`pid`,`map`), KEY `level` (`level`), KEY `id` (`id`,`map`)) ; INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,'a'),(12,5,12,7,'a'); --- error 1054 +-- error ER_BAD_FIELD_ERROR SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; drop tables t1,t2; @@ -1545,7 +1558,7 @@ drop table t1; # create table t1 (a1 int); create table t2 (b1 int); ---error 1054 +--error ER_BAD_FIELD_ERROR select * from t1 where a2 > any(select b1 from t2); select * from t1 where a1 > any(select b1 from t2); drop table t1,t2; @@ -1566,11 +1579,11 @@ drop table t1; # Comparison subquery and row with nested rows # create table t1 (a integer, b integer); --- error 1241 +-- error ER_OPERAND_COLUMNS select row(1,(2,2)) in (select * from t1 ); --- error 1241 +-- error ER_OPERAND_COLUMNS select row(1,(2,2)) = (select * from t1 ); --- error 1241 +-- error ER_OPERAND_COLUMNS select (select * from t1) = row(1,(2,2)); drop table t1; @@ -1579,14 +1592,14 @@ drop table t1; # create table t1 (a integer); insert into t1 values (1); --- error 1247 +-- error ER_ILLEGAL_REFERENCE select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx ; --- error 1247 +-- error ER_ILLEGAL_REFERENCE select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; select 1 as xx, 1 = ALL ( select 1 from t1 where 1 = xx ); --- error 1247 +-- error ER_ILLEGAL_REFERENCE select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; --- error 1247 +-- error ER_ILLEGAL_REFERENCE select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; drop table t1; @@ -1723,17 +1736,17 @@ drop table t1, t2; # create table t1 (a int, b int); insert into t1 values (1,2); --- error 1241 +-- error ER_OPERAND_COLUMNS select 1 = (select * from t1); --- error 1241 +-- error ER_OPERAND_COLUMNS select (select * from t1) = 1; --- error 1241 +-- error ER_OPERAND_COLUMNS select (1,2) = (select a from t1); --- error 1241 +-- error ER_OPERAND_COLUMNS select (select a from t1) = (1,2); --- error 1241 +-- error ER_OPERAND_COLUMNS select (1,2,3) = (select * from t1); --- error 1241 +-- error ER_OPERAND_COLUMNS select (select * from t1) = (1,2,3); drop table t1; @@ -2014,21 +2027,21 @@ INSERT INTO t2 VALUES (2,1), (1,3), (2,1), (4,4), (2,2), (1,4); SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 2 ); ---error 1242 +--error ER_SUBQUERY_NO_1_ROW SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 1); SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 2), a; ---error 1242 +--error ER_SUBQUERY_NO_1_ROW SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 1), a; SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 2); ---error 1242 +--error ER_SUBQUERY_NO_1_ROW SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 1); SELECT a FROM t1 GROUP BY a HAVING IFNULL((SELECT b FROM t2 WHERE b > 2), (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3; ---error 1242 +--error ER_SUBQUERY_NO_1_ROW SELECT a FROM t1 GROUP BY a HAVING IFNULL((SELECT b FROM t2 WHERE b > 1), (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3; @@ -2036,7 +2049,7 @@ SELECT a FROM t1 GROUP BY a SELECT a FROM t1 GROUP BY a HAVING IFNULL((SELECT b FROM t2 WHERE b > 4), (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3; ---error 1242 +--error ER_SUBQUERY_NO_1_ROW SELECT a FROM t1 GROUP BY a HAVING IFNULL((SELECT b FROM t2 WHERE b > 4), (SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)) > 3; @@ -2044,7 +2057,7 @@ SELECT a FROM t1 GROUP BY a SELECT a FROM t1 ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 2), (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)); ---error 1242 +--error ER_SUBQUERY_NO_1_ROW SELECT a FROM t1 ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 1), (SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)); @@ -2052,7 +2065,7 @@ SELECT a FROM t1 SELECT a FROM t1 ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4), (SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)); ---error 1242 +--error ER_SUBQUERY_NO_1_ROW SELECT a FROM t1 ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4), (SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)); @@ -2263,12 +2276,12 @@ SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > ALL(SELECT t2.c FROM t2 WHERE EXISTS(SELECT t3.e FROM t3 GROUP BY t3.e HAVING SUM(t1.a+t2.c) < t3.e/4)); --- error 1111 +-- error ER_INVALID_GROUP_FUNC_USE SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > ALL(SELECT t2.c FROM t2 WHERE EXISTS(SELECT t3.e FROM t3 WHERE SUM(t1.a+t2.c) < t3.e/4)); --- error 1111 +-- error ER_INVALID_GROUP_FUNC_USE SELECT t1.a from t1 GROUP BY t1.a HAVING AVG(SUM(t1.b)) > 20; SELECT t1.a FROM t1 GROUP BY t1.a @@ -2330,11 +2343,11 @@ drop table t1, t2; CREATE TABLE t1 (a INT); ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); ---error 1054 +--error ER_BAD_FIELD_ERROR CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); ---error 1054 +--error ER_BAD_FIELD_ERROR SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); DROP TABLE t1; @@ -2469,7 +2482,7 @@ SELECT * FROM t1 WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1))); #TODO:not supported ---error 1064 +--error ER_PARSE_ERROR explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) from t1; @@ -2839,12 +2852,12 @@ SELECT a FROM t1 t0 WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; SET @@sql_mode='ansi'; ---error 1111 +--error ER_INVALID_GROUP_FUNC_USE SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; ---error 1111 +--error ER_INVALID_GROUP_FUNC_USE SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; ---error 1111 +--error ER_INVALID_GROUP_FUNC_USE SELECT a FROM t1 t0 WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; @@ -3032,9 +3045,9 @@ while ($should_work_nesting) while ($nesting) { --echo $nesting ---error 0,1436 +--error 0,ER_STACK_OVERRUN_NEED_MORE eval $start $end; ---error 0,1436 +--error 0,ER_STACK_OVERRUN_NEED_MORE eval explain $start $end; let $start= $start $start_app; From c896190892d264b4a2d9cc428270b79980f75155 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Fri, 27 Jun 2008 15:23:40 +0500 Subject: [PATCH 044/352] backport to 5.1 from 6.0 Bug#35658 (An empty binary value leads to mysqld crash) Before this fix, the following token b'' caused the parser to crash when reading the binary value from the empty string. The crash was caused by: ptr+= max_length - 1; because max_length is unsigned and was 0, causing an overflow. With this fix, an empty binary literal b'' is parsed as a binary value 0, in Item_bin_string. --- mysql-test/r/varbinary.result | 31 +++++++++++++++++++++++++++++++ mysql-test/t/varbinary.test | 28 ++++++++++++++++++++++++++++ sql/item.cc | 29 ++++++++++++++++++----------- 3 files changed, 77 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index 6d39d8301c5..271d7a0fe8d 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -95,3 +95,34 @@ table_28127_b CREATE TABLE `table_28127_b` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table table_28127_a; drop table table_28127_b; +select 0b01000001; +0b01000001 +A +select 0x41; +0x41 +A +select b'01000001'; +b'01000001' +A +select x'41', 0+x'41'; +x'41' 0+x'41' +A 65 +select N'abc', length(N'abc'); +abc length(N'abc') +abc 3 +select N'', length(N''); + length(N'') + 0 +select '', length(''); + length('') + 0 +select b'', 0+b''; +b'' 0+b'' + 0 +select x'', 0+x''; +x'' 0+x'' + 0 +select 0x; +ERROR 42S22: Unknown column '0x' in 'field list' +select 0b; +ERROR 42S22: Unknown column '0b' in 'field list' diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index 9ccbac7cdda..1db561183a7 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -104,3 +104,31 @@ show create table table_28127_b; drop table table_28127_a; drop table table_28127_b; +# +# Bug#35658 (An empty binary value leads to mysqld crash) +# + +select 0b01000001; + +select 0x41; + +select b'01000001'; + +select x'41', 0+x'41'; + +select N'abc', length(N'abc'); + +select N'', length(N''); + +select '', length(''); + +select b'', 0+b''; + +select x'', 0+x''; + +--error ER_BAD_FIELD_ERROR +select 0x; + +--error ER_BAD_FIELD_ERROR +select 0b; + diff --git a/sql/item.cc b/sql/item.cc index 96408a70bdd..5ee394fcbe0 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5172,21 +5172,28 @@ Item_bin_string::Item_bin_string(const char *str, uint str_length) if (!ptr) return; str_value.set(ptr, max_length, &my_charset_bin); - ptr+= max_length - 1; - ptr[1]= 0; // Set end null for string - for (; end >= str; end--) + + if (max_length > 0) { - if (power == 256) + ptr+= max_length - 1; + ptr[1]= 0; // Set end null for string + for (; end >= str; end--) { - power= 1; - *ptr--= bits; - bits= 0; + if (power == 256) + { + power= 1; + *ptr--= bits; + bits= 0; + } + if (*end == '1') + bits|= power; + power<<= 1; } - if (*end == '1') - bits|= power; - power<<= 1; + *ptr= (char) bits; } - *ptr= (char) bits; + else + ptr[0]= 0; + collation.set(&my_charset_bin, DERIVATION_COERCIBLE); fixed= 1; } From 5e27237a156c3263c1db28f77af13380d15dc5ea Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 27 Jun 2008 12:58:07 +0200 Subject: [PATCH 045/352] Version number bump for 5.0.60sp1 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 9c35dbcc7c7..de0d199af96 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.60) +AM_INIT_AUTOMAKE(mysql, 5.0.60sp1) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=60 +NDB_VERSION_BUILD=60sp1 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From afa3d1207b199775e2e922c89a0a9495984ab9f4 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Fri, 27 Jun 2008 18:22:23 +0500 Subject: [PATCH 046/352] buckport to 5.1.26 from 6.0 Bug#35658 (An empty binary value leads to mysqld crash) Before this fix, the following token b'' caused the parser to crash when reading the binary value from the empty string. The crash was caused by: ptr+= max_length - 1; because max_length is unsigned and was 0, causing an overflow. With this fix, an empty binary literal b'' is parsed as a binary value 0, in Item_bin_string. --- mysql-test/r/varbinary.result | 31 +++++++++++++++++++++++++++++++ mysql-test/t/varbinary.test | 28 ++++++++++++++++++++++++++++ sql/item.cc | 29 ++++++++++++++++++----------- 3 files changed, 77 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index 6d39d8301c5..271d7a0fe8d 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -95,3 +95,34 @@ table_28127_b CREATE TABLE `table_28127_b` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table table_28127_a; drop table table_28127_b; +select 0b01000001; +0b01000001 +A +select 0x41; +0x41 +A +select b'01000001'; +b'01000001' +A +select x'41', 0+x'41'; +x'41' 0+x'41' +A 65 +select N'abc', length(N'abc'); +abc length(N'abc') +abc 3 +select N'', length(N''); + length(N'') + 0 +select '', length(''); + length('') + 0 +select b'', 0+b''; +b'' 0+b'' + 0 +select x'', 0+x''; +x'' 0+x'' + 0 +select 0x; +ERROR 42S22: Unknown column '0x' in 'field list' +select 0b; +ERROR 42S22: Unknown column '0b' in 'field list' diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index 9ccbac7cdda..1db561183a7 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -104,3 +104,31 @@ show create table table_28127_b; drop table table_28127_a; drop table table_28127_b; +# +# Bug#35658 (An empty binary value leads to mysqld crash) +# + +select 0b01000001; + +select 0x41; + +select b'01000001'; + +select x'41', 0+x'41'; + +select N'abc', length(N'abc'); + +select N'', length(N''); + +select '', length(''); + +select b'', 0+b''; + +select x'', 0+x''; + +--error ER_BAD_FIELD_ERROR +select 0x; + +--error ER_BAD_FIELD_ERROR +select 0b; + diff --git a/sql/item.cc b/sql/item.cc index 96408a70bdd..5ee394fcbe0 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5172,21 +5172,28 @@ Item_bin_string::Item_bin_string(const char *str, uint str_length) if (!ptr) return; str_value.set(ptr, max_length, &my_charset_bin); - ptr+= max_length - 1; - ptr[1]= 0; // Set end null for string - for (; end >= str; end--) + + if (max_length > 0) { - if (power == 256) + ptr+= max_length - 1; + ptr[1]= 0; // Set end null for string + for (; end >= str; end--) { - power= 1; - *ptr--= bits; - bits= 0; + if (power == 256) + { + power= 1; + *ptr--= bits; + bits= 0; + } + if (*end == '1') + bits|= power; + power<<= 1; } - if (*end == '1') - bits|= power; - power<<= 1; + *ptr= (char) bits; } - *ptr= (char) bits; + else + ptr[0]= 0; + collation.set(&my_charset_bin, DERIVATION_COERCIBLE); fixed= 1; } From 790edf009a87be3bae52c534b98e8c32741ace8a Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Fri, 27 Jun 2008 20:56:41 +0500 Subject: [PATCH 047/352] backport from 6.0 Bug#35658 (An empty binary value leads to mysqld crash) Before this fix, the following token b'' caused the parser to crash when reading the binary value from the empty string. The crash was caused by: ptr+= max_length - 1; because max_length is unsigned and was 0, causing an overflow. With this fix, an empty binary literal b'' is parsed as a binary value 0, in Item_bin_string. --- mysql-test/r/varbinary.result | 31 +++++++++++++++++++++++++++++++ mysql-test/t/varbinary.test | 28 ++++++++++++++++++++++++++++ sql/item.cc | 29 ++++++++++++++++++----------- 3 files changed, 77 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index a41885a257d..f584c22f98a 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -78,3 +78,34 @@ alter table t1 modify a varchar(255); select length(a) from t1; length(a) 6 +select 0b01000001; +0b01000001 +A +select 0x41; +0x41 +A +select b'01000001'; +b'01000001' +A +select x'41', 0+x'41'; +x'41' 0+x'41' +A 65 +select N'abc', length(N'abc'); +abc length(N'abc') +abc 3 +select N'', length(N''); + length(N'') + 0 +select '', length(''); + length('') + 0 +select b'', 0+b''; +b'' 0+b'' + 0 +select x'', 0+x''; +x'' 0+x'' + 0 +select 0x; +ERROR 42S22: Unknown column '0x' in 'field list' +select 0b; +ERROR 42S22: Unknown column '0b' in 'field list' diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test index 2f0c1c83e84..427c1a6b84a 100644 --- a/mysql-test/t/varbinary.test +++ b/mysql-test/t/varbinary.test @@ -84,3 +84,31 @@ select length(a) from t1; alter table t1 modify a varchar(255); select length(a) from t1; +# +# Bug#35658 (An empty binary value leads to mysqld crash) +# + +select 0b01000001; + +select 0x41; + +select b'01000001'; + +select x'41', 0+x'41'; + +select N'abc', length(N'abc'); + +select N'', length(N''); + +select '', length(''); + +select b'', 0+b''; + +select x'', 0+x''; + +--error ER_BAD_FIELD_ERROR +select 0x; + +--error ER_BAD_FIELD_ERROR +select 0b; + diff --git a/sql/item.cc b/sql/item.cc index 9ff1f8c0084..bf447581afa 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5013,21 +5013,28 @@ Item_bin_string::Item_bin_string(const char *str, uint str_length) if (!ptr) return; str_value.set(ptr, max_length, &my_charset_bin); - ptr+= max_length - 1; - ptr[1]= 0; // Set end null for string - for (; end >= str; end--) + + if (max_length > 0) { - if (power == 256) + ptr+= max_length - 1; + ptr[1]= 0; // Set end null for string + for (; end >= str; end--) { - power= 1; - *ptr--= bits; - bits= 0; + if (power == 256) + { + power= 1; + *ptr--= bits; + bits= 0; + } + if (*end == '1') + bits|= power; + power<<= 1; } - if (*end == '1') - bits|= power; - power<<= 1; + *ptr= (char) bits; } - *ptr= (char) bits; + else + ptr[0]= 0; + collation.set(&my_charset_bin, DERIVATION_COERCIBLE); fixed= 1; } From bccaffb0f1485414414ed4ef9a60300ff658628c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 27 Jun 2008 18:13:50 +0200 Subject: [PATCH 048/352] Try different sp1 suffix for NDB. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index de0d199af96..695044fc03b 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=60sp1 +NDB_VERSION_BUILD=60-sp1 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 104071ac125bb58b9e98b1dd7faa6da3e115a90f Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 27 Jun 2008 18:43:45 +0200 Subject: [PATCH 049/352] Revert NDB version bump completely. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 695044fc03b..02e5e936967 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=60-sp1 +NDB_VERSION_BUILD=60 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 07268a15a1eccbc84c4a8d2fb96c29b24f805bfd Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 27 Jun 2008 19:12:42 +0200 Subject: [PATCH 050/352] OS X 10.5 is now a supported platform, so Apple's internal name ("darwin9") must be translated to ours ("osx10.5"). --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 50cff8578c9..af3db86af81 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -61,6 +61,7 @@ system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` +system=`echo $system | sed -e 's/darwin9.*/osx10.5/g'` system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` From fc827ae387c803f1d9f1f1c3d83e4a33a4b09179 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Fri, 27 Jun 2008 23:50:53 +0500 Subject: [PATCH 051/352] Fixed bug #36632: SELECT DISTINCT from a simple view on an InnoDB table, where all selected columns belong to the same unique index key, returns incorrect results Server executes some queries via QUICK_GROUP_MIN_MAX_SELECT (MIN/MAX optimization for queries with GROUP BY or DISTINCT clause) and that optimization implies loose index scan, so all grouping is done by the QUICK_GROUP_MIN_MAX_SELECT::get_next method. The server does not set the precomputed_group_by flag for some QUICK_GROUP_MIN_MAX_SELECT queries and duplicates grouping by call to the end_send_group function. Fix: when the test_if_skip_sort_order function selects loose index scan as a best way to satisfy an ORDER BY/GROUP BY type of query, the precomputed_group_by flag has been set to use end_send/end_write functions instead of end_send_group/ end_write_group functions. --- mysql-test/r/group_min_max_innodb.result | 24 ++++++++++++++++++++++++ mysql-test/t/group_min_max_innodb.test | 24 ++++++++++++++++++++++++ sql/sql_select.cc | 2 ++ 3 files changed, 50 insertions(+) diff --git a/mysql-test/r/group_min_max_innodb.result b/mysql-test/r/group_min_max_innodb.result index ae4b9d4d5dd..6607e1babf6 100644 --- a/mysql-test/r/group_min_max_innodb.result +++ b/mysql-test/r/group_min_max_innodb.result @@ -1,3 +1,5 @@ +drop view if exists v1; +drop table if exists t1,t4; create table t4 ( pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' ' ) engine=innodb; @@ -70,3 +72,25 @@ explain select distinct f1, f2 from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary drop table t1; +create table t1(pk int primary key) engine=innodb; +create view v1 as select pk from t1 where pk < 20; +insert into t1 values (1), (2), (3), (4); +select distinct pk from v1; +pk +1 +2 +3 +4 +insert into t1 values (5), (6), (7); +select distinct pk from v1; +pk +1 +2 +3 +4 +5 +6 +7 +drop view v1; +drop table t1; +End of 5.1 tests diff --git a/mysql-test/t/group_min_max_innodb.test b/mysql-test/t/group_min_max_innodb.test index ea2a603a8a4..643b4f7d55e 100644 --- a/mysql-test/t/group_min_max_innodb.test +++ b/mysql-test/t/group_min_max_innodb.test @@ -6,6 +6,11 @@ --source include/have_innodb.inc +--disable_warnings +drop view if exists v1; +drop table if exists t1,t4; +--enable_warnings + # # Bug #12672: primary key implcitly included in every innodb index # @@ -93,3 +98,22 @@ alter table t1 drop primary key, add primary key (f2, f1); explain select distinct f1 a, f1 b from t1; explain select distinct f1, f2 from t1; drop table t1; + + +# +# Bug #36632: Select distinct from a simple view on an InnoDB table +# returns incorrect results +# +create table t1(pk int primary key) engine=innodb; +create view v1 as select pk from t1 where pk < 20; + +insert into t1 values (1), (2), (3), (4); +select distinct pk from v1; + +insert into t1 values (5), (6), (7); +select distinct pk from v1; + +drop view v1; +drop table t1; + +--echo End of 5.1 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2ef7aa13dd8..8cdcf12ef90 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13177,6 +13177,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, tab->ref.key= -1; tab->ref.key_parts=0; // Don't use ref key. tab->read_first_record= join_init_read_record; + if (tab->is_using_loose_index_scan()) + join->tmp_table_param.precomputed_group_by= TRUE; /* TODO: update the number of records in join->best_positions[tablenr] */ From d021db69fc92c72cf110821aebc225a416c1f463 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 30 Jun 2008 12:54:18 +0200 Subject: [PATCH 052/352] We may need 5.1.27 for selected pushes, so reserve the number. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2b763e1992b..08d21a23e81 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.27) +AM_INIT_AUTOMAKE(mysql, 5.1.28) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 05a33978e4a3c6ddda584ed6b5e5e40bd11d62b6 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Mon, 30 Jun 2008 13:06:41 +0200 Subject: [PATCH 053/352] BUG#37200: rpl_switch_stm_row_mixed fails sporadically in pushbuild Problem: rpl_switch_stm_row_mixed did not wait until row events generated by INSERT DELAYED were written to the master binlog before it synchronized slave with master. This caused sporadic errors where these rows were missing on slave. Fix: wait until all rows appear on the slave. This is a backport, applying the same to 5.1-bugteam as was previously applied to 6.0-rpl --- mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index 8e6a04104bd..548dd0f1d62 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -293,8 +293,16 @@ insert delayed into t2 values(rand()); set @a=2.345; insert delayed into t2 values(@a); +# With INSERT DELAYED, rows are written to the binlog after they are +# written to the table. Therefore, it is not enough to wait until the +# rows make it to t2 on the master (the rows may not be in the binlog +# at that time, and may still not be in the binlog when +# sync_slave_with_master is later called). Instead, we wait until the +# rows make it to t2 on the slave. +connection slave; let $wait_condition= SELECT COUNT(*) = 19 FROM t2; --source include/wait_condition.inc +connection master; # If you want to do manual testing of the mixed mode regarding UDFs (not # testable automatically as quite platform- and compiler-dependent), From 2a089557a68107925f1f1e197db65d04b5bf377b Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 30 Jun 2008 22:11:18 +0200 Subject: [PATCH 054/352] BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars In order to handle CHAR() fields, 8 bits were reserved for the size of the CHAR field. However, instead of denoting the number of characters in the field, field_length was used which denotes the number of bytes in the field. Since UTF-8 fields can have three bytes per character (and has been extended to have four bytes per character in 6.0), an extra two bits have been encoded in the field metadata work for fields of type Field_string (i.e., CHAR fields). Since the metadata word is filled, the extra bits have been encoded in the upper 4 bits of the real type (the most significant byte of the metadata word) by computing the bitwise xor of the extra two bits. Since the upper 4 bits of the real type always is 1111 for Field_string, this means that for fields of length <256, the encoding is identical to the encoding used in pre-5.1.26 servers, but for lengths of 256 or more, an unrecognized type is formed, causing an old slave (that does not handle lengths of 256 or more) to stop. --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 149 +++++++++++++++++- .../suite/binlog/r/binlog_base64_flag.result | 26 ++- .../suite/binlog/t/binlog_base64_flag.test | 47 +++++- mysql-test/suite/bugs/combinations | 8 + mysql-test/suite/bugs/r/rpl_bug37426.result | 17 ++ mysql-test/suite/bugs/t/rpl_bug37426.test | 22 +++ .../suite/rpl/r/rpl_row_basic_2myisam.result | 65 +++++++- .../suite/rpl/r/rpl_row_basic_3innodb.result | 65 +++++++- sql/field.cc | 93 +++++++++-- sql/field.h | 20 ++- sql/rpl_utility.cc | 16 +- sql/slave.cc | 17 +- sql/slave.h | 3 +- sql/sql_insert.cc | 4 +- 14 files changed, 517 insertions(+), 35 deletions(-) create mode 100644 mysql-test/suite/bugs/combinations create mode 100644 mysql-test/suite/bugs/r/rpl_bug37426.result create mode 100644 mysql-test/suite/bugs/t/rpl_bug37426.test diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 48ddbaf244a..59f049e2bfa 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -259,7 +259,7 @@ DELETE FROM t1; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; sync_slave_with_master; set @@global.slave_exec_mode= default; -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; @@ -272,3 +272,150 @@ query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; connection master; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; sync_slave_with_master; + +# +# BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars +# + +# We have 4 combinations to test with respect to the field length +# (i.e., the number of bytes) of the CHAR fields: +# +# 1. Replicating from CHAR<256 to CHAR<256 +# 2. Replicating from CHAR<256 to CHAR>255 +# 3. Replicating from CHAR>255 to CHAR<256 +# 4. Replicating from CHAR>255 to CHAR>255 + +# We also make a special case of using the max size of a field on the +# master, i.e. CHAR(255) in UTF-8, giving another three cases. +# +# 5. Replicating UTF-8 CHAR(255) to CHAR(<256) +# 6. Replicating UTF-8 CHAR(255) to CHAR(>255) +# 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8 + +connection master; +CREATE TABLE t1 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL); + +CREATE TABLE t2 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL); + +sync_slave_with_master; +ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; + +connection master; +CREATE TABLE t3 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL); +sync_slave_with_master; +ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; + +connection master; +CREATE TABLE t4 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL); + +CREATE TABLE t5 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL); +sync_slave_with_master; +ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; + +connection master; +CREATE TABLE t6 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL); +sync_slave_with_master; +ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; + +connection master; +CREATE TABLE t7 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL); + +--echo [expecting slave to replicate correctly] +connection master; +INSERT INTO t1 VALUES (1, "", 1); +INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); + +let $diff_table_1=master:test.t1; +let $diff_table_2=slave:test.t1; +source include/diff_tables.inc; + +--echo [expecting slave to replicate correctly] +connection master; +INSERT INTO t2 VALUES (1, "", 1); +INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); + +let $diff_table_1=master:test.t2; +let $diff_table_2=slave:test.t2; +source include/diff_tables.inc; + +--echo [expecting slave to stop] +connection master; +INSERT INTO t3 VALUES (1, "", 1); +INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); + +connection slave; +source include/wait_for_slave_sql_to_stop.inc; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +source include/wait_for_slave_to_start.inc; + +--echo [expecting slave to replicate correctly] +connection master; +INSERT INTO t4 VALUES (1, "", 1); +INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); + +let $diff_table_1=master:test.t4; +let $diff_table_2=slave:test.t4; +source include/diff_tables.inc; + +--echo [expecting slave to stop] +connection master; +INSERT INTO t5 VALUES (1, "", 1); +INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); + +connection slave; +source include/wait_for_slave_sql_to_stop.inc; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +source include/wait_for_slave_to_start.inc; + +--echo [expecting slave to stop] +connection master; +INSERT INTO t6 VALUES (1, "", 1); +INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); + +connection slave; +source include/wait_for_slave_sql_to_stop.inc; +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +source include/wait_for_slave_to_start.inc; + +--echo [expecting slave to replicate correctly] +connection master; +INSERT INTO t7 VALUES (1, "", 1); +INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); + +let $diff_table_1=master:test.t7; +let $diff_table_2=slave:test.t7; +source include/diff_tables.inc; + +connection master; +drop table t1, t2, t3, t4, t5, t6, t7; +sync_slave_with_master; + diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index 72a16010031..fbc2b8344ee 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -66,4 +66,28 @@ a 1 1 3 -drop table t1; +CREATE TABLE char128_utf8 ( +i1 INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +i2 INT NOT NULL); +CREATE TABLE char63_utf8 ( +i1 INT NOT NULL, +c CHAR(63) CHARACTER SET utf8 NOT NULL, +i2 INT NOT NULL); +BINLOG ' +MuNkSA8BAAAAZgAAAGoAAAAAAAQANS4xLjI1LXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAy42RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; +BINLOG ' +3u9kSBMBAAAANgAAAJYBAAAAABAAAAAAAAAABHRlc3QAC2NoYXI2M191dGY4AAMD/gMC/r0A +3u9kSBcBAAAAKgAAAMABAAAQABAAAAAAAAEAA//4AQAAAAMxMjMBAAAA +'; +SELECT * FROM char63_utf8; +i1 c i2 +1 123 1 +BINLOG ' +iONkSBMBAAAANwAAAJkBAAAAABAAAAAAAAAABHRlc3QADGNoYXIxMjhfdXRmOAADA/4DAv6AAA== +iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== +'; +ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info +drop table t1, char63_utf8, char128_utf8; diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test index abf35a6bfd8..e6271ec6ccc 100644 --- a/mysql-test/suite/binlog/t/binlog_base64_flag.test +++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test @@ -104,6 +104,49 @@ Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA== # the above line should fail and 5 should not be in the binlog. select * from t1; +# Test that BUG#37426 is triggered. -# clean up -drop table t1; +CREATE TABLE char128_utf8 ( + i1 INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + i2 INT NOT NULL); +CREATE TABLE char63_utf8 ( + i1 INT NOT NULL, + c CHAR(63) CHARACTER SET utf8 NOT NULL, + i2 INT NOT NULL); + +# +# This is the format description log event +# + +BINLOG ' +MuNkSA8BAAAAZgAAAGoAAAAAAAQANS4xLjI1LXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAy42RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; + +# ... this event corresponding to +# +# INSERT INTO char63_utf8 VALUES ( 1, "123", 1 ) +# +# The binlog event below shall not trigger the bug check + +BINLOG ' +3u9kSBMBAAAANgAAAJYBAAAAABAAAAAAAAAABHRlc3QAC2NoYXI2M191dGY4AAMD/gMC/r0A +3u9kSBcBAAAAKgAAAMABAAAQABAAAAAAAAEAA//4AQAAAAMxMjMBAAAA +'; +SELECT * FROM char63_utf8; + +# ... and this is an event corresponding to +# +# INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ) +# +# The binlog event below shall trigger the bug check and produce an error +# + +error ER_UNKNOWN_ERROR; +BINLOG ' +iONkSBMBAAAANwAAAJkBAAAAABAAAAAAAAAABHRlc3QADGNoYXIxMjhfdXRmOAADA/4DAv6AAA== +iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== +'; + +drop table t1, char63_utf8, char128_utf8; diff --git a/mysql-test/suite/bugs/combinations b/mysql-test/suite/bugs/combinations new file mode 100644 index 00000000000..ea25611a5d4 --- /dev/null +++ b/mysql-test/suite/bugs/combinations @@ -0,0 +1,8 @@ +[row] +--binlog-format=row + +[stmt] +--binlog-format=statement + +[mix] +--binlog-format=mixed diff --git a/mysql-test/suite/bugs/r/rpl_bug37426.result b/mysql-test/suite/bugs/r/rpl_bug37426.result new file mode 100644 index 00000000000..24dfd27ca01 --- /dev/null +++ b/mysql-test/suite/bugs/r/rpl_bug37426.result @@ -0,0 +1,17 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE char128_utf8 ( +i1 INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +i2 INT NOT NULL); +INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); +SELECT * FROM char128_utf8; +i1 c i2 +1 123 1 +SELECT * FROM char128_utf8; +i1 c i2 +1 123 1 diff --git a/mysql-test/suite/bugs/t/rpl_bug37426.test b/mysql-test/suite/bugs/t/rpl_bug37426.test new file mode 100644 index 00000000000..d2bad0fa0c1 --- /dev/null +++ b/mysql-test/suite/bugs/t/rpl_bug37426.test @@ -0,0 +1,22 @@ +############################################################# +# Author: Mats Kindahl +# Date: 2008-06-18 +# Purpose: Test for BUG#37426 +# RBR breaks for CHAR() UTF8 fields > 85 chars +############################################################# + +source include/master-slave.inc; +source include/have_binlog_format_row.inc; + +connection master; +CREATE TABLE char128_utf8 ( + i1 INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + i2 INT NOT NULL); + +INSERT INTO char128_utf8 VALUES ( 1, "123", 1 ); + +SELECT * FROM char128_utf8; +sync_slave_with_master; + +SELECT * FROM char128_utf8; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index 22284a26412..3977e721212 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -437,7 +437,70 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; Last_SQL_Error -0 + SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +CREATE TABLE t1 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +CREATE TABLE t2 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t3 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t4 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +CREATE TABLE t5 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t6 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t7 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +[expecting slave to replicate correctly] +INSERT INTO t1 VALUES (1, "", 1); +INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t1 and slave:test.t1 +[expecting slave to replicate correctly] +INSERT INTO t2 VALUES (1, "", 1); +INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t2 and slave:test.t2 +[expecting slave to stop] +INSERT INTO t3 VALUES (1, "", 1); +INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t4 VALUES (1, "", 1); +INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +Comparing tables master:test.t4 and slave:test.t4 +[expecting slave to stop] +INSERT INTO t5 VALUES (1, "", 1); +INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +[expecting slave to stop] +INSERT INTO t6 VALUES (1, "", 1); +INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t7 VALUES (1, "", 1); +INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +Comparing tables master:test.t7 and slave:test.t7 +drop table t1, t2, t3, t4, t5, t6, t7; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index f7b9e5d627a..d38d09fec00 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -437,7 +437,70 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; Last_SQL_Error -0 + SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +CREATE TABLE t1 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +CREATE TABLE t2 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t3 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t4 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +CREATE TABLE t5 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t6 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t7 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL); +[expecting slave to replicate correctly] +INSERT INTO t1 VALUES (1, "", 1); +INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t1 and slave:test.t1 +[expecting slave to replicate correctly] +INSERT INTO t2 VALUES (1, "", 1); +INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t2 and slave:test.t2 +[expecting slave to stop] +INSERT INTO t3 VALUES (1, "", 1); +INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t4 VALUES (1, "", 1); +INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +Comparing tables master:test.t4 and slave:test.t4 +[expecting slave to stop] +INSERT INTO t5 VALUES (1, "", 1); +INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +[expecting slave to stop] +INSERT INTO t6 VALUES (1, "", 1); +INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t7 VALUES (1, "", 1); +INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +Comparing tables master:test.t7 and slave:test.t7 +drop table t1, t2, t3, t4, t5, t6, t7; diff --git a/sql/field.cc b/sql/field.cc index 9bf6df55b30..21e26b518e8 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -27,6 +27,8 @@ #include "mysql_priv.h" #include "sql_select.h" +#include "rpl_rli.h" // Pull in Relay_log_info +#include "slave.h" // Pull in rpl_master_has_bug() #include #include #ifdef HAVE_FCONVERT @@ -1375,7 +1377,8 @@ bool Field::send_binary(Protocol *protocol) @retval 0 if this field's size is < the source field's size @retval 1 if this field's size is >= the source field's size */ -int Field::compatible_field_size(uint field_metadata) +int Field::compatible_field_size(uint field_metadata, + const Relay_log_info *rli_arg __attribute__((unused))) { uint const source_size= pack_length_from_metadata(field_metadata); uint const destination_size= row_pack_length(); @@ -2837,7 +2840,8 @@ uint Field_new_decimal::pack_length_from_metadata(uint field_metadata) @retval 0 if this field's size is < the source field's size @retval 1 if this field's size is >= the source field's size */ -int Field_new_decimal::compatible_field_size(uint field_metadata) +int Field_new_decimal::compatible_field_size(uint field_metadata, + const Relay_log_info * __attribute__((unused))) { int compatible= 0; uint const source_precision= (field_metadata >> 8U) & 0x00ff; @@ -4037,7 +4041,6 @@ Field_real::pack(uchar *to, const uchar *from, { DBUG_ENTER("Field_real::pack"); DBUG_ASSERT(max_length >= pack_length()); - DBUG_PRINT("debug", ("pack_length(): %u", pack_length())); #ifdef WORDS_BIGENDIAN if (low_byte_first != table->s->db_low_byte_first) { @@ -4056,7 +4059,6 @@ Field_real::unpack(uchar *to, const uchar *from, uint param_data, bool low_byte_first) { DBUG_ENTER("Field_real::unpack"); - DBUG_PRINT("debug", ("pack_length(): %u", pack_length())); #ifdef WORDS_BIGENDIAN if (low_byte_first != table->s->db_low_byte_first) { @@ -6638,6 +6640,36 @@ my_decimal *Field_string::val_decimal(my_decimal *decimal_value) } +struct Check_field_param { + Field *field; +}; + +static bool +check_field_for_37426(const void *param_arg) +{ + Check_field_param *param= (Check_field_param*) param_arg; + DBUG_ASSERT(param->field->real_type() == MYSQL_TYPE_STRING); + DBUG_PRINT("debug", ("Field %s - type: %d, size: %d", + param->field->field_name, + param->field->real_type(), + param->field->row_pack_length())); + return param->field->row_pack_length() > 255; +} + + +int Field_string::compatible_field_size(uint field_metadata, + const Relay_log_info *rli_arg) +{ +#ifdef HAVE_REPLICATION + const Check_field_param check_param = { this }; + if (rpl_master_has_bug(rli_arg, 37426, TRUE, + check_field_for_37426, &check_param)) + return FALSE; // Not compatible field sizes +#endif + return Field::compatible_field_size(field_metadata, rli_arg); +} + + int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr) { uint a_len, b_len; @@ -6724,6 +6756,9 @@ uchar *Field_string::pack(uchar *to, const uchar *from, @c param_data argument contains the result of field->real_type() from the master. + @note For information about how the length is packed, see @c + Field_string::do_save_field_metadata + @param to Destination of the data @param from Source of the data @param param_data Real type (upper) and length (lower) values @@ -6736,10 +6771,24 @@ Field_string::unpack(uchar *to, uint param_data, bool low_byte_first __attribute__((unused))) { - uint from_length= - param_data ? min(param_data & 0x00ff, field_length) : field_length; - uint length; + uint from_length, length; + /* + Compute the declared length of the field on the master. This is + used to decide if one or two bytes should be read as length. + */ + if (param_data) + from_length= (((param_data >> 4) & 0x300) ^ 0x300) + (param_data & 0x00ff); + else + from_length= field_length; + + DBUG_PRINT("debug", + ("param_data: 0x%x, field_length: %u, from_length: %u", + param_data, field_length, from_length)); + /* + Compute the actual length of the data by reading one or two bits + (depending on the declared field length on the master). + */ if (from_length > 255) { length= uint2korr(from); @@ -6762,14 +6811,37 @@ Field_string::unpack(uchar *to, second byte of the field metadata array at index of *metadata_ptr and *(metadata_ptr + 1). + @note In order to be able to handle lengths exceeding 255 and be + backwards-compatible with pre-5.1.26 servers, an extra two bits of + the length has been added to the metadata in such a way that if + they are set, a new unrecognized type is generated. This will + cause pre-5.1-26 servers to stop due to a field type mismatch, + while new servers will be able to extract the extra bits. If the + length is <256, there will be no difference and both a new and an + old server will be able to handle it. + + @note The extra two bits are added to bits 13 and 14 of the + parameter data (with 1 being the least siginficant bit and 16 the + most significant bit of the word) by xoring the extra length bits + with the real type. Since all allowable types have 0xF as most + significant bits of the metadata word, lengths <256 will not affect + the real type at all, while all other values will result in a + non-existant type in the range 17-244. + + @see Field_string::unpack + @param metadata_ptr First byte of field metadata @returns number of bytes written to metadata_ptr */ int Field_string::do_save_field_metadata(uchar *metadata_ptr) { - *metadata_ptr= real_type(); - *(metadata_ptr + 1)= field_length; + DBUG_ASSERT(field_length < 1024); + DBUG_ASSERT((real_type() & 0xF0) == 0xF0); + DBUG_PRINT("debug", ("field_length: %u, real_type: %u", + field_length, real_type())); + *metadata_ptr= (real_type() ^ ((field_length & 0x300) >> 4)); + *(metadata_ptr + 1)= field_length & 0xFF; return 2; } @@ -9118,7 +9190,8 @@ uint Field_bit::pack_length_from_metadata(uint field_metadata) @retval 0 if this field's size is < the source field's size @retval 1 if this field's size is >= the source field's size */ -int Field_bit::compatible_field_size(uint field_metadata) +int Field_bit::compatible_field_size(uint field_metadata, + const Relay_log_info * __attribute__((unused))) { int compatible= 0; uint const source_size= pack_length_from_metadata(field_metadata); diff --git a/sql/field.h b/sql/field.h index 479a71dfee5..6c6cab1e4f0 100644 --- a/sql/field.h +++ b/sql/field.h @@ -30,6 +30,8 @@ const uint32 max_field_size= (uint32) 4294967295U; class Send_field; class Protocol; class Create_field; +class Relay_log_info; + struct st_cache_field; int field_conv(Field *to,Field *from); @@ -162,7 +164,8 @@ public: table, which is located on disk). */ virtual uint32 pack_length_in_rec() const { return pack_length(); } - virtual int compatible_field_size(uint field_metadata); + virtual int compatible_field_size(uint field_metadata, + const Relay_log_info *); virtual uint pack_length_from_metadata(uint field_metadata) { return field_metadata; } /* @@ -716,7 +719,8 @@ public: uint32 pack_length() const { return (uint32) bin_size; } uint pack_length_from_metadata(uint field_metadata); uint row_pack_length() { return pack_length(); } - int compatible_field_size(uint field_metadata); + int compatible_field_size(uint field_metadata, + const Relay_log_info *rli); uint is_equal(Create_field *new_field); virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data, bool low_byte_first); @@ -1425,7 +1429,14 @@ public: virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data, bool low_byte_first); uint pack_length_from_metadata(uint field_metadata) - { return (field_metadata & 0x00ff); } + { + DBUG_PRINT("debug", ("field_metadata: 0x%04x", field_metadata)); + if (field_metadata == 0) + return row_pack_length(); + return (((field_metadata >> 4) & 0x300) ^ 0x300) + (field_metadata & 0x00ff); + } + int compatible_field_size(uint field_metadata, + const Relay_log_info *rli); uint row_pack_length() { return (field_length + 1); } int pack_cmp(const uchar *a,const uchar *b,uint key_length, my_bool insert_or_update); @@ -1878,7 +1889,8 @@ public: uint pack_length_from_metadata(uint field_metadata); uint row_pack_length() { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); } - int compatible_field_size(uint field_metadata); + int compatible_field_size(uint field_metadata, + const Relay_log_info *rli); void sql_type(String &str) const; virtual uchar *pack(uchar *to, const uchar *from, uint max_length, bool low_byte_first); diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 4f4083d9b8f..e34f8561051 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -188,7 +188,8 @@ table_def::compatible_with(Relay_log_info const *rli_arg, TABLE *table) for (uint col= 0 ; col < cols_to_check ; ++col) { - if (table->field[col]->type() != type(col)) + Field *const field= table->field[col]; + if (field->type() != type(col)) { DBUG_ASSERT(col < size() && col < tsh->fields); DBUG_ASSERT(tsh->db.str && tsh->table_name.str); @@ -197,15 +198,15 @@ table_def::compatible_with(Relay_log_info const *rli_arg, TABLE *table) my_snprintf(buf, sizeof(buf), "Column %d type mismatch - " "received type %d, %s.%s has type %d", col, type(col), tsh->db.str, tsh->table_name.str, - table->field[col]->type()); + field->type()); rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF, ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf); } /* Check the slave's field size against that of the master. */ - if (!error && - !table->field[col]->compatible_field_size(field_metadata(col))) + if (!error && + !field->compatible_field_size(field_metadata(col), rli_arg)) { error= 1; char buf[256]; @@ -213,10 +214,9 @@ table_def::compatible_with(Relay_log_info const *rli_arg, TABLE *table) "master has size %d, %s.%s on slave has size %d." " Master's column size should be <= the slave's " "column size.", col, - table->field[col]->pack_length_from_metadata( - m_field_metadata[col]), - tsh->db.str, tsh->table_name.str, - table->field[col]->row_pack_length()); + field->pack_length_from_metadata(m_field_metadata[col]), + tsh->db.str, tsh->table_name.str, + field->row_pack_length()); rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF, ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf); } diff --git a/sql/slave.cc b/sql/slave.cc index a6d7758c8de..0040b69f8de 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4057,9 +4057,17 @@ end: @param rli Relay_log_info which tells the master's version @param bug_id Number of the bug as found in bugs.mysql.com @param report bool report error message, default TRUE + + @param pred Predicate function that will be called with @c param to + check for the bug. If the function return @c true, the bug is present, + otherwise, it is not. + + @param param State passed to @c pred function. + @return TRUE if master has the bug, FALSE if it does not. */ -bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report) +bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, + bool (*pred)(const void *), const void *param) { struct st_version_range_for_one_bug { uint bug_id; @@ -4072,6 +4080,7 @@ bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report) {24432, { 5, 1, 12 }, { 5, 1, 17 } }, {33029, { 5, 0, 0 }, { 5, 0, 58 } }, {33029, { 5, 1, 0 }, { 5, 1, 12 } }, + {37426, { 5, 1, 0 }, { 5, 1, 26 } }, }; const uchar *master_ver= rli->relay_log.description_event_for_exec->server_version_split; @@ -4085,11 +4094,11 @@ bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report) *fixed_in= versions_for_all_bugs[i].fixed_in; if ((versions_for_all_bugs[i].bug_id == bug_id) && (memcmp(introduced_in, master_ver, 3) <= 0) && - (memcmp(fixed_in, master_ver, 3) > 0)) + (memcmp(fixed_in, master_ver, 3) > 0) && + (pred == NULL || (*pred)(param))) { if (!report) return TRUE; - // a short message for SHOW SLAVE STATUS (message length constraints) my_printf_error(ER_UNKNOWN_ERROR, "master may suffer from" " http://bugs.mysql.com/bug.php?id=%u" @@ -4137,7 +4146,7 @@ bool rpl_master_erroneous_autoinc(THD *thd) { Relay_log_info *rli= &active_mi->rli; DBUG_EXECUTE_IF("simulate_bug33029", return TRUE;); - return rpl_master_has_bug(rli, 33029, FALSE); + return rpl_master_has_bug(rli, 33029, FALSE, NULL, NULL); } return FALSE; } diff --git a/sql/slave.h b/sql/slave.h index 80d267e5b27..dc2d668c97b 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -165,7 +165,8 @@ int fetch_master_table(THD* thd, const char* db_name, const char* table_name, bool show_master_info(THD* thd, Master_info* mi); bool show_binlog_info(THD* thd); -bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report=TRUE); +bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, + bool (*pred)(const void *), const void *param); bool rpl_master_erroneous_autoinc(THD* thd); const char *print_slave_db_safe(const char *db); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d1e5c26912d..c51c47ae431 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -695,7 +695,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, if (thd->slave_thread && (info.handle_duplicates == DUP_UPDATE) && (table->next_number_field != NULL) && - rpl_master_has_bug(&active_mi->rli, 24432)) + rpl_master_has_bug(&active_mi->rli, 24432, TRUE, NULL, NULL)) goto abort; #endif @@ -2967,7 +2967,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) if (thd->slave_thread && (info.handle_duplicates == DUP_UPDATE) && (table->next_number_field != NULL) && - rpl_master_has_bug(&active_mi->rli, 24432)) + rpl_master_has_bug(&active_mi->rli, 24432, TRUE, NULL, NULL)) DBUG_RETURN(1); #endif From dd7bc1a662ea3ef4c1381d7f1512c54ff12612d1 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Mon, 30 Jun 2008 22:16:06 +0200 Subject: [PATCH 055/352] Fix for Bug#36787 Test funcs_1.charset_collation_1 failing Details: 1. Skip charset_collation_1 if charset "ucs2_bin" is missing (property which distincts "vanilla" builds from the others) 2. Let builds with version_comment LIKE "%Advanced%" (found them for 5.1) execute charset_collation_3. 3. Update comments charset_collation.inc so that they reflect the current experiences. --- .../suite/funcs_1/datadict/charset_collation.inc | 14 +++++++++++++- .../suite/funcs_1/t/charset_collation_1.test | 6 ++++-- .../suite/funcs_1/t/charset_collation_3.test | 5 +++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/funcs_1/datadict/charset_collation.inc b/mysql-test/suite/funcs_1/datadict/charset_collation.inc index f8fc58b082b..ae03996b073 100644 --- a/mysql-test/suite/funcs_1/datadict/charset_collation.inc +++ b/mysql-test/suite/funcs_1/datadict/charset_collation.inc @@ -8,7 +8,7 @@ # # The amount and properties of character_sets/collations depend on the # build type -# 2007-12 MySQL 5.0 +# 2007-12 MySQL 5.0, 2008-06 MySQL 5.1 # --------------------------------------------------------------------- # # Variant 1 fits to @@ -33,10 +33,22 @@ # Variant 3 fits to # version_comment MySQL Community Server (GPL) # version_comment MySQL Cluster Server (Commercial) +# version_comment MySQL Advanced Server (GPL) 5.1 +# version_comment MySQL Advanced Server (Commercial) 5.1 # # Difference between variant 3 and 2 is within the collation properties # IS_COMPILED and SORTLEN. # +# 2008-06 All time excluded variant is "vanilla". +# How to build "vanilla": +# ./BUILD/autorun.sh +# ./configure +# ./make +# Some properties of "vanilla" +# version_comment Source distribution +# Compared to the variants 1 to 3 a lot of character sets are missing. +# Example: "ucs2_bin" is in variant 1 to 3 but not in "vanilla". +# # Created: # 2007-12-18 mleich - remove the unstable character_set/collation subtests # from include/datadict-master.inc diff --git a/mysql-test/suite/funcs_1/t/charset_collation_1.test b/mysql-test/suite/funcs_1/t/charset_collation_1.test index 7415220455e..15777062a72 100644 --- a/mysql-test/suite/funcs_1/t/charset_collation_1.test +++ b/mysql-test/suite/funcs_1/t/charset_collation_1.test @@ -22,9 +22,11 @@ if (`SELECT EXISTS (SELECT 1 FROM information_schema.collations OR ( @@version_comment NOT LIKE '%Source%' AND @@version_comment NOT LIKE '%Enterprise%' AND @@version_comment NOT LIKE '%Classic%' - AND @@version_comment NOT LIKE '%Pushbuild%')`) + AND @@version_comment NOT LIKE '%Pushbuild%') + OR (SELECT count(*) = 0 FROM information_schema.collations + WHERE collation_name = 'ucs2_bin')`) { - skip Test needs Enterprise, Classic , Pushbuild or Source-without-max build; + skip Test needs Enterprise, Classic , regular Pushbuild or Source-without-max build; } --source suite/funcs_1/datadict/charset_collation.inc diff --git a/mysql-test/suite/funcs_1/t/charset_collation_3.test b/mysql-test/suite/funcs_1/t/charset_collation_3.test index 0701b96896f..e88b44e4a0f 100644 --- a/mysql-test/suite/funcs_1/t/charset_collation_3.test +++ b/mysql-test/suite/funcs_1/t/charset_collation_3.test @@ -16,9 +16,10 @@ # if (`SELECT @@version_comment NOT LIKE '%Community%' - AND @@version_comment NOT LIKE '%Cluster%'`) + AND @@version_comment NOT LIKE '%Cluster%' + AND @@version_comment NOT LIKE '%Advanced%'`) { - skip Test needs Community or Cluster build; + skip Test needs Community, Cluster or Advanced build; } --source suite/funcs_1/datadict/charset_collation.inc From 09d543ea3ab581fa4d8c9ea05977a309ee92f9c6 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 30 Jun 2008 22:52:26 +0200 Subject: [PATCH 056/352] Version 5.1.26 is labeled "rc". --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1ef636ffa3c..af23b6035eb 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.26) +AM_INIT_AUTOMAKE(mysql, 5.1.26-rc) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 846494a48e303c9e6157068ada1af7559fed8862 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 1 Jul 2008 20:38:15 +0200 Subject: [PATCH 057/352] Bug#36732: many disabled ndb tests in test suite parts REORGANIZE TEST parts WHERE ENGINE='NDB' ;) Updated tests for better matching NDB's limitations. Removed some duplicate tests. --- .../inc/part_supported_sql_funcs_delete.inc | 3 + .../suite/parts/inc/partition_alter_11.inc | 30 +- .../suite/parts/inc/partition_bigint.inc | 11 +- mysql-test/suite/parts/inc/partition_int.inc | 10 +- .../suite/parts/inc/partition_mediumint.inc | 8 +- .../suite/parts/inc/partition_smallint.inc | 8 +- .../inc/partition_supported_sql_funcs.inc | 177 +- .../suite/parts/inc/partition_tinyint.inc | 8 +- .../suite/parts/r/ndb_blob_partition.result | 104 - .../suite/parts/r/ndb_dd_backuprestore.result | 84 +- .../suite/parts/r/ndb_partition_error.result | 47 - .../suite/parts/r/ndb_partition_key.result | 206 - .../suite/parts/r/ndb_partition_list.result | 51 - .../suite/parts/r/ndb_partition_range.result | 263 - .../r/part_supported_sql_func_ndb.result | 7269 ++++------------- .../parts/r/partition_alter1_1_innodb.result | 24 +- .../parts/r/partition_alter1_1_myisam.result | 12 +- .../parts/r/partition_alter1_2_innodb.result | 12 +- .../parts/r/partition_alter1_2_myisam.result | 4 +- .../parts/r/partition_alter2_innodb.result | 80 +- .../parts/r/partition_alter2_myisam.result | 48 +- .../suite/parts/r/partition_engine_ndb.result | 1451 +--- .../suite/parts/r/partition_int_innodb.result | 96 +- .../suite/parts/r/partition_int_myisam.result | 96 +- .../suite/parts/r/partition_int_ndb.result | 222 +- .../parts/r/rpl_ndb_dd_partitions.result | 726 -- mysql-test/suite/parts/t/disabled.def | 23 +- .../suite/parts/t/ndb_blob_partition.test | 93 - .../suite/parts/t/ndb_dd_backuprestore.test | 4 + .../suite/parts/t/ndb_partition_error.test | 71 - .../suite/parts/t/ndb_partition_key.test | 208 - .../suite/parts/t/ndb_partition_list.test | 64 - .../suite/parts/t/ndb_partition_range.test | 260 - .../parts/t/part_supported_sql_func_ndb.test | 10 +- .../parts/t/partition_alter1_1_2_ndb.test | 1 + .../suite/parts/t/partition_alter1_1_ndb.test | 1 + .../suite/parts/t/partition_alter1_2_ndb.test | 1 + .../suite/parts/t/partition_alter2_ndb.test | 5 + .../suite/parts/t/partition_basic_ndb.test | 5 + .../suite/parts/t/partition_bit_ndb.test | 9 +- .../suite/parts/t/partition_engine_ndb.test | 5 + .../suite/parts/t/partition_int_ndb.test | 11 +- .../suite/parts/t/partition_syntax_ndb.test | 5 + .../suite/parts/t/partition_value_ndb.test | 5 + .../suite/parts/t/rpl_ndb_dd_partitions.test | 310 - 45 files changed, 2299 insertions(+), 9842 deletions(-) delete mode 100644 mysql-test/suite/parts/r/ndb_blob_partition.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_error.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_key.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_list.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_range.result delete mode 100644 mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result delete mode 100644 mysql-test/suite/parts/t/ndb_blob_partition.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_error.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_key.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_list.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_range.test delete mode 100644 mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc index 3a486619b0b..49d0b6fc69f 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc @@ -43,6 +43,8 @@ eval select * from $t4 order by colint; eval select * from $t5 order by colint; eval select * from $t6 order by colint; +if (!$drop_partition_not_supported) +{ eval alter table $t1 drop partition p0; eval alter table $t2 drop partition p0; eval alter table $t4 drop partition p0; @@ -55,3 +57,4 @@ eval select * from $t3 order by col1; eval select * from $t4 order by colint; eval select * from $t5 order by colint; eval select * from $t6 order by colint; +} diff --git a/mysql-test/suite/parts/inc/partition_alter_11.inc b/mysql-test/suite/parts/inc/partition_alter_11.inc index c7dd2d1d15f..9d9800e3a1c 100644 --- a/mysql-test/suite/parts/inc/partition_alter_11.inc +++ b/mysql-test/suite/parts/inc/partition_alter_11.inc @@ -92,16 +92,13 @@ $partitioning; #----------- PARTITION BY RANGE if ($with_partitioning) { ---disable_query_log -eval SET @aux = 'PARTITION BY RANGE(f_int1) +let $partitioning= PARTITION BY RANGE(f_int1) (PARTITION parta VALUES LESS THAN (0), PARTITION partb VALUES LESS THAN ($max_row_div4), PARTITION partc VALUES LESS THAN ($max_row_div2), PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4), PARTITION parte VALUES LESS THAN ($max_row), -PARTITION partf VALUES LESS THAN $MAX_VALUE)'; -let $partitioning= `SELECT @aux`; ---enable_query_log +PARTITION partf VALUES LESS THAN $MAX_VALUE); } eval CREATE TABLE t1 ( $column_list @@ -113,15 +110,11 @@ $partitioning; #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH if ($with_partitioning) { ---disable_query_log -eval SET @aux = -'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +let $partitioning= PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0), PARTITION partb VALUES LESS THAN ($max_row_div4), PARTITION partc VALUES LESS THAN ($max_row_div2), -PARTITION partd VALUES LESS THAN $MAX_VALUE)'; -let $partitioning= `SELECT @aux`; ---enable_query_log +PARTITION partd VALUES LESS THAN $MAX_VALUE); } eval CREATE TABLE t1 ( $column_list @@ -133,8 +126,7 @@ $partitioning; #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY if ($with_partitioning) { ---disable_query_log -eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11, SUBPARTITION subpart12), PARTITION part2 VALUES LESS THAN ($max_row_div4) @@ -142,9 +134,7 @@ PARTITION part2 VALUES LESS THAN ($max_row_div4) PARTITION part3 VALUES LESS THAN ($max_row_div2) (SUBPARTITION subpart31, SUBPARTITION subpart32), PARTITION part4 VALUES LESS THAN $MAX_VALUE -(SUBPARTITION subpart41, SUBPARTITION subpart42))'; -let $partitioning= `SELECT @aux`; ---enable_query_log +(SUBPARTITION subpart41, SUBPARTITION subpart42)); } eval CREATE TABLE t1 ( $column_list @@ -176,15 +166,11 @@ $partitioning; #----------- PARTITION BY LIST -- SUBPARTITION BY KEY if ($with_partitioning) { ---disable_query_log -eval SET @aux = -'PARTITION BY LIST(ABS(MOD(f_int1,2))) +let $partitioning= PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no (PARTITION part1 VALUES IN (0), PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL))'; -let $partitioning= `SELECT @aux`; ---enable_query_log + PARTITION part3 VALUES IN (NULL)); } eval CREATE TABLE t1 ( $column_list diff --git a/mysql-test/suite/parts/inc/partition_bigint.inc b/mysql-test/suite/parts/inc/partition_bigint.inc index d3cd55096e7..307387ccce1 100644 --- a/mysql-test/suite/parts/inc/partition_bigint.inc +++ b/mysql-test/suite/parts/inc/partition_bigint.inc @@ -6,22 +6,27 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); +--sorted_result select * from t1; select * from t1 where a=-2; delete from t1 where a=-2; +--sorted_result select * from t1; select * from t1 where a=18446744073709551615; delete from t1 where a=18446744073709551615; +--sorted_result select * from t1; drop table t1; eval create table t2 (a bigint unsigned not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); +--sorted_result select * from t2; select * from t2 where a=18446744073709551615; delete from t2 where a=18446744073709551615; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -37,11 +42,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a bigint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=9223372036854775806; delete from t3 where a=9223372036854775806; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_int.inc b/mysql-test/suite/parts/inc/partition_int.inc index bd9da689187..02de94e5172 100644 --- a/mysql-test/suite/parts/inc/partition_int.inc +++ b/mysql-test/suite/parts/inc/partition_int.inc @@ -6,19 +6,23 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); +--sorted_result select * from t1; select * from t1 where a=4294967293; delete from t1 where a=4294967293; +--sorted_result select * from t1; drop table t1; eval create table t2 (a int unsigned not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); +--sorted_result select * from t2; select * from t2 where a=4294967293; delete from t2 where a=4294967293; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a int not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=2147483645; delete from t3 where a=2147483645; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_mediumint.inc b/mysql-test/suite/parts/inc/partition_mediumint.inc index 10ed96e52b0..5d141bf05a4 100644 --- a/mysql-test/suite/parts/inc/partition_mediumint.inc +++ b/mysql-test/suite/parts/inc/partition_mediumint.inc @@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); +--sorted_result select * from t1; select * from t1 where a=16777213; delete from t1 where a=16777213; +--sorted_result select * from t1; drop table t1; @@ -16,9 +18,11 @@ eval create table t2 (a mediumint unsigned not null, primary key(a)) engine=$eng partition by key (a) partitions 8; show create table t2; insert into t2 values (16777215), (16777214), (16777213), (16777212); +--sorted_result select * from t2; select * from t2 where a=16777213; delete from t2 where a=16777213; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a mediumint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=8388605; delete from t3 where a=8388605; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_smallint.inc b/mysql-test/suite/parts/inc/partition_smallint.inc index 8e5e93f079b..f1a70c337c2 100644 --- a/mysql-test/suite/parts/inc/partition_smallint.inc +++ b/mysql-test/suite/parts/inc/partition_smallint.inc @@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); +--sorted_result select * from t1; select * from t1 where a=65533; delete from t1 where a=65533; +--sorted_result select * from t1; drop table t1; @@ -16,9 +18,11 @@ eval create table t2 (a smallint unsigned not null, primary key(a)) engine=$engi partition by key (a) partitions 8; show create table t2; insert into t2 values (65535), (65534), (65533), (65532); +--sorted_result select * from t2; select * from t2 where a=65533; delete from t2 where a=65533; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a smallint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=32765; delete from t3 where a=32765; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc index d9c1f5836f0..6e7b15c606b 100644 --- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc +++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc @@ -1,5 +1,6 @@ ################################################################################ -# t/partition_supported_sql_funcs.inc # # # +# t/partition_supported_sql_funcs.inc # +# # # Purpose: # # Tests frame for allowed sql functions # # # @@ -7,9 +8,10 @@ #------------------------------------------------------------------------------# # Original Author: HH # # Original Date: 2006-11-22 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: MattiasJ # +# Change Date: 2008-05-15 # +# Change: Added $max_8_partitions since ndb only capable of 8 partitions # +# and $no_reorg_partition since ndb does not support that # ################################################################################ --echo ------------------------------------------------------------------------- --echo --- $sqlfunc in partition with coltype $coltype @@ -25,16 +27,11 @@ drop table if exists t6 ; --enable_warnings --enable_abort_on_error ---echo ------------------------------------------------------------------------- ---echo --- Create tables with $sqlfunc ---echo ------------------------------------------------------------------------- -eval create table t1 (col1 $coltype) engine=$engine -partition by range($sqlfunc) +let $part_t1= partition by range($sqlfunc) (partition p0 values less than (15), partition p1 values less than maxvalue); -eval create table t2 (col1 $coltype) engine=$engine -partition by list($sqlfunc) +let $part_t2= partition by list($sqlfunc) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -43,17 +40,14 @@ partition by list($sqlfunc) partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); -eval create table t3 (col1 $coltype) engine=$engine -partition by hash($sqlfunc); +let $part_t3= partition by hash($sqlfunc); -eval create table t4 (colint int, col1 $coltype) engine=$engine -partition by range(colint) +let $part_t4= partition by range(colint) subpartition by hash($sqlfunc) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); -eval create table t5 (colint int, col1 $coltype) engine=$engine -partition by list(colint) +let $part_t5= partition by list(colint) subpartition by hash($sqlfunc) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), @@ -62,12 +56,59 @@ subpartition by hash($sqlfunc) subpartitions 2 partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); +if ($max_8_partitions) +{ +let $part_t5= partition by list(colint) +subpartition by hash($sqlfunc) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), + partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), + partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), + partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +} -eval create table t6 (colint int, col1 $coltype) engine=$engine -partition by range(colint) +let $part_t6= partition by range(colint) (partition p0 values less than ($valsqlfunc), partition p1 values less than maxvalue); +let $part_t55_altered= partition by list(colint) +subpartition by hash($sqlfunc) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), + partition p1 values in (11,12,13,14,15,16,17,18,19,20), + partition p2 values in (21,22,23,24,25,26,27,28,29,30), + partition p3 values in (31,32,33,34,35,36,37,38,39,40), + partition p4 values in (41,42,43,44,45,46,47,48,49,50), + partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +if ($max_8_partitions) +{ +let $part_t55_altered= partition by list(colint) +subpartition by hash($sqlfunc) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), + partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +} +--echo ------------------------------------------------------------------------- +--echo --- Create tables with $sqlfunc +--echo ------------------------------------------------------------------------- +eval create table t1 (col1 $coltype) engine=$engine +$part_t1; + +eval create table t2 (col1 $coltype) engine=$engine +$part_t2; + +eval create table t3 (col1 $coltype) engine=$engine +$part_t3; + +eval create table t4 (colint int, col1 $coltype) engine=$engine +$part_t4; + +eval create table t5 (colint int, col1 $coltype) engine=$engine +$part_t5; + +eval create table t6 (colint int, col1 $coltype) engine=$engine +$part_t6; + --echo ------------------------------------------------------------------------- --echo --- Access tables with $sqlfunc --echo ------------------------------------------------------------------------- @@ -135,39 +176,17 @@ eval create table t44 engine=$engine as select * from t4; eval create table t55 engine=$engine as select * from t5; eval create table t66 engine=$engine as select * from t6; eval alter table t11 -partition by range($sqlfunc) -(partition p0 values less than (15), - partition p1 values less than maxvalue); +$part_t1; eval alter table t22 -partition by list($sqlfunc) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), - partition p1 values in (11,12,13,14,15,16,17,18,19,20), - partition p2 values in (21,22,23,24,25,26,27,28,29,30), - partition p3 values in (31,32,33,34,35,36,37,38,39,40), - partition p4 values in (41,42,43,44,45,46,47,48,49,50), - partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); +$part_t2; eval alter table t33 -partition by hash($sqlfunc); +$part_t3; eval alter table t44 -partition by range(colint) -subpartition by hash($sqlfunc) subpartitions 2 -(partition p0 values less than (15), - partition p1 values less than maxvalue); +$part_t4; eval alter table t55 -partition by list(colint) -subpartition by hash($sqlfunc) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), - partition p1 values in (11,12,13,14,15,16,17,18,19,20), - partition p2 values in (21,22,23,24,25,26,27,28,29,30), - partition p3 values in (31,32,33,34,35,36,37,38,39,40), - partition p4 values in (41,42,43,44,45,46,47,48,49,50), - partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); +$part_t5; eval alter table t66 -partition by range(colint) -(partition p0 values less than ($valsqlfunc), - partition p1 values less than maxvalue); +$part_t6; select * from t11 order by col1; select * from t22 order by col1; @@ -181,51 +200,49 @@ if ($do_long_tests) --echo --------------------------- --echo ---- some alter table begin --echo --------------------------- - eval alter table t11 - reorganize partition p0,p1 into - (partition s1 values less than maxvalue); - select * from t11 order by col1; + if (!$no_reorg_partition) + { + eval alter table t11 + reorganize partition p0,p1 into + (partition s1 values less than maxvalue); + select * from t11 order by col1; - eval alter table t11 - reorganize partition s1 into - (partition p0 values less than (15), - partition p1 values less than maxvalue); - select * from t11 order by col1; + eval alter table t11 + reorganize partition s1 into + (partition p0 values less than (15), + partition p1 values less than maxvalue); + select * from t11 order by col1; + } eval alter table t55 -partition by list(colint) -subpartition by hash($sqlfunc) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), - partition p1 values in (11,12,13,14,15,16,17,18,19,20), - partition p2 values in (21,22,23,24,25,26,27,28,29,30), - partition p3 values in (31,32,33,34,35,36,37,38,39,40), - partition p4 values in (41,42,43,44,45,46,47,48,49,50), - partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); +$part_t55_altered; show create table t55; select * from t55 order by colint; - eval alter table t66 - reorganize partition p0,p1 into - (partition s1 values less than maxvalue); - select * from t66 order by colint; - - eval alter table t66 - reorganize partition s1 into - (partition p0 values less than ($valsqlfunc), - partition p1 values less than maxvalue); - select * from t66 order by colint; - - eval alter table t66 + if (!$no_reorg_partition) + { + eval alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t66 order by colint; - eval alter table t66 + eval alter table t66 reorganize partition s1 into - (partition p0 values less than ($valsqlfunc), - partition p1 values less than maxvalue); + (partition p0 values less than ($valsqlfunc), + partition p1 values less than maxvalue); select * from t66 order by colint; + + eval alter table t66 + reorganize partition p0,p1 into + (partition s1 values less than maxvalue); + select * from t66 order by colint; + + eval alter table t66 + reorganize partition s1 into + (partition p0 values less than ($valsqlfunc), + partition p1 values less than maxvalue); + select * from t66 order by colint; + } let $t1=t1; let $t2=t2; diff --git a/mysql-test/suite/parts/inc/partition_tinyint.inc b/mysql-test/suite/parts/inc/partition_tinyint.inc index 00568eec244..9954a00e819 100644 --- a/mysql-test/suite/parts/inc/partition_tinyint.inc +++ b/mysql-test/suite/parts/inc/partition_tinyint.inc @@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (255), (254), (253), (252), (1), (2), (128); +--sorted_result select * from t1; select * from t1 where a=253; delete from t1 where a=253; +--sorted_result select * from t1; drop table t1; @@ -16,9 +18,11 @@ eval create table t2 (a tinyint unsigned not null, primary key(a)) engine=$engin partition by key (a) partitions 8; show create table t2; insert into t2 values (255), (254), (253), (252); +--sorted_result select * from t2; select * from t2 where a=253; delete from t2 where a=253; +--sorted_result select * from t2; delete from t2; let $count=255; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a tinyint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=125; delete from t3 where a=125; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/r/ndb_blob_partition.result b/mysql-test/suite/parts/r/ndb_blob_partition.result deleted file mode 100644 index b08a91f0cdd..00000000000 --- a/mysql-test/suite/parts/r/ndb_blob_partition.result +++ /dev/null @@ -1,104 +0,0 @@ -drop table if exists t1; -create table t1 ( -a mediumint not null, -b text not null, -c int not null, -d longblob, -primary key using hash (a,c), -unique key (c) -) -engine=ndb -partition by range (c) -partitions 3 -( partition p1 values less than (200), -partition p2 values less than (300), -partition p3 values less than (400)); -insert into t1 values (1, @v1, 101, @v2); -insert into t1 values (1, @v2, 102, @v3); -insert into t1 values (1, @v3, 103, @v4); -insert into t1 values (2, @v4, 201, @v5); -insert into t1 values (2, @v5, 202, @v6); -insert into t1 values (2, @v6, 203, @v7); -insert into t1 values (3, @v7, 301, @v8); -insert into t1 values (3, @v8, 302, @v9); -insert into t1 values (3, @v9, 303, @v1); -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 10d3c783026b310218d10b7188da96a2401648c6 102 a33549d9844092289a58ac348dd59f09fc28406a -1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e -2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5 -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 acbaba01bc2e682f015f40e79d9cbe475db3002e 302 9ee30d99162574f79c66ae95cdf132dcf9cbc259 -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4 -select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201; -a sha1(b) c sha1(d) -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301; -a sha1(b) c sha1(d) -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -update t1 set b = @v3, d = @v4 where a = 1 and c = 102; -update t1 set b = @v6, d = @v7 where a = 2 and c = 202; -update t1 set b = @v9, d = @v1 where a = 3 and c = 302; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5 -2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5 -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4 -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4 -update t1 set b = @v4, d = @v5 where c = 103; -update t1 set b = @v7, d = @v8 where c = 203; -update t1 set b = @v1, d = @v2 where c = 303; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -1 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 103 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5 -2 1e0070bec426871a46291de27b9bd6e4255ab4e5 203 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4 -3 1d42dd9090cf78314a06665d4ea938c35cc760f4 303 10d3c783026b310218d10b7188da96a2401648c6 -update t1 set b = @v5, d = @v6; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 101 090565c580809efed3d369481a4bbb168b20713e -1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 102 090565c580809efed3d369481a4bbb168b20713e -1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 103 090565c580809efed3d369481a4bbb168b20713e -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 201 090565c580809efed3d369481a4bbb168b20713e -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 203 090565c580809efed3d369481a4bbb168b20713e -3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 301 090565c580809efed3d369481a4bbb168b20713e -3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 302 090565c580809efed3d369481a4bbb168b20713e -3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 303 090565c580809efed3d369481a4bbb168b20713e -update t1 set b = @v1, d = @v2 where 100 < c and c < 200; -update t1 set b = @v4, d = @v5 where 200 < c and c < 300; -update t1 set b = @v7, d = @v8 where 300 < c and c < 400; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 102 10d3c783026b310218d10b7188da96a2401648c6 -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 103 10d3c783026b310218d10b7188da96a2401648c6 -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 202 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 203 70fc9a7d08beebc522258bfb02000a30c77a8f1d -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 302 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 303 acbaba01bc2e682f015f40e79d9cbe475db3002e -delete from t1 where a = 1 and c = 101; -delete from t1 where c = 102; -delete from t1; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -drop table t1; diff --git a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result index e7568e4ce49..c82fe560121 100644 --- a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result +++ b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result @@ -175,7 +175,7 @@ t1 CREATE TABLE `t1` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4 +) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ SHOW CREATE TABLE test.t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -184,7 +184,7 @@ t2 CREATE TABLE `t2` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t3; Table Create Table t3 CREATE TABLE `t3` ( @@ -193,7 +193,7 @@ t3 CREATE TABLE `t3` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t4; Table Create Table t4 CREATE TABLE `t4` ( @@ -202,7 +202,7 @@ t4 CREATE TABLE `t4` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2 +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ SHOW CREATE TABLE test.t5; Table Create Table t5 CREATE TABLE `t5` ( @@ -211,7 +211,7 @@ t5 CREATE TABLE `t5` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t6; Table Create Table t6 CREATE TABLE `t6` ( @@ -220,34 +220,34 @@ t6 CREATE TABLE `t6` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SELECT * FROM information_schema.partitions WHERE table_name= 't1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 SELECT * FROM information_schema.partitions WHERE table_name= 't2'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't3'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't4'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't5'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't6'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT COUNT(*) FROM test.t1; COUNT(*) 250 @@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4 +) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ SHOW CREATE TABLE test.t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -350,7 +350,7 @@ t2 CREATE TABLE `t2` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t3; Table Create Table t3 CREATE TABLE `t3` ( @@ -359,7 +359,7 @@ t3 CREATE TABLE `t3` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t4; Table Create Table t4 CREATE TABLE `t4` ( @@ -368,7 +368,7 @@ t4 CREATE TABLE `t4` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2 +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ SHOW CREATE TABLE test.t5; Table Create Table t5 CREATE TABLE `t5` ( @@ -377,7 +377,7 @@ t5 CREATE TABLE `t5` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t6; Table Create Table t6 CREATE TABLE `t6` ( @@ -386,34 +386,34 @@ t6 CREATE TABLE `t6` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SELECT * FROM information_schema.partitions WHERE table_name= 't1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 SELECT * FROM information_schema.partitions WHERE table_name= 't2'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't3'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't4'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't5'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't6'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT COUNT(*) FROM test.t1; COUNT(*) 250 diff --git a/mysql-test/suite/parts/r/ndb_partition_error.result b/mysql-test/suite/parts/r/ndb_partition_error.result deleted file mode 100644 index d86dc382185..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_error.result +++ /dev/null @@ -1,47 +0,0 @@ -drop table if exists t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5) nodegroup 12, -partition x2 values less than (10) nodegroup 13, -partition x3 values less than (20) nodegroup 14); -ERROR HY000: Can't create table 'test.t1' (errno: 140) -show warnings; -Level Code Message -Error 1296 Got error 771 'Given NODEGROUP doesn't exist in this cluster' from NDB -Error 1005 Can't create table 'test.t1' (errno: 140) -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), -partition x2 values less than (10), -partition x3 values less than (20)); -drop table t1; -CREATE TABLE t1 (id INT) ENGINE=NDB -PARTITION BY LIST(id) -(PARTITION p0 VALUES IN (2, 4), -PARTITION p1 VALUES IN (42, 142)); -INSERT INTO t1 VALUES (2); -UPDATE t1 SET id=5 WHERE id=2; -ERROR HY000: Table has no partition for value 5 -DROP TABLE t1; -create table t1 (a int,b int, c int) -engine = ndb -partition by list(a) -partitions 2 -(partition x123 values in (11, 12), -partition x234 values in (5, 1)); -insert into t1 values (NULL,1,1); -ERROR HY000: Table has no partition for value NULL -drop table t1; diff --git a/mysql-test/suite/parts/r/ndb_partition_key.result b/mysql-test/suite/parts/r/ndb_partition_key.result deleted file mode 100644 index 00565a3979d..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_key.result +++ /dev/null @@ -1,206 +0,0 @@ -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c)) -ENGINE = NDB -PARTITION BY KEY (a,b); -insert into t1 values (1,1,1,1); -select * from t1; -a b c d -1 1 1 1 -update t1 set d = 2 where a = 1 and b = 1 and c = 1; -select * from t1; -a b c d -1 1 1 2 -delete from t1; -select * from t1; -a b c d -drop table t1; -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b)) -ENGINE = NDB -PARTITION BY KEY (c); -ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function -CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b)) -ENGINE = NDB -PARTITION BY KEY (a); -insert into t1 values -(1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3), -(1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3); -select * from t1 order by b; -a b c -1 1 3 -1 2 3 -1 3 3 -1 4 3 -1 5 3 -1 6 3 -1 7 3 -1 8 3 -1 9 3 -1 10 3 -1 11 3 -1 12 3 -DROP TABLE t1; -CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT, -PRIMARY KEY (a,b,c) USING HASH) -ENGINE=NDB -DEFAULT CHARSET=latin1 -PARTITION BY KEY (b); -insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1); --- t1 -- - -Fragment type: 5 -K Value: 6 -Min load factor: 78 -Max load factor: 80 -Temporary table: no -Number of attributes: 4 -Number of primary keys: 3 -Length of frm data: # -Row Checksum: 1 -Row GCI: 1 -SingleUserMode: 0 -ForceVarPart: 1 -TableStatus: Retrieved --- Attributes -- -a Int PRIMARY KEY AT=FIXED ST=MEMORY -b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY -c Int PRIMARY KEY AT=FIXED ST=MEMORY -d Int NULL AT=FIXED ST=MEMORY - --- Indexes -- -PRIMARY KEY(a, b, c) - UniqueHashIndex - - -NDBT_ProgramExit: 0 - OK - -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL DEFAULT '0', - `b` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `c` int(11) NOT NULL DEFAULT '0', - `d` int(11) DEFAULT NULL, - PRIMARY KEY (`a`,`b`,`c`) USING HASH -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b) */ -DROP TABLE t1; -CREATE TABLE t1 (a int not null primary key) -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); -drop table t1; -CREATE TABLE t1 (a int not null primary key); -ALTER TABLE t1 -ENGINE = NDB -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); -drop table t1; -CREATE TABLE t1 (a int not null primary key) ENGINE = NDB; -ALTER TABLE t1 -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); -drop table t1; -create table t1 (a int) -engine=ndb -partition by key(a) -(partition p0, partition p1); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 engine=heap; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */ -alter table t1 engine=ndb; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 engine=heap remove partitioning; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 -alter table t1 engine=ndb -partition by key(a) -(partition p0, partition p1 engine = ndb); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 -partition by key (a) -(partition p0 engine=ndb, partition p1 engine=ndb); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 remove partitioning; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 -alter table t1 -partition by key(a) -(partition p0 engine=ndb, partition p1); -alter table t1 -engine=ndb -partition by key(a) -(partition p0 engine=ndb, partition p1 engine = ndb); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -drop table t1; -CREATE TABLE t1 ( -c1 MEDIUMINT NOT NULL AUTO_INCREMENT, -c2 TEXT NOT NULL, -c3 INT NOT NULL, -c4 BIT NOT NULL, -c5 FLOAT, -c6 VARCHAR(255), -c7 TIMESTAMP, -PRIMARY KEY(c1,c3)) -ENGINE=NDB -PARTITION BY KEY(c3) PARTITIONS 5; -ALTER TABLE t1 COALESCE PARTITION 4; -DROP TABLE t1; -CREATE TABLE t1 (a int primary key) -ENGINE=NDB -PARTITION BY KEY(a); -ALTER TABLE t1 OPTIMIZE PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 CHECK PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 REPAIR PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 ANALYZE PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 REBUILD PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -DROP TABLE t1; -CREATE TABLE t1 ( -c1 MEDIUMINT NOT NULL AUTO_INCREMENT, -c2 TEXT NOT NULL, -c3 INT NOT NULL, -PRIMARY KEY(c1,c3)) -ENGINE=NDB -PARTITION BY KEY(c3) PARTITIONS 5; -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; -CREATE TABLE t1 ( -c1 MEDIUMINT NOT NULL AUTO_INCREMENT, -c2 TEXT NOT NULL, -c3 INT NOT NULL, -PRIMARY KEY(c1,c3)) -ENGINE=NDB -PARTITION BY KEY(c3); -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; diff --git a/mysql-test/suite/parts/r/ndb_partition_list.result b/mysql-test/suite/parts/r/ndb_partition_list.result deleted file mode 100644 index ce2574ddcc4..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_list.result +++ /dev/null @@ -1,51 +0,0 @@ -drop table if exists t1; -CREATE TABLE t1 ( f_int1 INTEGER NOT NULL, f_int2 INTEGER NOT NULL, -f_char1 CHAR(10), -f_char2 CHAR(10), f_charbig VARCHAR(1000), -PRIMARY KEY (f_int1,f_int2)) -ENGINE = NDB -PARTITION BY LIST(MOD(f_int1 + f_int2,4)) -(PARTITION part_3 VALUES IN (-3), -PARTITION part_2 VALUES IN (-2), -PARTITION part_1 VALUES IN (-1), -PARTITION part0 VALUES IN (0), -PARTITION part1 VALUES IN (1), -PARTITION part2 VALUES IN (2), -PARTITION part3 VALUES IN (3,4,5)); -INSERT INTO t1 SET f_int1 = -2, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 3, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 4, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 5, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -SELECT * FROM t1 ORDER BY f_int1; -f_int1 f_int2 f_char1 f_char2 f_charbig --2 20 20 20 ===20=== -1 1 1 1 ===1=== -2 1 1 1 ===1=== -3 1 1 1 ===1=== -4 1 1 1 ===1=== -5 1 1 1 ===1=== -20 1 1 1 ===1=== -DROP TABLE t1; -CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(10), -f_char2 CHAR(10), f_charbig VARCHAR(1000)) -ENGINE = NDB -PARTITION BY LIST(f_int1) -(PARTITION part_1 VALUES IN (-1), -PARTITION part0 VALUES IN (0,1), -PARTITION part1 VALUES IN (2)); -INSERT INTO t1 SET f_int1 = -1, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 0, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -ERROR HY000: Table has no partition for value 20 -SELECT * FROM t1 ORDER BY f_int1; -f_int1 f_int2 f_char1 f_char2 f_charbig --1 20 20 20 ===20=== -0 20 20 20 ===20=== -1 1 1 1 ===1=== -2 1 1 1 ===1=== -DROP TABLE t1; diff --git a/mysql-test/suite/parts/r/ndb_partition_range.result b/mysql-test/suite/parts/r/ndb_partition_range.result deleted file mode 100644 index cb79f04873e..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_range.result +++ /dev/null @@ -1,263 +0,0 @@ -drop table if exists t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), -partition x2 values less than (10), -partition x3 values less than (20)); -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (6, 1, 1); -INSERT into t1 values (10, 1, 1); -INSERT into t1 values (15, 1, 1); -select * from information_schema.partitions where table_name= 't1'; -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t1 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 0 0 # # NULL NULL default 0 default -NULL test t1 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 0 0 # # NULL NULL default 0 default -NULL test t1 x3 NULL 3 NULL RANGE NULL a NULL 20 0 0 0 # 0 0 # # NULL NULL default 0 default -select * from t1 order by a; -a b c -1 1 1 -6 1 1 -10 1 1 -15 1 1 -select * from t1 where a=1 order by a; -a b c -1 1 1 -select * from t1 where a=15 and b=1 order by a; -a b c -15 1 1 -select * from t1 where a=21 and b=1 order by a; -a b c -select * from t1 where a=21 order by a; -a b c -select * from t1 where a in (1,6,10,21) order by a; -a b c -1 1 1 -6 1 1 -10 1 1 -select * from t1 where b=1 and a in (1,6,10,21) order by a; -a b c -1 1 1 -6 1 1 -10 1 1 -drop table t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(b), -unique (a)) -engine = ndb -partition by range (b) -partitions 3 -(partition x1 values less than (5), -partition x2 values less than (10), -partition x3 values less than (20)); -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (2, 6, 1); -INSERT into t1 values (3, 10, 1); -INSERT into t1 values (4, 15, 1); -select * from t1 order by a; -a b c -1 1 1 -2 6 1 -3 10 1 -4 15 1 -UPDATE t1 set a = 5 WHERE b = 15; -select * from t1 order by a; -a b c -1 1 1 -2 6 1 -3 10 1 -5 15 1 -UPDATE t1 set a = 6 WHERE a = 5; -select * from t1 order by a; -a b c -1 1 1 -2 6 1 -3 10 1 -6 15 1 -select * from t1 where b=1 order by b; -a b c -1 1 1 -select * from t1 where b=15 and a=1 order by b; -a b c -select * from t1 where b=21 and a=1 order by b; -a b c -select * from t1 where b=21 order by b; -a b c -select * from t1 where b in (1,6,10,21) order by b; -a b c -1 1 1 -2 6 1 -3 10 1 -select * from t1 where a in (1,2,5,6) order by b; -a b c -1 1 1 -2 6 1 -6 15 1 -select * from t1 where a=1 and b in (1,6,10,21) order by b; -a b c -1 1 1 -DELETE from t1 WHERE b = 6; -DELETE from t1 WHERE a = 6; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL, - `b` int(11) NOT NULL, - `c` int(11) NOT NULL, - PRIMARY KEY (`b`), - UNIQUE KEY `a` (`a`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) -drop table t1; -CREATE TABLE t1 -(id MEDIUMINT NOT NULL, -b1 BIT(8), -vc VARCHAR(255), -bc CHAR(255), -d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, -total BIGINT UNSIGNED, -y YEAR, -t DATE) ENGINE=NDB -PARTITION BY RANGE (YEAR(t)) -(PARTITION p0 VALUES LESS THAN (1901), -PARTITION p1 VALUES LESS THAN (1946), -PARTITION p2 VALUES LESS THAN (1966), -PARTITION p3 VALUES LESS THAN (1986), -PARTITION p4 VALUES LESS THAN (2005), -PARTITION p5 VALUES LESS THAN MAXVALUE); -INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -id b1 vc bc d f total y t -0 NULL NULL NULL NULL NULL NULL NULL NULL -ALTER TABLE t1 ENGINE=MYISAM; -SELECT * FROM t1; -id b1 vc bc d f total y t -0 NULL NULL NULL NULL NULL NULL NULL NULL -DROP TABLE t1; -CREATE LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile.dat' - INITIAL_SIZE 16M -UNDO_BUFFER_SIZE=1M -ENGINE=NDB; -CREATE TABLESPACE ts1 -ADD DATAFILE 'datafile.dat' - USE LOGFILE GROUP lg1 -INITIAL_SIZE 12M -ENGINE NDB; -CREATE TABLE test.t1 ( -a1 INT, -a2 TEXT NOT NULL, -a3 BIT NOT NULL, -a4 DECIMAL(8,3), -a5 INT NOT NULL, -a6 INT, -PRIMARY KEY(a1)) -TABLESPACE ts1 STORAGE DISK ENGINE=NDB -PARTITION BY LIST (a1) -(PARTITION p0 VALUES IN (1,2,3,4,5), -PARTITION p1 VALUES IN (6,7,8,9, 10), -PARTITION p2 VALUES IN (11, 12, 13, 14, 15)); -ALTER TABLE test.t1 DROP COLUMN a6; -ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255); -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -DROP TABLE t1; -CREATE TABLE test.t1 ( -a1 INT, -a2 TEXT NOT NULL, -a3 BIT NOT NULL, -a4 DECIMAL(8,3), -a5 INT NOT NULL, -a6 VARCHAR(255), -PRIMARY KEY(a1)) -TABLESPACE ts1 STORAGE DISK ENGINE=NDB -PARTITION BY HASH(a1) -PARTITIONS 4; -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -DROP TABLE t1; -ALTER TABLESPACE ts1 -DROP DATAFILE 'datafile.dat' -ENGINE=NDB; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; -CREATE TABLE t1 -(id MEDIUMINT NOT NULL, -b1 BIT(8), -vc VARCHAR(255), -bc CHAR(255), -d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, -total BIGINT UNSIGNED, -y YEAR, -t DATE) ENGINE=NDB -PARTITION BY LIST(id) -(PARTITION p0 VALUES IN (2, 4), -PARTITION p1 VALUES IN (42, 142)); -INSERT INTO t1 VALUES (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -id b1 vc bc d f total y t -2 NULL NULL NULL NULL NULL NULL NULL NULL -ALTER TABLE t1 ADD PARTITION -(PARTITION p2 VALUES IN (412)); -SELECT * FROM t1; -id b1 vc bc d f total y t -2 NULL NULL NULL NULL NULL NULL NULL NULL -DROP TABLE t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null) -partition by list(a) -partitions 2 -(partition x123 values in (1,5,6), -partition x234 values in (4,7,8)); -INSERT into t1 VALUES (5,1,1); -select * from t1; -a b c -5 1 1 -UPDATE t1 SET a=8 WHERE a=5 AND b=1; -select * from t1; -a b c -8 1 1 -drop table t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) engine=ndb -PARTITION BY RANGE(f1) -( PARTITION part1 VALUES LESS THAN (2), -PARTITION part2 VALUES LESS THAN (1000)); -INSERT INTO t1 VALUES(1, '---1---'); -INSERT INTO t1 VALUES(2, '---2---'); -select * from t1 order by f1; -f1 f2 -1 ---1--- -2 ---2--- -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2; -select * from t1 order by f1; -f1 f2 -1 ---1--- -6 ---2--- -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1; -select * from t1 order by f1; -f1 f2 -5 ---1--- -6 ---2--- -drop table t1; diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result index 5dc27d16538..e81b926e092 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result @@ -31,14 +31,12 @@ subpartition by hash(abs(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 int) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(abs(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 int) engine='NDB' partition by range(colint) @@ -55,9 +53,9 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; select abs(col1) from t1 order by col1; abs(col1) 5 @@ -414,14 +412,12 @@ subpartition by hash(abs(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(abs(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -585,37 +581,18 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13 -15 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13 -15 alter table t55 -partition by list(colint) -subpartition by hash(abs(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(abs(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` int(11) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 15 @@ -663,208 +640,6 @@ colint col1 50 56 51 34 55 123 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (abs(15)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (abs(15)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- @@ -1138,130 +913,6 @@ colint col1 51 34 55 123 60 13 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15 -select * from t2 order by col1; -col1 -13 -15 -17 -select * from t3 order by col1; -col1 -13 -15 -17 -select * from t4 order by colint; -colint col1 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -60 13 -select * from t5 order by colint; -colint col1 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -60 13 -select * from t6 order by colint; -colint col1 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -60 13 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- @@ -1535,26 +1186,113 @@ colint col1 51 34 55 123 60 13 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- mod(col1,10) in partition with coltype int +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with mod(col1,10) +------------------------------------------------------------------------- +create table t1 (col1 int) engine='NDB' +partition by range(mod(col1,10)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 int) engine='NDB' +partition by list(mod(col1,10)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 int) engine='NDB' +partition by hash(mod(col1,10)); +create table t4 (colint int, col1 int) engine='NDB' +partition by range(colint) +subpartition by hash(mod(col1,10)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 int) engine='NDB' +partition by list(colint) +subpartition by hash(mod(col1,10)) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 int) engine='NDB' +partition by range(colint) +(partition p0 values less than (mod(15,10)), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with mod(col1,10) +------------------------------------------------------------------------- +insert into t1 values (5); +insert into t1 values (19); +insert into t2 values (5); +insert into t2 values (19); +insert into t2 values (17); +insert into t3 values (5); +insert into t3 values (19); +insert into t3 values (17); +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; +select mod(col1,10) from t1 order by col1; +mod(col1,10) +5 +9 +select * from t1 order by col1; col1 -15 -select * from t22 order by col1; +5 +19 +select * from t2 order by col1; col1 -13 -15 +5 17 -select * from t33 order by col1; +19 +select * from t3 order by col1; col1 -13 -15 +5 17 -select * from t44 order by colint; +19 +select * from t4 order by colint; colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 15 34 16 324 17 345 @@ -1570,7 +1308,7 @@ colint col1 27 3 28 2 29 3 -30 15 +30 5 31 6 32 8 33 9 @@ -1586,9 +1324,132 @@ colint col1 50 56 51 34 55 123 -60 13 -select * from t55 order by colint; +select * from t5 order by colint; colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; +colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +update t1 set col1=15 where col1=5; +update t2 set col1=15 where col1=5; +update t3 set col1=15 where col1=5; +update t4 set col1=15 where col1=5; +update t5 set col1=15 where col1=5; +update t6 set col1=15 where col1=5; +select * from t1 order by col1; +col1 +15 +19 +select * from t2 order by col1; +col1 +15 +17 +19 +select * from t3 order by col1; +col1 +15 +17 +19 +select * from t4 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 11 78 12 89 13 67 @@ -1624,9 +1485,22 @@ colint col1 50 56 51 34 55 123 -60 13 -select * from t66 order by colint; +select * from t5 order by colint; colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 15 34 16 324 17 345 @@ -1658,158 +1532,55 @@ colint col1 50 56 51 34 55 123 -60 13 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- ascii(col1) in partition with coltype char(1) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with ascii(col1) -------------------------------------------------------------------------- -create table t1 (col1 char(1)) engine='NDB' -partition by range(ascii(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 char(1)) engine='NDB' -partition by list(ascii(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 char(1)) engine='NDB' -partition by hash(ascii(col1)); -create table t4 (colint int, col1 char(1)) engine='NDB' -partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(1)) engine='NDB' -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 char(1)) engine='NDB' -partition by range(colint) -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with ascii(col1) -------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; -select ascii(col1) from t1 order by col1; -ascii(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 select * from t6 order by colint; colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Alter tables with ascii(col1) +--- Alter tables with mod(col1,10) ------------------------------------------------------------------------- drop table if exists t11 ; drop table if exists t22 ; @@ -1824,11 +1595,11 @@ create table t44 engine='NDB' as select * from t4; create table t55 engine='NDB' as select * from t5; create table t66 engine='NDB' as select * from t6; alter table t11 -partition by range(ascii(col1)) +partition by range(mod(col1,10)) (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t22 -partition by list(ascii(col1)) +partition by list(mod(col1,10)) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -1837,1634 +1608,243 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); alter table t33 -partition by hash(ascii(col1)); +partition by hash(mod(col1,10)); alter table t44 partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(mod(col1,10)) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) -(partition p0 values less than (ascii('5')), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t11 order by col1; col1 -8 -9 +15 +19 select * from t22 order by col1; col1 -3 -8 -9 +15 +17 +19 select * from t33 order by col1; col1 -3 -8 -9 +15 +17 +19 select * from t44 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t66 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(mod(col1,10)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, - `col1` char(1) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ + `col1` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -60 9 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 -select * from t66 order by colint; -colint col1 -60 9 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(ceiling(col1) as signed integer) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='NDB' -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='NDB' -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='NDB' -partition by hash(cast(ceiling(col1) as signed integer)); -create table t4 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='NDB' -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; -select cast(ceiling(col1) as signed integer) from t1 order by col1; -cast(ceiling(col1) as signed integer) -6 -14 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(ceiling(col1) as signed integer)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(floor(col1) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='NDB' -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='NDB' -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='NDB' -partition by hash(cast(floor(col1) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='NDB' -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; -select cast(floor(col1) as signed) from t1 order by col1; -cast(floor(col1) as signed) -5 -13 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(floor(col1) as signed)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(mod(col1,10) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='NDB' -partition by range(cast(mod(col1,10) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='NDB' -partition by list(cast(mod(col1,10) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='NDB' -partition by hash(cast(mod(col1,10) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='NDB' -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.0000); -insert into t1 values (19); -insert into t2 values (5.0000); -insert into t2 values (19); -insert into t2 values (17); -insert into t3 values (5.0000); -insert into t3 values (19); -insert into t3 values (17); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; -select cast(mod(col1,10) as signed) from t1 order by col1; -cast(mod(col1,10) as signed) -5 -9 -select * from t1 order by col1; -col1 -5.0000 -19.0000 -select * from t2 order by col1; -col1 -5.0000 -17.0000 -19.0000 -select * from t3 order by col1; -col1 -5.0000 -17.0000 -19.0000 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15 where col1=5.0000; -update t2 set col1=15 where col1=5.0000; -update t3 set col1=15 where col1=5.0000; -update t4 set col1=15 where col1=5.0000; -update t5 set col1=15 where col1=5.0000; -update t6 set col1=15 where col1=5.0000; -select * from t1 order by col1; -col1 -15.0000 -19.0000 -select * from t2 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t3 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(cast(mod(col1,10) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(mod(col1,10) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(mod(col1,10) as signed)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -15.0000 -19.0000 -select * from t22 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t33 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t44 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -15.0000 -19.0000 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -15.0000 -19.0000 -alter table t55 -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t1 where col1=19; delete from t2 where col1=19; @@ -3474,27 +1854,109 @@ delete from t5 where col1=19; delete from t6 where col1=19; select * from t1 order by col1; col1 -15.0000 +15 select * from t2 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t3 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t1 values (19); insert into t2 values (19); insert into t3 values (19); @@ -3503,64 +1965,164 @@ insert into t5 values (60,19); insert into t6 values (60,19); select * from t1 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t2 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t4 order by colint; -colint col1 -60 19.0000 -select * from t5 order by colint; -colint col1 -60 19.0000 -select * from t6 order by colint; -colint col1 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t11 where col1=19; delete from t22 where col1=19; @@ -3570,27 +2132,109 @@ delete from t55 where col1=19; delete from t66 where col1=19; select * from t11 order by col1; col1 -15.0000 +15 select * from t22 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t33 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t11 values (19); insert into t22 values (19); insert into t33 values (19); @@ -3599,560 +2243,162 @@ insert into t55 values (60,19); insert into t66 values (60,19); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t22 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t44 order by colint; -colint col1 -60 19.0000 -select * from t55 order by colint; -colint col1 -60 19.0000 -select * from t66 order by colint; -colint col1 -60 19.0000 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- ord(col1) in partition with coltype char(3) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with ord(col1) -------------------------------------------------------------------------- -create table t1 (col1 char(3)) engine='NDB' -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 char(3)) engine='NDB' -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 char(3)) engine='NDB' -partition by hash(ord(col1)); -create table t4 (colint int, col1 char(3)) engine='NDB' -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(3)) engine='NDB' -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 char(3)) engine='NDB' -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with ord(col1) -------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; -select ord(col1) from t1 order by col1; -ord(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Alter tables with ord(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(ord(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` char(3) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t66 order by colint; colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------- ---- some alter table end ------------------------- @@ -4201,14 +2447,12 @@ subpartition by hash(day(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(day(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -4225,9 +2469,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select day(col1) from t1 order by col1; day(col1) 17 @@ -4338,14 +2582,12 @@ subpartition by hash(day(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(day(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -4386,81 +2628,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(day(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(day(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-05 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (day('2006-12-21')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (day('2006-12-21')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- @@ -4529,32 +2714,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -select * from t2 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 -60 2006-01-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- @@ -4623,32 +2782,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -select * from t22 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 -60 2006-01-17 ------------------------- ---- some alter table end ------------------------- @@ -4697,14 +2830,12 @@ subpartition by hash(dayofmonth(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofmonth(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -4721,9 +2852,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofmonth(col1) from t1 order by col1; dayofmonth(col1) 17 @@ -4834,14 +2965,12 @@ subpartition by hash(dayofmonth(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofmonth(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -4882,81 +3011,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(dayofmonth(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-05 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofmonth('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofmonth('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- @@ -5025,32 +3097,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -select * from t2 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 -60 2006-01-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- @@ -5119,32 +3165,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -select * from t22 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 -60 2006-01-17 ------------------------- ---- some alter table end ------------------------- @@ -5193,14 +3213,12 @@ subpartition by hash(dayofweek(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofweek(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -5217,9 +3235,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofweek(col1) from t1 order by col1; dayofweek(col1) 3 @@ -5330,14 +3348,12 @@ subpartition by hash(dayofweek(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofweek(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -5378,81 +3394,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 alter table t55 -partition by list(colint) -subpartition by hash(dayofweek(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofweek(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofweek('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofweek('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- @@ -5526,33 +3485,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t4 order by colint; -colint col1 -60 2006-02-17 -select * from t5 order by colint; -colint col1 -60 2006-02-17 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-02-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- @@ -5626,33 +3558,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t44 order by colint; -colint col1 -60 2006-02-17 -select * from t55 order by colint; -colint col1 -60 2006-02-17 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-02-17 ------------------------- ---- some alter table end ------------------------- @@ -5701,14 +3606,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -5725,9 +3628,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -5838,14 +3741,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -5886,81 +3787,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(dayofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6029,33 +3873,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t2 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6124,33 +3941,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t22 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -6199,14 +3989,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 char(30)) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 char(30)) engine='NDB' partition by range(colint) @@ -6223,9 +4011,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -6336,14 +4124,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -6384,81 +4170,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(dayofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` char(30) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6527,33 +4256,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t2 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6622,33 +4324,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t22 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -6697,14 +4372,12 @@ subpartition by hash(extract(month from col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(extract(month from col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -6721,9 +4394,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select extract(month from col1) from t1 order by col1; extract(month from col1) 1 @@ -6834,14 +4507,12 @@ subpartition by hash(extract(month from col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(extract(month from col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -6882,81 +4553,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 alter table t55 -partition by list(colint) -subpartition by hash(extract(month from col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(extract(month from col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (extract(year from '1998-11-23')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (extract(year from '1998-11-23')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- @@ -7030,28 +4644,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t4 order by colint; -colint col1 -60 2006-02-17 -select * from t5 order by colint; -colint col1 -60 2006-02-17 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- @@ -7125,28 +4717,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t44 order by colint; -colint col1 -60 2006-02-17 -select * from t55 order by colint; -colint col1 -60 2006-02-17 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -7195,14 +4765,12 @@ subpartition by hash(hour(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(hour(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -7219,9 +4787,9 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select hour(col1) from t1 order by col1; hour(col1) 9 @@ -7332,14 +4900,12 @@ subpartition by hash(hour(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(hour(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -7380,81 +4946,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:30:00 -14:30:00 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:30:00 -14:30:00 alter table t55 -partition by list(colint) -subpartition by hash(hour(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(hour(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 09:09:15 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (hour('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (hour('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- @@ -7528,31 +5037,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:00 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -14:30:00 -21:59:00 -select * from t3 order by col1; -col1 -10:30:00 -14:30:00 -21:59:00 -select * from t4 order by colint; -colint col1 -60 14:30:00 -select * from t5 order by colint; -colint col1 -60 14:30:00 -select * from t6 order by colint; -colint col1 -60 14:30:00 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- @@ -7626,31 +5110,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:00 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -14:30:00 -21:59:00 -select * from t33 order by col1; -col1 -10:30:00 -14:30:00 -21:59:00 -select * from t44 order by colint; -colint col1 -60 14:30:00 -select * from t55 order by colint; -colint col1 -60 14:30:00 -select * from t66 order by colint; -colint col1 -60 14:30:00 ------------------------- ---- some alter table end ------------------------- @@ -7699,14 +5158,12 @@ subpartition by hash(microsecond(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(microsecond(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -7723,9 +5180,9 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select microsecond(col1) from t1 order by col1; microsecond(col1) 0 @@ -7836,14 +5293,12 @@ subpartition by hash(microsecond(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(microsecond(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -7884,81 +5339,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -04:30:01 -05:30:34 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -04:30:01 -05:30:34 alter table t55 -partition by list(colint) -subpartition by hash(microsecond(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(microsecond(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 05:30:34 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (microsecond('10:30:10.000010')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (microsecond('10:30:10.000010')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- @@ -8027,29 +5425,6 @@ colint col1 3 00:59:22 4 05:30:34 60 04:30:01 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -00:59:22 -04:30:01 -05:30:34 -select * from t4 order by colint; -colint col1 -60 04:30:01 -select * from t5 order by colint; -colint col1 -60 04:30:01 -select * from t6 order by colint; -colint col1 -60 04:30:01 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- @@ -8118,29 +5493,6 @@ colint col1 3 00:59:22 4 05:30:34 60 04:30:01 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -00:59:22 -04:30:01 -05:30:34 -select * from t44 order by colint; -colint col1 -60 04:30:01 -select * from t55 order by colint; -colint col1 -60 04:30:01 -select * from t66 order by colint; -colint col1 -60 04:30:01 ------------------------- ---- some alter table end ------------------------- @@ -8189,14 +5541,12 @@ subpartition by hash(minute(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(minute(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -8213,9 +5563,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select minute(col1) from t1 order by col1; minute(col1) 9 @@ -8326,14 +5676,12 @@ subpartition by hash(minute(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(minute(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -8374,81 +5722,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:24:23 -14:30:45 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:24:23 -14:30:45 alter table t55 -partition by list(colint) -subpartition by hash(minute(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(minute(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 10:24:23 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (minute('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (minute('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- @@ -8522,34 +5813,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:24:23 -14:30:45 -select * from t2 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t3 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:45 -select * from t5 order by colint; -colint col1 -60 14:30:45 -select * from t6 order by colint; -colint col1 -60 14:30:45 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- @@ -8623,34 +5886,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:24:23 -14:30:45 -select * from t22 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t33 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:45 -select * from t55 order by colint; -colint col1 -60 14:30:45 -select * from t66 order by colint; -colint col1 -60 14:30:45 ------------------------- ---- some alter table end ------------------------- @@ -8699,14 +5934,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -8723,9 +5956,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -8836,14 +6069,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -8884,81 +6115,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 alter table t55 -partition by list(colint) -subpartition by hash(second(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 09:09:15 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9032,34 +6206,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:20 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:22:33 -14:30:20 -select * from t2 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t3 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:20 -select * from t5 order by colint; -colint col1 -60 14:30:20 -select * from t6 order by colint; -colint col1 -60 14:30:20 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9133,34 +6279,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:20 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -select * from t22 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t33 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:20 -select * from t55 order by colint; -colint col1 -60 14:30:20 -select * from t66 order by colint; -colint col1 -60 14:30:20 ------------------------- ---- some alter table end ------------------------- @@ -9209,14 +6327,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 char(30)) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 char(30)) engine='NDB' partition by range(colint) @@ -9233,9 +6349,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -9346,14 +6462,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -9394,81 +6508,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 alter table t55 -partition by list(colint) -subpartition by hash(second(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` char(30) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 09:09:15.000002 2 04:30:01.000018 3 00:59:22.000024 4 05:30:34.000037 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9542,34 +6599,6 @@ colint col1 3 00:59:22.000024 4 05:30:34.000037 60 14:30:20 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:22:33 -14:30:20 -select * from t2 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t3 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:20 -select * from t5 order by colint; -colint col1 -60 14:30:20 -select * from t6 order by colint; -colint col1 -60 14:30:20 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9643,34 +6672,6 @@ colint col1 3 00:59:22.000024 4 05:30:34.000037 60 14:30:20 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -select * from t22 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t33 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:20 -select * from t55 order by colint; -colint col1 -60 14:30:20 -select * from t66 order by colint; -colint col1 -60 14:30:20 ------------------------- ---- some alter table end ------------------------- @@ -9719,14 +6720,12 @@ subpartition by hash(month(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(month(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -9743,9 +6742,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select month(col1) from t1 order by col1; month(col1) 1 @@ -9856,14 +6855,12 @@ subpartition by hash(month(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(month(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -9904,81 +6901,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-11-06 -2006-12-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-11-06 -2006-12-17 alter table t55 -partition by list(colint) -subpartition by hash(month(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(month(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (month('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (month('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- @@ -10052,31 +6992,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -2006-11-06 -2006-12-17 -select * from t3 order by col1; -col1 -2006-05-25 -2006-11-06 -2006-12-17 -select * from t4 order by colint; -colint col1 -60 2006-12-17 -select * from t5 order by colint; -colint col1 -60 2006-12-17 -select * from t6 order by colint; -colint col1 -60 2006-12-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- @@ -10150,31 +7065,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -2006-11-06 -2006-12-17 -select * from t33 order by col1; -col1 -2006-05-25 -2006-11-06 -2006-12-17 -select * from t44 order by colint; -colint col1 -60 2006-12-17 -select * from t55 order by colint; -colint col1 -60 2006-12-17 -select * from t66 order by colint; -colint col1 -60 2006-12-17 ------------------------- ---- some alter table end ------------------------- @@ -10223,14 +7113,12 @@ subpartition by hash(quarter(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(quarter(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -10247,9 +7135,9 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select quarter(col1) from t1 order by col1; quarter(col1) 1 @@ -10360,14 +7248,12 @@ subpartition by hash(quarter(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(quarter(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -10408,81 +7294,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-07-30 -2006-12-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-07-30 -2006-12-17 alter table t55 -partition by list(colint) -subpartition by hash(quarter(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(quarter(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (quarter('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (quarter('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- @@ -10556,30 +7385,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-07-30 -2006-09-25 -2006-12-17 -select * from t4 order by colint; -colint col1 -60 2006-12-17 -select * from t5 order by colint; -colint col1 -60 2006-12-17 -select * from t6 order by colint; -colint col1 -4 2006-02-05 -60 2006-12-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- @@ -10653,30 +7458,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-07-30 -2006-09-25 -2006-12-17 -select * from t44 order by colint; -colint col1 -60 2006-12-17 -select * from t55 order by colint; -colint col1 -60 2006-12-17 -select * from t66 order by colint; -colint col1 -4 2006-02-05 -60 2006-12-17 ------------------------- ---- some alter table end ------------------------- @@ -10725,14 +7506,12 @@ subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -10749,9 +7528,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1; time_to_sec(col1)-(time_to_sec(col1)-20) 20 @@ -10862,14 +7641,12 @@ subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -10910,81 +7687,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:33:11 -14:30:45 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:33:11 -14:30:45 alter table t55 -partition by list(colint) -subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 10:33:11 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- @@ -11058,33 +7778,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:33:11 -14:30:45 -select * from t2 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t3 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:45 -select * from t5 order by colint; -colint col1 -60 14:30:45 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- @@ -11158,33 +7851,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:33:11 -14:30:45 -select * from t22 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t33 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:45 -select * from t55 order by colint; -colint col1 -60 14:30:45 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -11233,14 +7899,12 @@ subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -11257,9 +7921,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select to_days(col1)-to_days('2006-01-01') from t1 order by col1; to_days(col1)-to_days('2006-01-01') 16 @@ -11370,14 +8034,12 @@ subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -11418,81 +8080,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-06 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-06 alter table t55 -partition by list(colint) -subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-06 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') ------------------------------------------------------------------------- @@ -11561,34 +8166,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -2006-02-06 -select * from t2 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-06 -select * from t3 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-06 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 -60 2006-01-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') ------------------------------------------------------------------------- @@ -11657,11 +8234,200 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- datediff(col1, '2006-01-01') in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(datediff(col1, '2006-01-01')); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +insert into t1 values ('2006-02-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-02-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-02-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-01-25'); +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; +select datediff(col1, '2006-01-01') from t1 order by col1; +datediff(col1, '2006-01-01') +16 +33 +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-03 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-02-03'; +update t2 set col1='2006-02-06' where col1='2006-02-03'; +update t3 set col1='2006-02-06' where col1='2006-02-03'; +update t4 set col1='2006-02-06' where col1='2006-02-03'; +update t5 set col1='2006-02-06' where col1='2006-02-03'; +update t6 set col1='2006-02-06' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(datediff(col1, '2006-01-01')); +alter table t44 +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); select * from t11 order by col1; col1 2006-01-17 @@ -11678,12 +8444,178 @@ col1 2006-02-06 select * from t44 order by colint; colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 60 2006-01-17 select * from t55 order by colint; colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 60 2006-01-17 select * from t66 order by colint; colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 60 2006-01-17 ------------------------- ---- some alter table end @@ -11733,14 +8665,12 @@ subpartition by hash(weekday(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(weekday(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -11757,9 +8687,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select weekday(col1) from t1 order by col1; weekday(col1) 4 @@ -11870,14 +8800,12 @@ subpartition by hash(weekday(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(weekday(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -11918,81 +8846,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-06 -2006-11-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-06 -2006-11-17 alter table t55 -partition by list(colint) -subpartition by hash(weekday(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(weekday(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekday('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekday('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- @@ -12066,29 +8937,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-11-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-02-06 -2006-05-25 -2006-11-17 -select * from t4 order by colint; -colint col1 -60 2006-11-17 -select * from t5 order by colint; -colint col1 -60 2006-11-17 -select * from t6 order by colint; -colint col1 -60 2006-11-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- @@ -12162,537 +9010,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-11-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-02-06 -2006-05-25 -2006-11-17 -select * from t44 order by colint; -colint col1 -60 2006-11-17 -select * from t55 order by colint; -colint col1 -60 2006-11-17 -select * from t66 order by colint; -colint col1 -60 2006-11-17 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- weekofyear(col1) in partition with coltype date -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with weekofyear(col1) -------------------------------------------------------------------------- -create table t1 (col1 date) engine='NDB' -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 date) engine='NDB' -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 date) engine='NDB' -partition by hash(weekofyear(col1)); -create table t4 (colint int, col1 date) engine='NDB' -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 date) engine='NDB' -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with weekofyear(col1) -------------------------------------------------------------------------- -insert into t1 values ('2006-01-03'); -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-01-03'); -insert into t2 values ('2006-03-17'); -insert into t2 values ('2006-05-25'); -insert into t3 values ('2006-01-03'); -insert into t3 values ('2006-03-17'); -insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; -select weekofyear(col1) from t1 order by col1; -weekofyear(col1) -1 -11 -select * from t1 order by col1; -col1 -2006-01-03 -2006-03-17 -select * from t2 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t3 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -update t1 set col1='2006-09-06' where col1='2006-01-03'; -update t2 set col1='2006-09-06' where col1='2006-01-03'; -update t3 set col1='2006-09-06' where col1='2006-01-03'; -update t4 set col1='2006-09-06' where col1='2006-01-03'; -update t5 set col1='2006-09-06' where col1='2006-01-03'; -update t6 set col1='2006-09-06' where col1='2006-01-03'; -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Alter tables with weekofyear(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(weekofyear(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t1 where col1='2006-03-17'; -delete from t2 where col1='2006-03-17'; -delete from t3 where col1='2006-03-17'; -delete from t4 where col1='2006-03-17'; -delete from t5 where col1='2006-03-17'; -delete from t6 where col1='2006-03-17'; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-03-17'); -insert into t3 values ('2006-03-17'); -insert into t4 values (60,'2006-03-17'); -insert into t5 values (60,'2006-03-17'); -insert into t6 values (60,'2006-03-17'); -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -60 2006-03-17 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t11 where col1='2006-03-17'; -delete from t22 where col1='2006-03-17'; -delete from t33 where col1='2006-03-17'; -delete from t44 where col1='2006-03-17'; -delete from t55 where col1='2006-03-17'; -delete from t66 where col1='2006-03-17'; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t11 values ('2006-03-17'); -insert into t22 values ('2006-03-17'); -insert into t33 values ('2006-03-17'); -insert into t44 values (60,'2006-03-17'); -insert into t55 values (60,'2006-03-17'); -insert into t66 values (60,'2006-03-17'); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -60 2006-03-17 ------------------------- ---- some alter table end ------------------------- @@ -12741,14 +9058,12 @@ subpartition by hash(year(col1)-1990) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(year(col1)-1990) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -12765,9 +9080,9 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select year(col1)-1990 from t1 order by col1; year(col1)-1990 6 @@ -12878,14 +9193,12 @@ subpartition by hash(year(col1)-1990) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(year(col1)-1990) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -12926,81 +9239,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2000-02-17 -2002-02-15 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2000-02-17 -2002-02-15 alter table t55 -partition by list(colint) -subpartition by hash(year(col1)-1990) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(year(col1)-1990) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (year('2005-10-14')-1990), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (year('2005-10-14')-1990), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- @@ -13074,31 +9330,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2000-02-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -2002-02-15 -2004-05-25 -select * from t3 order by col1; -col1 -2000-02-17 -2002-02-15 -2004-05-25 -select * from t4 order by colint; -colint col1 -60 2000-02-17 -select * from t5 order by colint; -colint col1 -60 2000-02-17 -select * from t6 order by colint; -colint col1 -60 2000-02-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- @@ -13172,31 +9403,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2000-02-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -2002-02-15 -2004-05-25 -select * from t33 order by col1; -col1 -2000-02-17 -2002-02-15 -2004-05-25 -select * from t44 order by colint; -colint col1 -60 2000-02-17 -select * from t55 order by colint; -colint col1 -60 2000-02-17 -select * from t66 order by colint; -colint col1 -60 2000-02-17 ------------------------- ---- some alter table end ------------------------- @@ -13245,14 +9451,12 @@ subpartition by hash(yearweek(col1)-200600) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(yearweek(col1)-200600) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -13269,9 +9473,9 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select yearweek(col1)-200600 from t1 order by col1; yearweek(col1)-200600 1 @@ -13382,14 +9586,12 @@ subpartition by hash(yearweek(col1)-200600) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(yearweek(col1)-200600) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -13430,81 +9632,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-08-17 -2006-11-15 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-08-17 -2006-11-15 alter table t55 -partition by list(colint) -subpartition by hash(yearweek(col1)-200600) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (yearweek('2006-10-14')-200600), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (yearweek('2006-10-14')-200600), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- @@ -13578,34 +9723,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-08-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-08-17 -2006-11-15 -select * from t2 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t3 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t4 order by colint; -colint col1 -60 2006-08-17 -select * from t5 order by colint; -colint col1 -60 2006-08-17 -select * from t6 order by colint; -colint col1 -60 2006-08-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- @@ -13679,34 +9796,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-08-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-08-17 -2006-11-15 -select * from t22 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t33 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t44 order by colint; -colint col1 -60 2006-08-17 -select * from t55 order by colint; -colint col1 -60 2006-08-17 -select * from t66 order by colint; -colint col1 -60 2006-08-17 ------------------------- ---- some alter table end ------------------------- diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result index ec67ff8a49a..68acfcc3a60 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result @@ -196,8 +196,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -355,8 +355,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -3829,8 +3829,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -7776,8 +7776,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -11836,8 +11836,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -15911,8 +15911,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result index 69b8067d043..98fa8fdfe61 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result @@ -196,8 +196,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -3914,8 +3914,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -8145,8 +8145,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result index c978af2c0d9..685b9909553 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result @@ -3146,8 +3146,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -6677,8 +6677,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -10320,8 +10320,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result index 23f32a715b4..31d6d4f54f6 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result @@ -3389,8 +3389,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_innodb.result index 15de39a3f9f..7000cb7e7ae 100644 --- a/mysql-test/suite/parts/r/partition_alter2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_innodb.result @@ -3259,8 +3259,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -7171,8 +7171,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -11118,8 +11118,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -15178,8 +15178,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -19253,8 +19253,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -22969,8 +22969,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -30538,8 +30538,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -38430,8 +38430,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -46435,8 +46435,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -54583,8 +54583,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -62386,8 +62386,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -66309,8 +66309,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -70268,8 +70268,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -74340,8 +74340,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -78427,8 +78427,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -82169,8 +82169,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -89796,8 +89796,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -97746,8 +97746,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -105809,8 +105809,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -114015,8 +114015,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_myisam.result index 99cb22b97c3..df243a115cc 100644 --- a/mysql-test/suite/parts/r/partition_alter2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_myisam.result @@ -3391,8 +3391,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -7571,8 +7571,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -11802,8 +11802,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -15674,8 +15674,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -23667,8 +23667,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -32127,8 +32127,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -40242,8 +40242,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -44434,8 +44434,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -48677,8 +48677,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -52575,8 +52575,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -60626,8 +60626,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -69144,8 +69144,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_engine_ndb.result b/mysql-test/suite/parts/r/partition_engine_ndb.result index a2bed0d6204..2f184248c18 100644 --- a/mysql-test/suite/parts/r/partition_engine_ndb.result +++ b/mysql-test/suite/parts/r/partition_engine_ndb.result @@ -1,15 +1,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'ndbcluster'; -#------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -# #18730, Bug#18735 -# The expected results suffer from the following bugs -# harmless #17455, #19305 -# which cannot be suppressed because of technical reasons. -#------------------------------------------------------------------------ - #------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases @@ -32,7 +23,7 @@ DROP TABLE IF EXISTS t0_definition; CREATE TABLE t0_definition ( state CHAR(3), create_command VARBINARY(5000), -file_list VARBINARY(5000), +file_list VARBINARY(10000), PRIMARY KEY (state) ) ENGINE = MEMORY; DROP TABLE IF EXISTS t0_aux; @@ -66,7 +57,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -76,7 +67,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) PARTITIONS 2 +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -501,7 +492,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2 Assignment of storage engine just after partition or subpartition @@ -520,7 +511,7 @@ PARTITION part2 STORAGE ENGINE = 'ndbcluster' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -530,7 +521,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -955,7 +946,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -975,7 +966,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -985,7 +976,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1408,7 +1399,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 3 Some but not all named partitions or subpartitions get a storage @@ -1425,445 +1416,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 STORAGE ENGINE = 'ndbcluster', PARTITION part2 ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) -create_command -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT NULL, - `f_int2` int(11) DEFAULT NULL, - `f_char1` char(20) DEFAULT NULL, - `f_char2` char(20) DEFAULT NULL, - `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) - -# check prerequisites-1 success: 1 -# check COUNT(*) success: 1 -# check MIN/MAX(f_int1) success: 1 -# check MIN/MAX(f_int2) success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'delete me' FROM t0_template -WHERE f_int1 IN (2,3); -# check prerequisites-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'delete me'; -# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE -# check read via f_int1 success: 1 -# check read via f_int2 success: 1 - -# check multiple-1 success: 1 -DELETE FROM t1 WHERE MOD(f_int1,3) = 0; - -# check multiple-2 success: 1 -INSERT INTO t1 SELECT * FROM t0_template -WHERE MOD(f_int1,3) = 0; - -# check multiple-3 success: 1 -UPDATE t1 SET f_int1 = f_int1 + @max_row -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 -AND @max_row_div2 + @max_row_div4; - -# check multiple-4 success: 1 -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row -AND @max_row_div2 + @max_row_div4 + @max_row; - -# check multiple-5 success: 1 -SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-1 success: 1 -SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-2 success: 1 -SELECT MIN(f_int1) INTO @cur_value1 FROM t1; -SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value2 -WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; - -# check single-3 success: 1 -SET @cur_value1= -1; -SELECT MAX(f_int1) INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value1 -WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; - -# check single-4 success: 1 -SELECT MAX(f_int1) INTO @cur_value FROM t1; -DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; - -# check single-5 success: 1 -DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; - -# check single-6 success: 1 -INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; - -# check single-7 success: 1 -DELETE FROM t1 WHERE f_charbig = '#2147483647##'; -DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; -INSERT t1 SET f_int1 = 0 , f_int2 = 0, -f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), -f_charbig = '#NULL#'; -INSERT INTO t1 -SET f_int1 = NULL , f_int2 = -@max_row, -f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), -f_charbig = '#NULL#'; -# check null success: 1 - -# check null-1 success: 1 -UPDATE t1 SET f_int1 = -@max_row -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-2 success: 1 -UPDATE t1 SET f_int1 = NULL -WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-3 success: 1 -DELETE FROM t1 -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-4 success: 1 -DELETE FROM t1 -WHERE f_int1 = 0 AND f_int2 = 0 -AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) -AND f_charbig = '#NULL#'; -SET AUTOCOMMIT= 0; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-1 success: 1 -COMMIT WORK; - -# check transactions-2 success: 1 -ROLLBACK WORK; - -# check transactions-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -ROLLBACK WORK; - -# check transactions-4 success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-5 success: 1 -ROLLBACK WORK; - -# check transactions-6 success: 1 -# INFO: Storage engine used for t1 seems to be transactional. -COMMIT; - -# check transactions-7 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -SET @@session.sql_mode = 'traditional'; -SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, -'', '', 'was inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; -ERROR 22012: Division by 0 -COMMIT; - -# check transactions-8 success: 1 -# INFO: Storage engine used for t1 seems to be unable to revert -# changes made by the failing statement. -SET @@session.sql_mode = ''; -SET AUTOCOMMIT= 1; -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -UPDATE t1 SET f_charbig = REPEAT('b', 1000); - -# check special-1 success: 1 -UPDATE t1 SET f_charbig = ''; - -# check special-2 success: 1 -UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-1 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-2 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-3 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-4 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-5 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-6 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-7 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-8 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = old.f_int1 + @max_row, -new.f_int2 = old.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-9 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = new.f_int1 + @max_row, -new.f_int2 = new.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-10 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-11 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_char1, f_char2, f_charbig) -SELECT CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-12 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check -CHECKSUM TABLE t1 EXTENDED; -Table Checksum -test.t1 -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize -# check layout success: 1 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair -# check layout success: 1 -TRUNCATE t1; - -# check TRUNCATE success: 1 -# check layout success: 1 -# End usability test (include/partition_check.inc) -DROP TABLE t1; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1875,445 +1428,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 , PARTITION part2 STORAGE ENGINE = 'ndbcluster' ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) -create_command -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT NULL, - `f_int2` int(11) DEFAULT NULL, - `f_char1` char(20) DEFAULT NULL, - `f_char2` char(20) DEFAULT NULL, - `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) - -# check prerequisites-1 success: 1 -# check COUNT(*) success: 1 -# check MIN/MAX(f_int1) success: 1 -# check MIN/MAX(f_int2) success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'delete me' FROM t0_template -WHERE f_int1 IN (2,3); -# check prerequisites-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'delete me'; -# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE -# check read via f_int1 success: 1 -# check read via f_int2 success: 1 - -# check multiple-1 success: 1 -DELETE FROM t1 WHERE MOD(f_int1,3) = 0; - -# check multiple-2 success: 1 -INSERT INTO t1 SELECT * FROM t0_template -WHERE MOD(f_int1,3) = 0; - -# check multiple-3 success: 1 -UPDATE t1 SET f_int1 = f_int1 + @max_row -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 -AND @max_row_div2 + @max_row_div4; - -# check multiple-4 success: 1 -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row -AND @max_row_div2 + @max_row_div4 + @max_row; - -# check multiple-5 success: 1 -SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-1 success: 1 -SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-2 success: 1 -SELECT MIN(f_int1) INTO @cur_value1 FROM t1; -SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value2 -WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; - -# check single-3 success: 1 -SET @cur_value1= -1; -SELECT MAX(f_int1) INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value1 -WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; - -# check single-4 success: 1 -SELECT MAX(f_int1) INTO @cur_value FROM t1; -DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; - -# check single-5 success: 1 -DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; - -# check single-6 success: 1 -INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; - -# check single-7 success: 1 -DELETE FROM t1 WHERE f_charbig = '#2147483647##'; -DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; -INSERT t1 SET f_int1 = 0 , f_int2 = 0, -f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), -f_charbig = '#NULL#'; -INSERT INTO t1 -SET f_int1 = NULL , f_int2 = -@max_row, -f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), -f_charbig = '#NULL#'; -# check null success: 1 - -# check null-1 success: 1 -UPDATE t1 SET f_int1 = -@max_row -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-2 success: 1 -UPDATE t1 SET f_int1 = NULL -WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-3 success: 1 -DELETE FROM t1 -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-4 success: 1 -DELETE FROM t1 -WHERE f_int1 = 0 AND f_int2 = 0 -AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) -AND f_charbig = '#NULL#'; -SET AUTOCOMMIT= 0; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-1 success: 1 -COMMIT WORK; - -# check transactions-2 success: 1 -ROLLBACK WORK; - -# check transactions-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -ROLLBACK WORK; - -# check transactions-4 success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-5 success: 1 -ROLLBACK WORK; - -# check transactions-6 success: 1 -# INFO: Storage engine used for t1 seems to be transactional. -COMMIT; - -# check transactions-7 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -SET @@session.sql_mode = 'traditional'; -SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, -'', '', 'was inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; -ERROR 22012: Division by 0 -COMMIT; - -# check transactions-8 success: 1 -# INFO: Storage engine used for t1 seems to be unable to revert -# changes made by the failing statement. -SET @@session.sql_mode = ''; -SET AUTOCOMMIT= 1; -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -UPDATE t1 SET f_charbig = REPEAT('b', 1000); - -# check special-1 success: 1 -UPDATE t1 SET f_charbig = ''; - -# check special-2 success: 1 -UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-1 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-2 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-3 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-4 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-5 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-6 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-7 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-8 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = old.f_int1 + @max_row, -new.f_int2 = old.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-9 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = new.f_int1 + @max_row, -new.f_int2 = new.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-10 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-11 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_char1, f_char2, f_charbig) -SELECT CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-12 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check -CHECKSUM TABLE t1 EXTENDED; -Table Checksum -test.t1 -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize -# check layout success: 1 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair -# check layout success: 1 -TRUNCATE t1; - -# check TRUNCATE success: 1 -# check layout success: 1 -# End usability test (include/partition_check.inc) -DROP TABLE t1; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -2330,443 +1445,7 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster', SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) -create_command -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT NULL, - `f_int2` int(11) DEFAULT NULL, - `f_char1` char(20) DEFAULT NULL, - `f_char2` char(20) DEFAULT NULL, - `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) - -# check prerequisites-1 success: 1 -# check COUNT(*) success: 1 -# check MIN/MAX(f_int1) success: 1 -# check MIN/MAX(f_int2) success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'delete me' FROM t0_template -WHERE f_int1 IN (2,3); -# check prerequisites-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'delete me'; -# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE -# check read via f_int1 success: 1 -# check read via f_int2 success: 1 - -# check multiple-1 success: 1 -DELETE FROM t1 WHERE MOD(f_int1,3) = 0; - -# check multiple-2 success: 1 -INSERT INTO t1 SELECT * FROM t0_template -WHERE MOD(f_int1,3) = 0; - -# check multiple-3 success: 1 -UPDATE t1 SET f_int1 = f_int1 + @max_row -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 -AND @max_row_div2 + @max_row_div4; - -# check multiple-4 success: 1 -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row -AND @max_row_div2 + @max_row_div4 + @max_row; - -# check multiple-5 success: 1 -SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-1 success: 1 -SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-2 success: 1 -SELECT MIN(f_int1) INTO @cur_value1 FROM t1; -SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value2 -WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; - -# check single-3 success: 1 -SET @cur_value1= -1; -SELECT MAX(f_int1) INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value1 -WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; - -# check single-4 success: 1 -SELECT MAX(f_int1) INTO @cur_value FROM t1; -DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; - -# check single-5 success: 1 -DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; - -# check single-6 success: 1 -INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; -ERROR HY000: Table has no partition for value 2147483647 -DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; -INSERT t1 SET f_int1 = 0 , f_int2 = 0, -f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), -f_charbig = '#NULL#'; -INSERT INTO t1 -SET f_int1 = NULL , f_int2 = -@max_row, -f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), -f_charbig = '#NULL#'; -# check null success: 1 - -# check null-1 success: 1 -UPDATE t1 SET f_int1 = -@max_row -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-2 success: 1 -UPDATE t1 SET f_int1 = NULL -WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-3 success: 1 -DELETE FROM t1 -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-4 success: 1 -DELETE FROM t1 -WHERE f_int1 = 0 AND f_int2 = 0 -AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) -AND f_charbig = '#NULL#'; -SET AUTOCOMMIT= 0; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-1 success: 1 -COMMIT WORK; - -# check transactions-2 success: 1 -ROLLBACK WORK; - -# check transactions-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -ROLLBACK WORK; - -# check transactions-4 success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-5 success: 1 -ROLLBACK WORK; - -# check transactions-6 success: 1 -# INFO: Storage engine used for t1 seems to be transactional. -COMMIT; - -# check transactions-7 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -SET @@session.sql_mode = 'traditional'; -SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, -'', '', 'was inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; -ERROR 22012: Division by 0 -COMMIT; - -# check transactions-8 success: 1 -# INFO: Storage engine used for t1 seems to be unable to revert -# changes made by the failing statement. -SET @@session.sql_mode = ''; -SET AUTOCOMMIT= 1; -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -UPDATE t1 SET f_charbig = REPEAT('b', 1000); - -# check special-1 success: 1 -UPDATE t1 SET f_charbig = ''; - -# check special-2 success: 1 -UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-1 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-2 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-3 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-4 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-5 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-6 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-7 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-8 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = old.f_int1 + @max_row, -new.f_int2 = old.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-9 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = new.f_int1 + @max_row, -new.f_int2 = new.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-10 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-11 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_char1, f_char2, f_charbig) -SELECT CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-12 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check -CHECKSUM TABLE t1 EXTENDED; -Table Checksum -test.t1 -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize -# check layout success: 1 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair -# check layout success: 1 -TRUNCATE t1; - -# check TRUNCATE success: 1 -# check layout success: 1 -# End usability test (include/partition_check.inc) -DROP TABLE t1; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -2783,9 +1462,27 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21, SUBPARTITION subpart22 ) ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +ENGINE = 'ndbcluster' +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster', +SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21, +SUBPARTITION subpart22 ) +); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2795,7 +1492,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3218,7 +1915,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 4 Storage engine assignment after partition name + after name of @@ -3233,6 +1930,41 @@ f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster', +SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +ENGINE = 'ndbcluster' +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'ndbcluster' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21, +SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') +); +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'ndbcluster' (SUBPARTITION subpart11, SUBPARTITION subpart12), @@ -3242,7 +1974,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3252,7 +1984,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3675,7 +2407,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3690,12 +2422,12 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster', SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'), PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'ndbcluster' -(SUBPARTITION subpart21, +(SUBPARTITION subpart21 ENGINE = 'ndbcluster', SUBPARTITION subpart22) ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3705,7 +2437,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4128,7 +2860,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 5 Precedence of storage engine assignments (if there is any) @@ -4148,7 +2880,7 @@ PARTITION part2 STORAGE ENGINE = 'ndbcluster' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4158,7 +2890,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4583,7 +3315,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4603,7 +3335,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4613,7 +3345,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5036,10 +3768,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 6.2 Storage engine assignment after partition name + after # subpartition name +# in partition part + in sub partition part CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -5058,7 +3791,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5068,7 +3801,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5491,7 +4224,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table @@ -5507,7 +4240,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) ( PARTITION part1 ENGINE = 'ndbcluster'); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5517,7 +4250,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5944,7 +4677,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5960,7 +4693,7 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster')); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5970,7 +4703,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6397,7 +5130,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; SET SESSION storage_engine='ndbcluster'; DROP VIEW IF EXISTS v1; diff --git a/mysql-test/suite/parts/r/partition_int_innodb.result b/mysql-test/suite/parts/r/partition_int_innodb.result index 9f1712e141e..622f79616b0 100644 --- a/mysql-test/suite/parts/r/partition_int_innodb.result +++ b/mysql-test/suite/parts/r/partition_int_innodb.result @@ -14,8 +14,8 @@ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a 1 -2 128 +2 252 253 254 @@ -27,8 +27,8 @@ delete from t1 where a=253; select * from t1; a 1 -2 128 +2 252 254 255 @@ -64,19 +64,19 @@ count(*) 255 drop table t2; create table t3 (a tinyint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -89,9 +89,9 @@ a delete from t3 where a=125; select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -164,19 +164,19 @@ count(*) 1024 drop table t2; create table t3 (a smallint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -189,9 +189,9 @@ a delete from t3 where a=32765; select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -215,11 +215,11 @@ select * from t1; a 1 2 -65535 4294967292 4294967293 4294967294 4294967295 +65535 select * from t1 where a=4294967293; a 4294967293 @@ -228,19 +228,19 @@ select * from t1; a 1 2 -65535 4294967292 4294967294 4294967295 +65535 drop table t1; create table t2 (a int unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -264,19 +264,19 @@ count(*) 1024 drop table t2; create table t3 (a int not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -289,9 +289,9 @@ a delete from t3 where a=2147483645; select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -314,12 +314,12 @@ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), select * from t1; a 1 -2 -65535 16777212 16777213 16777214 16777215 +2 +65535 select * from t1 where a=16777213; a 16777213 @@ -327,11 +327,11 @@ delete from t1 where a=16777213; select * from t1; a 1 -2 -65535 16777212 16777214 16777215 +2 +65535 drop table t1; create table t2 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 8; @@ -364,19 +364,19 @@ count(*) 1024 drop table t2; create table t3 (a mediumint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -389,9 +389,9 @@ a delete from t3 where a=8388605; select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -414,24 +414,24 @@ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073 select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=-2; a delete from t1 where a=-2; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=18446744073709551615; a 18446744073709551615 @@ -439,20 +439,20 @@ delete from t1 where a=18446744073709551615; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 +2 +65535 drop table t1; create table t2 (a bigint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -476,19 +476,19 @@ count(*) 1024 drop table t2; create table t3 (a bigint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 @@ -501,9 +501,9 @@ a delete from t3 where a=9223372036854775806; select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 diff --git a/mysql-test/suite/parts/r/partition_int_myisam.result b/mysql-test/suite/parts/r/partition_int_myisam.result index 1e0ba724f4c..b9380dcda74 100644 --- a/mysql-test/suite/parts/r/partition_int_myisam.result +++ b/mysql-test/suite/parts/r/partition_int_myisam.result @@ -14,8 +14,8 @@ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a 1 -2 128 +2 252 253 254 @@ -27,8 +27,8 @@ delete from t1 where a=253; select * from t1; a 1 -2 128 +2 252 254 255 @@ -64,19 +64,19 @@ count(*) 255 drop table t2; create table t3 (a tinyint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -89,9 +89,9 @@ a delete from t3 where a=125; select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -164,19 +164,19 @@ count(*) 65535 drop table t2; create table t3 (a smallint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -189,9 +189,9 @@ a delete from t3 where a=32765; select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -215,11 +215,11 @@ select * from t1; a 1 2 -65535 4294967292 4294967293 4294967294 4294967295 +65535 select * from t1 where a=4294967293; a 4294967293 @@ -228,19 +228,19 @@ select * from t1; a 1 2 -65535 4294967292 4294967294 4294967295 +65535 drop table t1; create table t2 (a int unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -264,19 +264,19 @@ count(*) 65535 drop table t2; create table t3 (a int not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -289,9 +289,9 @@ a delete from t3 where a=2147483645; select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -314,12 +314,12 @@ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), select * from t1; a 1 -2 -65535 16777212 16777213 16777214 16777215 +2 +65535 select * from t1 where a=16777213; a 16777213 @@ -327,11 +327,11 @@ delete from t1 where a=16777213; select * from t1; a 1 -2 -65535 16777212 16777214 16777215 +2 +65535 drop table t1; create table t2 (a mediumint unsigned not null, primary key(a)) engine='MYISAM' partition by key (a) partitions 8; @@ -364,19 +364,19 @@ count(*) 65535 drop table t2; create table t3 (a mediumint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -389,9 +389,9 @@ a delete from t3 where a=8388605; select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -414,24 +414,24 @@ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073 select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=-2; a delete from t1 where a=-2; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=18446744073709551615; a 18446744073709551615 @@ -439,20 +439,20 @@ delete from t1 where a=18446744073709551615; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 +2 +65535 drop table t1; create table t2 (a bigint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -476,19 +476,19 @@ count(*) 65535 drop table t2; create table t3 (a bigint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 @@ -501,9 +501,9 @@ a delete from t3 where a=9223372036854775806; select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 diff --git a/mysql-test/suite/parts/r/partition_int_ndb.result b/mysql-test/suite/parts/r/partition_int_ndb.result index 8bc095b2886..e7eb19ca6e5 100644 --- a/mysql-test/suite/parts/r/partition_int_ndb.result +++ b/mysql-test/suite/parts/r/partition_int_ndb.result @@ -1,29 +1,21 @@ -create table t1 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a tinyint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a 1 -2 128 +2 252 253 254 @@ -35,20 +27,20 @@ delete from t1 where a=253; select * from t1; a 1 -2 128 +2 252 254 255 drop table t1; -create table t2 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' +create table t2 (a tinyint unsigned not null, primary key(a)) engine='NDB' partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (255), (254), (253), (252); select * from t2; a @@ -71,20 +63,20 @@ select count(*) from t2; count(*) 255 drop table t2; -create table t3 (a tinyint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a tinyint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -97,35 +89,27 @@ a delete from t3 where a=125; select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 126 127 drop table t3; -create table t1 (a smallint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a smallint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -149,14 +133,14 @@ a 65534 65535 drop table t1; -create table t2 (a smallint unsigned not null, primary key(a)) engine='InnoDB' +create table t2 (a smallint unsigned not null, primary key(a)) engine='NDB' partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (65535), (65534), (65533), (65532); select * from t2; a @@ -179,20 +163,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a smallint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a smallint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -205,45 +189,37 @@ a delete from t3 where a=32765; select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 32766 32767 drop table t3; -create table t1 (a int unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a int unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a 1 2 -65535 4294967292 4294967293 4294967294 4294967295 +65535 select * from t1 where a=4294967293; a 4294967293 @@ -252,19 +228,19 @@ select * from t1; a 1 2 -65535 4294967292 4294967294 4294967295 +65535 drop table t1; -create table t2 (a int unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t2 (a int unsigned not null, primary key(a)) engine='NDB' +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -287,20 +263,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a int not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a int not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -313,45 +289,37 @@ a delete from t3 where a=2147483645; select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 2147483646 2147483647 drop table t3; -create table t1 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a mediumint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a 1 -2 -65535 16777212 16777213 16777214 16777215 +2 +65535 select * from t1 where a=16777213; a 16777213 @@ -359,20 +327,20 @@ delete from t1 where a=16777213; select * from t1; a 1 -2 -65535 16777212 16777214 16777215 +2 +65535 drop table t1; -create table t2 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' +create table t2 (a mediumint unsigned not null, primary key(a)) engine='NDB' partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (16777215), (16777214), (16777213), (16777212); select * from t2; a @@ -395,20 +363,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a mediumint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a mediumint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -421,57 +389,49 @@ a delete from t3 where a=8388605; select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 8388606 8388607 drop table t3; -create table t1 (a bigint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a bigint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=-2; a delete from t1 where a=-2; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=18446744073709551615; a 18446744073709551615 @@ -479,20 +439,20 @@ delete from t1 where a=18446744073709551615; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 +2 +65535 drop table t1; -create table t2 (a bigint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t2 (a bigint unsigned not null, primary key(a)) engine='NDB' +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -515,20 +475,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a bigint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a bigint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 @@ -541,9 +501,9 @@ a delete from t3 where a=9223372036854775806; select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 diff --git a/mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result b/mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result deleted file mode 100644 index ece6b84c227..00000000000 --- a/mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result +++ /dev/null @@ -1,726 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; ---- Doing pre test cleanup --- -DROP TABLE IF EXISTS t1; -CREATE LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile.dat' -INITIAL_SIZE 16M -UNDO_BUFFER_SIZE = 1M -ENGINE=NDB; -ALTER LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; -CREATE TABLESPACE ts1 -ADD DATAFILE 'datafile.dat' -USE LOGFILE GROUP lg1 -INITIAL_SIZE 12M -ENGINE NDB; -ALTER TABLESPACE ts1 -ADD DATAFILE 'datafile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; ---- Start test 2 partition RANGE testing -- ---- Do setup -- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY RANGE (YEAR(t)) -(PARTITION p0 VALUES LESS THAN (1901), -PARTITION p1 VALUES LESS THAN (1946), -PARTITION p2 VALUES LESS THAN (1966), -PARTITION p3 VALUES LESS THAN (1986), -PARTITION p4 VALUES LESS THAN (2005), -PARTITION p5 VALUES LESS THAN MAXVALUE); ---- Show table on master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Show table on slave -- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 2 partition RANGE testing --- ---- Do Cleanup --- -DROP TABLE IF EXISTS t1; ---- Start test 3 partition LIST testing --- ---- Do setup --- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY LIST(id) -(PARTITION p0 VALUES IN (2, 4), -PARTITION p1 VALUES IN (42, 142)); ---- Test 3 Alter to add partition --- -ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); ---- Show table on master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Show table on slave --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 3 partition LIST testing --- ---- Do Cleanup -- -DROP TABLE IF EXISTS t1; ---- Start test 4 partition HASH testing --- ---- Do setup --- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY HASH( YEAR(t) ) -PARTITIONS 4; ---- show that tables have been created correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 4 partition HASH testing --- ---- Do Cleanup -- -DROP TABLE IF EXISTS t1; ---- Start test 5 partition by key testing --- ---- Create Table Section --- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE,PRIMARY KEY(id)) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY KEY() -PARTITIONS 4; ---- Show that tables on master are ndbcluster tables --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`) -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Show that tables on slave --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`) -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Make sure that our tables on slave are still right type --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 5 key partition testing --- ---- Do Cleanup --- -DROP TABLE IF EXISTS t1; -alter tablespace ts1 -drop datafile 'datafile.dat' -engine=ndb; -alter tablespace ts1 -drop datafile 'datafile02.dat' -engine=ndb; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index d7c7dba6204..c2707f5a763 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -1,22 +1,11 @@ -ndb_blob_partition : cannot create t1 -ndb_dd_backuprestore : cannot create t1 -ndb_partition_error : cannot create t1 -ndb_partition_list : cannot create t1 -ndb_partition_range : cannot create t1 -part_supported_sql_func_ndb : cannot create t1 -partition_alter1_1_ndb : test works, but runs too long on PB -partition_alter1_1_2_ndb : test works, but runs too long on PB -partition_alter1_2_ndb : test works, but runs too long on PB -partition_alter2_ndb : cannot create t1 -partition_basic_ndb : cannot create t1 -partition_bit_ndb : cannot create t1 -partition_engine_ndb : cannot create t1 -partition_int_ndb : cannot create t1 +partition_alter2_ndb : Bug#18735 Not supported +partition_basic_ndb : Bug#19899 Crashing the server +# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html +partition_bit_ndb : NDB does not support bit column in index partition_sessions : needs system_3_init.inc -partition_syntax_ndb : cannot create t1 +partition_syntax_ndb : Bug#36735 Not supported partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function -partition_value_ndb : cannot create t1 -rpl_ndb_dd_partitions : cannot create t1 +partition_value_ndb : Bug#30581 partition_value tests use disallowed CAST() function partition_alter4_myisam : Bug#20129 / WL#4176 partition_alter4_innodb : Bug#20129 / WL#4176 diff --git a/mysql-test/suite/parts/t/ndb_blob_partition.test b/mysql-test/suite/parts/t/ndb_blob_partition.test deleted file mode 100644 index a3948cc9491..00000000000 --- a/mysql-test/suite/parts/t/ndb_blob_partition.test +++ /dev/null @@ -1,93 +0,0 @@ ---source include/have_ndb.inc --- source include/not_embedded.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Minimal NDB blobs test with range partitions. -# - -create table t1 ( - a mediumint not null, - b text not null, - c int not null, - d longblob, - primary key using hash (a,c), - unique key (c) -) - engine=ndb - partition by range (c) - partitions 3 - ( partition p1 values less than (200), - partition p2 values less than (300), - partition p3 values less than (400)); - ---disable_query_log -sleep 1; - -# length 61 -set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau'; -set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz'; -set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah'; - -set @v1 = repeat(@s0, 100); -- 1d42dd9090cf78314a06665d4ea938c35cc760f4 -set @v2 = repeat(@s1, 200); -- 10d3c783026b310218d10b7188da96a2401648c6 -set @v3 = repeat(@s2, 300); -- a33549d9844092289a58ac348dd59f09fc28406a -set @v4 = repeat(@s0, 400); -- daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -set @v5 = repeat(@s1, 500); -- 70fc9a7d08beebc522258bfb02000a30c77a8f1d -set @v6 = repeat(@s2, 600); -- 090565c580809efed3d369481a4bbb168b20713e -set @v7 = repeat(@s0, 700); -- 1e0070bec426871a46291de27b9bd6e4255ab4e5 -set @v8 = repeat(@s1, 800); -- acbaba01bc2e682f015f40e79d9cbe475db3002e -set @v9 = repeat(@s2, 900); -- 9ee30d99162574f79c66ae95cdf132dcf9cbc259 ---enable_query_log - -# -- insert -- -insert into t1 values (1, @v1, 101, @v2); -insert into t1 values (1, @v2, 102, @v3); -insert into t1 values (1, @v3, 103, @v4); -insert into t1 values (2, @v4, 201, @v5); -insert into t1 values (2, @v5, 202, @v6); -insert into t1 values (2, @v6, 203, @v7); -insert into t1 values (3, @v7, 301, @v8); -insert into t1 values (3, @v8, 302, @v9); -insert into t1 values (3, @v9, 303, @v1); -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- pk read -- -select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101; -select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201; -select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301; - -# -- pk update -- -update t1 set b = @v3, d = @v4 where a = 1 and c = 102; -update t1 set b = @v6, d = @v7 where a = 2 and c = 202; -update t1 set b = @v9, d = @v1 where a = 3 and c = 302; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- hash index update -- -update t1 set b = @v4, d = @v5 where c = 103; -update t1 set b = @v7, d = @v8 where c = 203; -update t1 set b = @v1, d = @v2 where c = 303; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- full scan update -- -update t1 set b = @v5, d = @v6; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- range scan update -update t1 set b = @v1, d = @v2 where 100 < c and c < 200; -update t1 set b = @v4, d = @v5 where 200 < c and c < 300; -update t1 set b = @v7, d = @v8 where 300 < c and c < 400; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- delete -- -delete from t1 where a = 1 and c = 101; -delete from t1 where c = 102; -# delete from t1 where c < 300; # XXX coredump -delete from t1; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- clean up -- -drop table t1; diff --git a/mysql-test/suite/parts/t/ndb_dd_backuprestore.test b/mysql-test/suite/parts/t/ndb_dd_backuprestore.test index be6d73e27b4..d2f79028c3f 100644 --- a/mysql-test/suite/parts/t/ndb_dd_backuprestore.test +++ b/mysql-test/suite/parts/t/ndb_dd_backuprestore.test @@ -5,6 +5,10 @@ ######################################## -- source include/have_ndb.inc +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log --disable_warnings DROP TABLE IF EXISTS test.t1; diff --git a/mysql-test/suite/parts/t/ndb_partition_error.test b/mysql-test/suite/parts/t/ndb_partition_error.test deleted file mode 100644 index 06581f1270f..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_error.test +++ /dev/null @@ -1,71 +0,0 @@ --- source include/have_ndb.inc -#--disable_abort_on_error -# -# Simple test for the partition storage engine -# Focuses on range partitioning tests -# -#-- source include/have_partition.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Partition by range, generate node group error -# ---error 1005 -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5) nodegroup 12, - partition x2 values less than (10) nodegroup 13, - partition x3 values less than (20) nodegroup 14); -show warnings; - -# -# Partition by range, create normal valid table -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), - partition x2 values less than (10), - partition x3 values less than (20)); - -drop table t1; - -# -# Bug #17763 mysqld cores with list partitioning if update to missing partition -# -CREATE TABLE t1 (id INT) ENGINE=NDB - PARTITION BY LIST(id) - (PARTITION p0 VALUES IN (2, 4), - PARTITION p1 VALUES IN (42, 142)); -INSERT INTO t1 VALUES (2); ---error ER_NO_PARTITION_FOR_GIVEN_VALUE -UPDATE t1 SET id=5 WHERE id=2; -DROP TABLE t1; - -# -# NULL for LIST partition -# -create table t1 (a int,b int, c int) -engine = ndb -partition by list(a) -partitions 2 -(partition x123 values in (11, 12), - partition x234 values in (5, 1)); ---error ER_NO_PARTITION_FOR_GIVEN_VALUE -insert into t1 values (NULL,1,1); -drop table t1; diff --git a/mysql-test/suite/parts/t/ndb_partition_key.test b/mysql-test/suite/parts/t/ndb_partition_key.test deleted file mode 100644 index 36a8a1863aa..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_key.test +++ /dev/null @@ -1,208 +0,0 @@ --- source include/have_ndb.inc - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -# -# Basic syntax test -# - -# Support for partition key verified -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c)) - ENGINE = NDB - PARTITION BY KEY (a,b); - -insert into t1 values (1,1,1,1); -select * from t1; -update t1 set d = 2 where a = 1 and b = 1 and c = 1; -select * from t1; -delete from t1; -select * from t1; - -drop table t1; - -# only support for partition key on primary key ---error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b)) - ENGINE = NDB - PARTITION BY KEY (c); - -CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b)) - ENGINE = NDB - PARTITION BY KEY (a); - -insert into t1 values - (1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3), - (1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3); - -select * from t1 order by b; - -DROP TABLE t1; - -# -# Test partition and char support -# - -CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT, - PRIMARY KEY (a,b,c) USING HASH) - ENGINE=NDB - DEFAULT CHARSET=latin1 - PARTITION BY KEY (b); - -insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1); - -# should show only one attribute with DISTRIBUTION KEY ---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | sed 's/Version: [0-9]*//' | sed 's/\(Length of frm data: \)[0-9]*/\1#/' - -# -# Test that explicit partition info is not shown in show create table -# result should not contain (PARTITION P0 ... etc) since this is what shows up in -# mysqldump, and we don't want that info there -# -show create table t1; - -DROP TABLE t1; - -# -# Bug #13155: Problem in Create Table using SHOW CREATE TABLE syntax -# -CREATE TABLE t1 (a int not null primary key) -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); - -drop table t1; - -CREATE TABLE t1 (a int not null primary key); -ALTER TABLE t1 -ENGINE = NDB -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); - -drop table t1; - -CREATE TABLE t1 (a int not null primary key) ENGINE = NDB; -ALTER TABLE t1 -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); - -drop table t1; - -# -# Bug #17754 Improper handling of removal of partitioning in ALTER TABLE -# Also added a number of general test cases in the same area -# -create table t1 (a int) -engine=ndb -partition by key(a) -(partition p0, partition p1); -show create table t1; - -alter table t1 engine=heap; -show create table t1; - -alter table t1 engine=ndb; -show create table t1; - -alter table t1 engine=heap remove partitioning; -show create table t1; - -alter table t1 engine=ndb -partition by key(a) -(partition p0, partition p1 engine = ndb); -show create table t1; - -alter table t1 -partition by key (a) -(partition p0 engine=ndb, partition p1 engine=ndb); -show create table t1; - -alter table t1 remove partitioning; -show create table t1; - -#--error ER_MIX_HANDLER_ERROR -# after fixing bug#31931 this works -# since it already have ndb on table level -alter table t1 -partition by key(a) -(partition p0 engine=ndb, partition p1); - -alter table t1 -engine=ndb -partition by key(a) -(partition p0 engine=ndb, partition p1 engine = ndb); -show create table t1; - -drop table t1; - -# -# BUG 16810 Out of memory when coalesce partition -# -CREATE TABLE t1 ( - c1 MEDIUMINT NOT NULL AUTO_INCREMENT, - c2 TEXT NOT NULL, - c3 INT NOT NULL, - c4 BIT NOT NULL, - c5 FLOAT, - c6 VARCHAR(255), - c7 TIMESTAMP, - PRIMARY KEY(c1,c3)) - ENGINE=NDB - PARTITION BY KEY(c3) PARTITIONS 5; - -let $j= 11; ---disable_query_log -while ($j) -{ - eval INSERT INTO t1 VALUES (NULL, "Tested Remotely from Texas, USA", $j, -b'0', - $j.00,"By JBM $j","2006-01-26"); - dec $j; -} ---enable_query_log -ALTER TABLE t1 COALESCE PARTITION 4; - -DROP TABLE t1; - -# -# Bug 16822: OPTIMIZE TABLE hangs test -# -CREATE TABLE t1 (a int primary key) -ENGINE=NDB -PARTITION BY KEY(a); ---error 1031 -ALTER TABLE t1 OPTIMIZE PARTITION p0; ---error 1031 -ALTER TABLE t1 CHECK PARTITION p0; ---error 1031 -ALTER TABLE t1 REPAIR PARTITION p0; ---error 1031 -ALTER TABLE t1 ANALYZE PARTITION p0; ---error 1031 -ALTER TABLE t1 REBUILD PARTITION p0; -DROP TABLE t1; - -# -# BUG 16806: ALTER TABLE fails -# -CREATE TABLE t1 ( - c1 MEDIUMINT NOT NULL AUTO_INCREMENT, - c2 TEXT NOT NULL, - c3 INT NOT NULL, - PRIMARY KEY(c1,c3)) - ENGINE=NDB - PARTITION BY KEY(c3) PARTITIONS 5; - -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; - -CREATE TABLE t1 ( - c1 MEDIUMINT NOT NULL AUTO_INCREMENT, - c2 TEXT NOT NULL, - c3 INT NOT NULL, - PRIMARY KEY(c1,c3)) - ENGINE=NDB - PARTITION BY KEY(c3); - -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; diff --git a/mysql-test/suite/parts/t/ndb_partition_list.test b/mysql-test/suite/parts/t/ndb_partition_list.test deleted file mode 100644 index 2ad37b8768c..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_list.test +++ /dev/null @@ -1,64 +0,0 @@ ---source include/have_ndb.inc -# -# Simple test for the partition storage engine -# Focuses on range partitioning tests -# -#-- source include/have_partition.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Partition by list, basic -# - -CREATE TABLE t1 ( f_int1 INTEGER NOT NULL, f_int2 INTEGER NOT NULL, - f_char1 CHAR(10), - f_char2 CHAR(10), f_charbig VARCHAR(1000), -PRIMARY KEY (f_int1,f_int2)) -ENGINE = NDB -PARTITION BY LIST(MOD(f_int1 + f_int2,4)) -(PARTITION part_3 VALUES IN (-3), - PARTITION part_2 VALUES IN (-2), - PARTITION part_1 VALUES IN (-1), - PARTITION part0 VALUES IN (0), - PARTITION part1 VALUES IN (1), - PARTITION part2 VALUES IN (2), - PARTITION part3 VALUES IN (3,4,5)); - -INSERT INTO t1 SET f_int1 = -2, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 3, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 4, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 5, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; - -SELECT * FROM t1 ORDER BY f_int1; - -DROP TABLE t1; - -# -# Partition by list, no pk -# - -CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(10), - f_char2 CHAR(10), f_charbig VARCHAR(1000)) -ENGINE = NDB -PARTITION BY LIST(f_int1) -(PARTITION part_1 VALUES IN (-1), - PARTITION part0 VALUES IN (0,1), - PARTITION part1 VALUES IN (2)); - -INSERT INTO t1 SET f_int1 = -1, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 0, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; ---error ER_NO_PARTITION_FOR_GIVEN_VALUE -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; - -SELECT * FROM t1 ORDER BY f_int1; - -DROP TABLE t1; - diff --git a/mysql-test/suite/parts/t/ndb_partition_range.test b/mysql-test/suite/parts/t/ndb_partition_range.test deleted file mode 100644 index 981467d4055..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_range.test +++ /dev/null @@ -1,260 +0,0 @@ --- source include/have_ndb.inc -#--disable_abort_on_error -# -# Simple test for the partition storage engine -# Focuses on range partitioning tests -# -#-- source include/have_partition.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Partition by range, basic -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), - partition x2 values less than (10), - partition x3 values less than (20)); - -# Simple insert and verify test -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (6, 1, 1); -INSERT into t1 values (10, 1, 1); -INSERT into t1 values (15, 1, 1); - ---replace_column 16 # 19 # 20 # -select * from information_schema.partitions where table_name= 't1'; - -select * from t1 order by a; - -select * from t1 where a=1 order by a; -select * from t1 where a=15 and b=1 order by a; -select * from t1 where a=21 and b=1 order by a; -select * from t1 where a=21 order by a; -select * from t1 where a in (1,6,10,21) order by a; -select * from t1 where b=1 and a in (1,6,10,21) order by a; - -drop table t1; - -# -# Partition by range, basic -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(b), -unique (a)) -engine = ndb -partition by range (b) -partitions 3 -(partition x1 values less than (5), - partition x2 values less than (10), - partition x3 values less than (20)); - -# Simple insert and verify test -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (2, 6, 1); -INSERT into t1 values (3, 10, 1); -INSERT into t1 values (4, 15, 1); - -select * from t1 order by a; -UPDATE t1 set a = 5 WHERE b = 15; -select * from t1 order by a; -UPDATE t1 set a = 6 WHERE a = 5; -select * from t1 order by a; - -select * from t1 where b=1 order by b; -select * from t1 where b=15 and a=1 order by b; -select * from t1 where b=21 and a=1 order by b; -select * from t1 where b=21 order by b; -select * from t1 where b in (1,6,10,21) order by b; -select * from t1 where a in (1,2,5,6) order by b; -select * from t1 where a=1 and b in (1,6,10,21) order by b; - -DELETE from t1 WHERE b = 6; -DELETE from t1 WHERE a = 6; - -# -# Test that explicit partition info _is_ shown in show create table -# result _should_ contain (PARTITION x1 ... etc) -# -show create table t1; - -drop table t1; - -# -# Bug #17499, #17687 -# Alter partitioned NDB table causes mysqld to core -# - -CREATE TABLE t1 - (id MEDIUMINT NOT NULL, - b1 BIT(8), - vc VARCHAR(255), - bc CHAR(255), - d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, - total BIGINT UNSIGNED, - y YEAR, - t DATE) ENGINE=NDB - PARTITION BY RANGE (YEAR(t)) - (PARTITION p0 VALUES LESS THAN (1901), - PARTITION p1 VALUES LESS THAN (1946), - PARTITION p2 VALUES LESS THAN (1966), - PARTITION p3 VALUES LESS THAN (1986), - PARTITION p4 VALUES LESS THAN (2005), - PARTITION p5 VALUES LESS THAN MAXVALUE); - -INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -ALTER TABLE t1 ENGINE=MYISAM; -SELECT * FROM t1; -DROP TABLE t1; - -CREATE LOGFILE GROUP lg1 - ADD UNDOFILE 'undofile.dat' - INITIAL_SIZE 16M - UNDO_BUFFER_SIZE=1M - ENGINE=NDB; - -CREATE TABLESPACE ts1 - ADD DATAFILE 'datafile.dat' - USE LOGFILE GROUP lg1 - INITIAL_SIZE 12M - ENGINE NDB; - -CREATE TABLE test.t1 ( - a1 INT, - a2 TEXT NOT NULL, - a3 BIT NOT NULL, - a4 DECIMAL(8,3), - a5 INT NOT NULL, - a6 INT, - PRIMARY KEY(a1)) - TABLESPACE ts1 STORAGE DISK ENGINE=NDB - PARTITION BY LIST (a1) - (PARTITION p0 VALUES IN (1,2,3,4,5), - PARTITION p1 VALUES IN (6,7,8,9, 10), - PARTITION p2 VALUES IN (11, 12, 13, 14, 15)); - -# Alter table directly without any statements inbetween -ALTER TABLE test.t1 DROP COLUMN a6; -ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255); - -let $j= 15; ---disable_query_log -while ($j) -{ -eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA", -b'1',$j.00,$j+1,"By NIK $j"); -dec $j; -} ---enable_query_log -SELECT COUNT(*) FROM test.t1; - -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; - -DROP TABLE t1; - -CREATE TABLE test.t1 ( - a1 INT, - a2 TEXT NOT NULL, - a3 BIT NOT NULL, - a4 DECIMAL(8,3), - a5 INT NOT NULL, - a6 VARCHAR(255), - PRIMARY KEY(a1)) - TABLESPACE ts1 STORAGE DISK ENGINE=NDB - PARTITION BY HASH(a1) - PARTITIONS 4; - -let $j= 15; ---disable_query_log -while ($j) -{ -eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA", -b'1',$j.00,$j+1,"By NIK $j"); -dec $j; -} ---enable_query_log -SELECT COUNT(*) FROM test.t1; - -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; - -DROP TABLE t1; - -ALTER TABLESPACE ts1 - DROP DATAFILE 'datafile.dat' - ENGINE=NDB; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; - - -# -# Bug #17701 ALTER TABLE t1 ADD PARTITION for PARTITION BY LIST hangs test -# - -CREATE TABLE t1 - (id MEDIUMINT NOT NULL, - b1 BIT(8), - vc VARCHAR(255), - bc CHAR(255), - d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, - total BIGINT UNSIGNED, - y YEAR, - t DATE) ENGINE=NDB - PARTITION BY LIST(id) - (PARTITION p0 VALUES IN (2, 4), - PARTITION p1 VALUES IN (42, 142)); - -INSERT INTO t1 VALUES (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -ALTER TABLE t1 ADD PARTITION - (PARTITION p2 VALUES IN (412)); -SELECT * FROM t1; -DROP TABLE t1; - -# -# Bug #17806 Update on NDB table with list partition causes mysqld to core -# Bug #16385 Partitions: crash when updating a range partitioned NDB table -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null) -partition by list(a) -partitions 2 -(partition x123 values in (1,5,6), - partition x234 values in (4,7,8)); -INSERT into t1 VALUES (5,1,1); -select * from t1; -UPDATE t1 SET a=8 WHERE a=5 AND b=1; -select * from t1; -drop table t1; - -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) engine=ndb -PARTITION BY RANGE(f1) -( PARTITION part1 VALUES LESS THAN (2), -PARTITION part2 VALUES LESS THAN (1000)); -INSERT INTO t1 VALUES(1, '---1---'); -INSERT INTO t1 VALUES(2, '---2---'); -select * from t1 order by f1; -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2; -select * from t1 order by f1; -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1; -select * from t1 order by f1; -drop table t1; diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test b/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test index c21649ba396..5ac6b2a504f 100644 --- a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test +++ b/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test @@ -1,5 +1,5 @@ ################################################################################ -# t/part_supported_sql_funcs_myisam.test # +# t/part_supported_sql_funcs_ndb.test # # # # Purpose: # # Tests which SQL functions are allowed in partinioning clauses with # @@ -33,6 +33,14 @@ let $do_long_tests= 1; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'NDB'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log +let $max_8_partitions= 1; +let $no_reorg_partition= 1; +let $drop_partition_not_supported= 1; #------------------------------------------------------------------------------# --source suite/parts/inc/part_supported_sql_funcs_main.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test b/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test index 29f801afb09..1a8f1f311b6 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test @@ -26,6 +26,7 @@ #------------------------------------------------------------------------------# # General not engine specific settings and requirements +--source include/big_test.inc ##### Options, for debugging support ##### let $debug= 0; diff --git a/mysql-test/suite/parts/t/partition_alter1_1_ndb.test b/mysql-test/suite/parts/t/partition_alter1_1_ndb.test index fa6f99f8efe..1a031f0ef79 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_ndb.test @@ -26,6 +26,7 @@ #------------------------------------------------------------------------------# # General not engine specific settings and requirements +--source include/big_test.inc ##### Options, for debugging support ##### let $debug= 0; diff --git a/mysql-test/suite/parts/t/partition_alter1_2_ndb.test b/mysql-test/suite/parts/t/partition_alter1_2_ndb.test index f2e220cd5ab..497898fb089 100644 --- a/mysql-test/suite/parts/t/partition_alter1_2_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter1_2_ndb.test @@ -27,6 +27,7 @@ #------------------------------------------------------------------------------# # General not engine specific settings and requirements +--source include/big_test.inc ##### Options, for debugging support ##### let $debug= 0; diff --git a/mysql-test/suite/parts/t/partition_alter2_ndb.test b/mysql-test/suite/parts/t/partition_alter2_ndb.test index e9b4da93b7a..fd1437ede71 100644 --- a/mysql-test/suite/parts/t/partition_alter2_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter2_ndb.test @@ -50,7 +50,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_basic_ndb.test b/mysql-test/suite/parts/t/partition_basic_ndb.test index 273d92ac80d..48e569006de 100644 --- a/mysql-test/suite/parts/t/partition_basic_ndb.test +++ b/mysql-test/suite/parts/t/partition_basic_ndb.test @@ -50,7 +50,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_bit_ndb.test b/mysql-test/suite/parts/t/partition_bit_ndb.test index 94e4119031c..227d3d53401 100644 --- a/mysql-test/suite/parts/t/partition_bit_ndb.test +++ b/mysql-test/suite/parts/t/partition_bit_ndb.test @@ -1,9 +1,9 @@ ################################################################################ -# t/partition_bit.test # +# t/partition_bit_ndb.test # # # # Purpose: # # Tests around bit type # -# MyISAM branch # +# NDB branch # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -45,7 +45,12 @@ SET @max_row = 20; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'NDB'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Assign a big number smaller than the maximum value for partitions ##### # and smaller than the maximum value of SIGNED INTEGER let $MAX_VALUE= (2147483646); diff --git a/mysql-test/suite/parts/t/partition_engine_ndb.test b/mysql-test/suite/parts/t/partition_engine_ndb.test index 1e185c8ebaa..40d031eab69 100644 --- a/mysql-test/suite/parts/t/partition_engine_ndb.test +++ b/mysql-test/suite/parts/t/partition_engine_ndb.test @@ -49,7 +49,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested let $engine= 'ndbcluster'; --source include/have_ndb.inc +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_int_ndb.test b/mysql-test/suite/parts/t/partition_int_ndb.test index 0a60408292a..5e464ff75b5 100644 --- a/mysql-test/suite/parts/t/partition_int_ndb.test +++ b/mysql-test/suite/parts/t/partition_int_ndb.test @@ -1,9 +1,9 @@ ################################################################################ -# t/partition_int_ndb.test # +# t/partition_int_ndb.test # # # # Purpose: # # Tests around integer type # -# NDB branch # +# NDB branch # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -37,7 +37,14 @@ let $debug= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'NDB'; +connection default; +##### max rows to be inserted +let $maxrows=1024; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_tinyint.inc diff --git a/mysql-test/suite/parts/t/partition_syntax_ndb.test b/mysql-test/suite/parts/t/partition_syntax_ndb.test index 90b74452ab1..c783e9f602e 100644 --- a/mysql-test/suite/parts/t/partition_syntax_ndb.test +++ b/mysql-test/suite/parts/t/partition_syntax_ndb.test @@ -49,7 +49,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_value_ndb.test b/mysql-test/suite/parts/t/partition_value_ndb.test index 91497c3ec42..2f948b95727 100644 --- a/mysql-test/suite/parts/t/partition_value_ndb.test +++ b/mysql-test/suite/parts/t/partition_value_ndb.test @@ -49,7 +49,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test b/mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test deleted file mode 100644 index 9291f38e8db..00000000000 --- a/mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test +++ /dev/null @@ -1,310 +0,0 @@ -####################################### -# Author: JBM # -# Date: 2006-03-09 # -# Purpose: To test the replication of # -# Cluster Disk Data using partitions # -####################################### - ---source include/have_ndb.inc ---source include/have_binlog_format_row.inc ---source include/master-slave.inc - ---echo --- Doing pre test cleanup --- - -connection master; ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_query_log - - -# Start by creating a logfile group -################################## - -CREATE LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile.dat' -INITIAL_SIZE 16M -UNDO_BUFFER_SIZE = 1M -ENGINE=NDB; - -ALTER LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; - -################################################### -# Create a tablespace connected to the logfile group -################################################### - -CREATE TABLESPACE ts1 -ADD DATAFILE 'datafile.dat' -USE LOGFILE GROUP lg1 -INITIAL_SIZE 12M -ENGINE NDB; - -ALTER TABLESPACE ts1 -ADD DATAFILE 'datafile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; - -################################################################# - ---echo --- Start test 2 partition RANGE testing -- ---echo --- Do setup -- - - -################################################# -# Requirment: Create table that is partitioned # -# by range on year i.e. year(t) and replicate # -# basice operations such at insert, update # -# delete between 2 different storage engines # -# Alter table and ensure table is handled # -# Correctly on the slave # -################################################# - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY RANGE (YEAR(t)) - (PARTITION p0 VALUES LESS THAN (1901), - PARTITION p1 VALUES LESS THAN (1946), - PARTITION p2 VALUES LESS THAN (1966), - PARTITION p3 VALUES LESS THAN (1986), - PARTITION p4 VALUES LESS THAN (2005), - PARTITION p5 VALUES LESS THAN MAXVALUE); - ---echo --- Show table on master --- - -SHOW CREATE TABLE t1; - ---echo --- Show table on slave -- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- ---enable_query_log - ---source include/rpl_multi_engine3.inc - ---echo --- End test 2 partition RANGE testing --- ---echo --- Do Cleanup --- - -DROP TABLE IF EXISTS t1; - -######################################################## - ---echo --- Start test 3 partition LIST testing --- ---echo --- Do setup --- -################################################# - - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY LIST(id) - (PARTITION p0 VALUES IN (2, 4), - PARTITION p1 VALUES IN (42, 142)); - ---echo --- Test 3 Alter to add partition --- - -ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); - ---echo --- Show table on master --- - -SHOW CREATE TABLE t1; - ---echo --- Show table on slave --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- End test 3 partition LIST testing --- ---echo --- Do Cleanup -- - -DROP TABLE IF EXISTS t1; - -######################################################## - ---echo --- Start test 4 partition HASH testing --- ---echo --- Do setup --- -################################################# - - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY HASH( YEAR(t) ) - PARTITIONS 4; - ---echo --- show that tables have been created correctly --- - -SHOW CREATE TABLE t1; -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- End test 4 partition HASH testing --- ---echo --- Do Cleanup -- - -DROP TABLE IF EXISTS t1; - -######################################################## - ---echo --- Start test 5 partition by key testing --- ---echo --- Create Table Section --- - -################################################# - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE,PRIMARY KEY(id)) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY KEY() - PARTITIONS 4; - ---echo --- Show that tables on master are ndbcluster tables --- - -SHOW CREATE TABLE t1; - ---echo --- Show that tables on slave --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - -# Okay lets see how it holds up to table changes ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still right type --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- End test 5 key partition testing --- ---echo --- Do Cleanup --- - -DROP TABLE IF EXISTS t1; -alter tablespace ts1 -drop datafile 'datafile.dat' -engine=ndb; -alter tablespace ts1 -drop datafile 'datafile02.dat' -engine=ndb; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; ---sync_slave_with_master - -# End of 5.1 test case From 8d5dc3a5f5debe642490d2b85d4caef84bb66dd9 Mon Sep 17 00:00:00 2001 From: Patrick Crews Date: Tue, 1 Jul 2008 14:44:47 -0400 Subject: [PATCH 058/352] Bug#37380 - Test funcs_1.is_columns_myisam_embedded fails on OS X Test was failing due to the addition of a '\x05' character in result sets Latest builds of the server have shown this problem to have disappeared. Removing code within the test that disables the test on Mac OS X. Recommit due to tree error on earlier, approved patch. --- mysql-test/suite/funcs_1/t/is_columns_myisam_embedded.test | 5 ----- 1 file changed, 5 deletions(-) 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 0d5f1a72cdb..3d0cca24474 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,11 +10,6 @@ # 2008-06-06 mleich Create this this variant for the embedded server. # -let $value= query_get_value(SHOW VARIABLES LIKE 'version_compile_os',Value,1); -if (`SELECT '$value' LIKE 'apple-darwin%'`) -{ - skip Bug#37380 Test funcs_1.is_columns_myisam_embedded fails on OS X; -} if (`SELECT VERSION() NOT LIKE '%embedded%'`) { --skip Test requires: embedded server From bbdcf6ca2177719424b933d0850a1db7d03a39c1 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Wed, 2 Jul 2008 16:37:29 +0200 Subject: [PATCH 059/352] Fix "C++ code in C file" syntax error in mysys/default.c --- mysys/default.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mysys/default.c b/mysys/default.c index eb7721acaed..bf32261129b 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1015,10 +1015,12 @@ static uint my_get_system_windows_directory(char *buffer, uint size) static const char *my_get_module_parent(char *buf, size_t size) { + char *last= NULL; + char *end; if (!GetModuleFileName(NULL, buf, size)) return NULL; + end= strend(buf); - char *last= NULL, *end= strend(buf); /* Look for the second-to-last \ in the filename, but hang on to a pointer after the last \ in case we're in the root of From b2c852d8fc4273fe7de085399510a6d602ec00d0 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 2 Jul 2008 17:04:45 +0200 Subject: [PATCH 060/352] BUG#37200: rpl_switch_stm_row_mixed fails sporadically in pushbuild The previous fix for the bug was incomplete. The test failed because t2 did not exist on the slave (since the slave was lagging) when the wait_condition was executed. Fixed by inserting sync_slave_with_master just after t2 was created. --- mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index 548dd0f1d62..b7948780c19 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -147,6 +147,9 @@ create table t5 select * from t1 where 3 in (select 1 union select 2 union selec # what if UUID() is first: insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); +sync_slave_with_master; +connection master; + # inside a stored procedure delimiter |; @@ -300,7 +303,7 @@ insert delayed into t2 values(@a); # sync_slave_with_master is later called). Instead, we wait until the # rows make it to t2 on the slave. connection slave; -let $wait_condition= SELECT COUNT(*) = 19 FROM t2; +let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2; --source include/wait_condition.inc connection master; From d47bf970ce2d7b47949244be1be525c156423293 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Thu, 3 Jul 2008 10:27:25 +0200 Subject: [PATCH 061/352] BUG#37200: rpl_switch_stm_row_mixed fails sporadically in pushbuild This bug has been fixed in two slightly different ways in 6.0-rpl and {5.1,6.0}-bugteam. To avoid future merge problems, I'm now copying the 6.0-rpl fix to 5.1-bugteam. --- mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index b7948780c19..e6c1d5256a0 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -147,9 +147,6 @@ create table t5 select * from t1 where 3 in (select 1 union select 2 union selec # what if UUID() is first: insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); -sync_slave_with_master; -connection master; - # inside a stored procedure delimiter |; @@ -301,8 +298,10 @@ insert delayed into t2 values(@a); # rows make it to t2 on the master (the rows may not be in the binlog # at that time, and may still not be in the binlog when # sync_slave_with_master is later called). Instead, we wait until the -# rows make it to t2 on the slave. -connection slave; +# rows make it to t2 on the slave. We first call +# sync_slave_with_master, so that we are sure that t2 has been created +# on the slave. +sync_slave_with_master; let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2; --source include/wait_condition.inc connection master; From 29defdb5f0b6a9540cf1c8a0bc239d48349f66c5 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Thu, 3 Jul 2008 23:41:22 +0400 Subject: [PATCH 062/352] A fix for Bug#12093 "SP not found on second PS execution if another thread drops other SP in between" and Bug#21294 "executing a prepared statement that executes a stored function which was recreat" Stored functions are resolved at prepared statement prepare only. If someone flushes the stored functions cache between prepare and execute, execution fails. The fix is to detect the situation of the cache flush and automatically reprepare the prepared statement after it. --- mysql-test/r/ps_ddl.result | 66 +++++++++++++++++++++--------------- mysql-test/r/ps_ddl1.result | 2 +- mysql-test/r/sp-error.result | 5 +-- mysql-test/t/ps_ddl.test | 50 +++++++++++++-------------- mysql-test/t/ps_ddl1.test | 2 +- mysql-test/t/sp-error.test | 4 --- sql/sp_cache.cc | 13 +++++++ sql/sp_cache.h | 1 + sql/sql_prepare.cc | 33 +++++++++++++++++- 9 files changed, 112 insertions(+), 64 deletions(-) diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result index a47c01cca17..58542f23cf2 100644 --- a/mysql-test/r/ps_ddl.result +++ b/mysql-test/r/ps_ddl.result @@ -290,7 +290,7 @@ SUCCESS # Test 7-b: dependent FUNCTION has changed # -# Note, this scenario is not supported, subject of Bug#12093 +# Note, this scenario is supported, subject of Bug#12093 # drop trigger t1_ai; create trigger t1_ai after insert on t1 for each row @@ -305,8 +305,7 @@ select @var; drop function f1; create function f1 (a int) returns int return 0; execute stmt using @var; -ERROR 42000: FUNCTION test.f1 does not exist -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(1); SUCCESS drop function f1; @@ -359,8 +358,14 @@ a drop view v1; create view v1 as select a from t2; set @var=8; +# XXX: bug, the SQL statement in the trigger is still +# pointing at table 't3', since the view was expanded +# at first statement execution. +# Repreparation of the main statement doesn't cause repreparation +# of trigger statements. execute stmt using @var; -call p_verify_reprepare_count(0); +ERROR 42S02: Table 'test.t3' doesn't exist +call p_verify_reprepare_count(1); SUCCESS # @@ -377,7 +382,6 @@ select * from t3; a 6 7 -8 flush table t1; set @var=9; execute stmt using @var; @@ -392,7 +396,6 @@ select * from t3; a 6 7 -8 drop view v1; drop table t1,t2,t3; # Test 7-d: dependent TABLE has changed @@ -798,14 +801,17 @@ SUCCESS drop function f1; create function f1() returns int return 2; -# XXX: Bug#12093. We only get a different error +# XXX: Used to be another manifestation of Bug#12093. +# We only used to get a different error # message because the non-existing procedure error is masked # by the view. execute stmt; -ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +f1() +2 execute stmt; -ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them -call p_verify_reprepare_count(0); +f1() +2 +call p_verify_reprepare_count(1); SUCCESS # Part 18b: dependent procedure has changed (referred to via a function) @@ -831,19 +837,20 @@ SUCCESS drop procedure p1; create procedure p1(out x int) select max(a) from t2 into x; -# XXX: bug. The prelocked list is not invalidated -# and we keep opening table t1, whereas the procedure +# XXX: used to be a bug. The prelocked list was not invalidated +# and we kept opening table t1, whereas the procedure # is now referring to table t2 execute stmt; -ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them -call p_verify_reprepare_count(0); +f1() +6 +call p_verify_reprepare_count(1); SUCCESS flush table t1; execute stmt; f1() 6 -call p_verify_reprepare_count(1); +call p_verify_reprepare_count(0); SUCCESS execute stmt; @@ -1528,7 +1535,6 @@ drop view v_27690_1; drop table v_27690_2; deallocate prepare stmt; #===================================================================== -# TODO: fix the below two bugs and modify their tests # # Bug#21294 Executing a prepared statement that executes # a stored function which was recreat @@ -1541,12 +1547,14 @@ f1() drop function f1; create function f1() returns int return 10; execute stmt; -ERROR 42000: FUNCTION test.f1 does not exist +f1() +10 drop function f1; create function f1() returns int return 20; execute stmt; -ERROR 42000: FUNCTION test.f1 does not exist -call p_verify_reprepare_count(0); +f1() +20 +call p_verify_reprepare_count(2); SUCCESS drop function f1; @@ -1573,19 +1581,21 @@ execute stmt_sp; a drop function f_12093_unrelated; drop procedure p_12093_unrelated; -# XXX: bug +# XXX: used to be a bug execute stmt_sf; -ERROR 42000: FUNCTION test.f_12093 does not exist -# XXX: bug +f_12093() +0 +# XXX: used to be a bug execute stmt_sp; -ERROR 42000: PROCEDURE test.p_12093 does not exist -# XXX: bug +a +# XXX: used to be a bug execute stmt_sf; -ERROR 42000: FUNCTION test.f_12093 does not exist -# XXX: bug +f_12093() +0 +# XXX: used to be a bug execute stmt_sp; -ERROR 42000: PROCEDURE test.p_12093 does not exist -call p_verify_reprepare_count(0); +a +call p_verify_reprepare_count(2); SUCCESS drop table t_12093; diff --git a/mysql-test/r/ps_ddl1.result b/mysql-test/r/ps_ddl1.result index 87abcd90590..e41a72ceb96 100644 --- a/mysql-test/r/ps_ddl1.result +++ b/mysql-test/r/ps_ddl1.result @@ -460,7 +460,7 @@ create schema mysqltest; end| execute stmt; ERROR 42000: PROCEDURE test.p1 does not exist -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(1); SUCCESS execute stmt; diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 5ac61821cea..cc383d003e9 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -796,7 +796,7 @@ bug11834_2() 10 drop function bug11834_1; execute stmt; -ERROR 42000: FUNCTION test.bug11834_2 does not exist +ERROR 42000: FUNCTION test.bug11834_1 does not exist deallocate prepare stmt; drop function bug11834_2; DROP FUNCTION IF EXISTS bug12953| @@ -1045,7 +1045,8 @@ select bug12329(); bug12329() 101 execute stmt1; -ERROR 42S02: Table 'test.t2' doesn't exist +bug12329() +101 deallocate prepare stmt1; drop function bug12329; drop table t1, t2; diff --git a/mysql-test/t/ps_ddl.test b/mysql-test/t/ps_ddl.test index cbfdaaffa0f..8899ca967ca 100644 --- a/mysql-test/t/ps_ddl.test +++ b/mysql-test/t/ps_ddl.test @@ -299,7 +299,7 @@ call p_verify_reprepare_count(0); --echo # Test 7-b: dependent FUNCTION has changed --echo # ---echo # Note, this scenario is not supported, subject of Bug#12093 +--echo # Note, this scenario is supported, subject of Bug#12093 --echo # drop trigger t1_ai; create trigger t1_ai after insert on t1 for each row @@ -311,9 +311,8 @@ execute stmt using @var; select @var; drop function f1; create function f1 (a int) returns int return 0; ---error ER_SP_DOES_NOT_EXIST execute stmt using @var; -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(1); drop function f1; deallocate prepare stmt; @@ -353,8 +352,14 @@ select * from t2; drop view v1; create view v1 as select a from t2; set @var=8; +--echo # XXX: bug, the SQL statement in the trigger is still +--echo # pointing at table 't3', since the view was expanded +--echo # at first statement execution. +--echo # Repreparation of the main statement doesn't cause repreparation +--echo # of trigger statements. +--error ER_NO_SUCH_TABLE execute stmt using @var; -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(1); --echo # --echo # Sic: the insert went into t3, even though the view now --echo # points at t2. This is because neither the merged view @@ -703,14 +708,13 @@ execute stmt; call p_verify_reprepare_count(0); drop function f1; create function f1() returns int return 2; ---echo # XXX: Bug#12093. We only get a different error +--echo # XXX: Used to be another manifestation of Bug#12093. +--echo # We only used to get a different error --echo # message because the non-existing procedure error is masked --echo # by the view. ---error ER_VIEW_INVALID execute stmt; ---error ER_VIEW_INVALID execute stmt; -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(1); --echo # Part 18b: dependent procedure has changed (referred to via a function) @@ -734,15 +738,14 @@ execute stmt; call p_verify_reprepare_count(0); drop procedure p1; create procedure p1(out x int) select max(a) from t2 into x; ---echo # XXX: bug. The prelocked list is not invalidated ---echo # and we keep opening table t1, whereas the procedure +--echo # XXX: used to be a bug. The prelocked list was not invalidated +--echo # and we kept opening table t1, whereas the procedure --echo # is now referring to table t2 ---error ER_VIEW_INVALID -execute stmt; -call p_verify_reprepare_count(0); -flush table t1; execute stmt; call p_verify_reprepare_count(1); +flush table t1; +execute stmt; +call p_verify_reprepare_count(0); execute stmt; --echo # Test 18-c: dependent VIEW has changed @@ -1326,7 +1329,6 @@ drop table v_27690_2; deallocate prepare stmt; --echo #===================================================================== ---echo # TODO: fix the below two bugs and modify their tests --echo # --echo # Bug#21294 Executing a prepared statement that executes --echo # a stored function which was recreat @@ -1341,15 +1343,13 @@ drop function f1; create function f1() returns int return 10; # might pass or fail, implementation dependent ---error ER_SP_DOES_NOT_EXIST execute stmt; drop function f1; create function f1() returns int return 20; ---error ER_SP_DOES_NOT_EXIST execute stmt; -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(2); drop function f1; deallocate prepare stmt; @@ -1388,20 +1388,16 @@ drop procedure p_12093_unrelated; connection default; ---echo # XXX: bug ---error ER_SP_DOES_NOT_EXIST +--echo # XXX: used to be a bug execute stmt_sf; ---echo # XXX: bug ---error ER_SP_DOES_NOT_EXIST +--echo # XXX: used to be a bug execute stmt_sp; ---echo # XXX: bug ---error ER_SP_DOES_NOT_EXIST +--echo # XXX: used to be a bug execute stmt_sf; ---echo # XXX: bug ---error ER_SP_DOES_NOT_EXIST +--echo # XXX: used to be a bug execute stmt_sp; -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(2); disconnect con1; diff --git a/mysql-test/t/ps_ddl1.test b/mysql-test/t/ps_ddl1.test index 0145d445a14..379ed576b5f 100644 --- a/mysql-test/t/ps_ddl1.test +++ b/mysql-test/t/ps_ddl1.test @@ -363,7 +363,7 @@ end| delimiter ;| --error ER_SP_DOES_NOT_EXIST execute stmt; -call p_verify_reprepare_count(0); +call p_verify_reprepare_count(1); --error ER_SP_DOES_NOT_EXIST execute stmt; call p_verify_reprepare_count(0); diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 6896a1ab832..1e329f7fe79 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1470,10 +1470,6 @@ execute stmt1; drop function bug12329; create function bug12329() returns int return (select a+100 from t2); select bug12329(); -# Until we implement proper mechanism for invalidation of PS/SP when table -# or SP's are changed the following statement will fail with 'Table ... was -# not locked' error (this mechanism should be based on the new TDC). ---error ER_NO_SUCH_TABLE execute stmt1; deallocate prepare stmt1; drop function bug12329; diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc index cc6ba9ef1d0..64898915b7e 100644 --- a/sql/sp_cache.cc +++ b/sql/sp_cache.cc @@ -210,6 +210,19 @@ void sp_cache_flush_obsolete(sp_cache **cp) } +/** + Return the current version of the cache. +*/ + +ulong sp_cache_version(sp_cache **cp) +{ + sp_cache *c= *cp; + if (c) + return c->version; + return 0; +} + + /************************************************************************* Internal functions *************************************************************************/ diff --git a/sql/sp_cache.h b/sql/sp_cache.h index 9d34c9a2fb5..f4d44a1f29f 100644 --- a/sql/sp_cache.h +++ b/sql/sp_cache.h @@ -58,5 +58,6 @@ void sp_cache_insert(sp_cache **cp, sp_head *sp); sp_head *sp_cache_lookup(sp_cache **cp, sp_name *name); void sp_cache_invalidate(); void sp_cache_flush_obsolete(sp_cache **cp); +ulong sp_cache_version(sp_cache **cp); #endif /* _SP_CACHE_H_ */ diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 73ab28a233c..16e4812655e 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -169,6 +169,8 @@ private: SELECT_LEX and other classes). */ MEM_ROOT main_mem_root; + /* Version of the stored functions cache at the time of prepare. */ + ulong m_sp_cache_version; private: bool set_db(const char *db, uint db_length); bool set_parameters(String *expanded_query, @@ -2819,7 +2821,8 @@ Prepared_statement::Prepared_statement(THD *thd_arg, Protocol *protocol_arg) param_array(0), param_count(0), last_errno(0), - flags((uint) IS_IN_USE) + flags((uint) IS_IN_USE), + m_sp_cache_version(0) { init_sql_alloc(&main_mem_root, thd_arg->variables.query_alloc_block_size, thd_arg->variables.query_prealloc_size); @@ -3072,6 +3075,20 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) init_stmt_after_parse(lex); state= Query_arena::PREPARED; flags&= ~ (uint) IS_IN_USE; + /* + This is for prepared statement validation purposes. + A statement looks up and pre-loads all its stored functions + at prepare. Later on, if a function is gone from the cache, + execute may fail. + Remember the cache version to be able to invalidate the prepared + statement at execute if it changes. + We only need to care about version of the stored functions cache: + if a prepared statement uses a stored procedure, it's indirect, + via a stored function. The only exception is SQLCOM_CALL, + but the latter one looks up the stored procedure each time + it's invoked, rather than once at prepare. + */ + m_sp_cache_version= sp_cache_version(&thd->sp_func_cache); /* Log COM_EXECUTE to the general log. Note, that in case of SQL @@ -3383,6 +3400,7 @@ Prepared_statement::swap_prepared_statement(Prepared_statement *copy) swap_variables(LEX_STRING, name, copy->name); /* Ditto */ swap_variables(char *, db, copy->db); + swap_variables(ulong, m_sp_cache_version, copy->m_sp_cache_version); DBUG_ASSERT(db_length == copy->db_length); DBUG_ASSERT(param_count == copy->param_count); @@ -3442,6 +3460,19 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) return TRUE; } + /* + Reprepare the statement if we're using stored functions + and the version of the stored routines cache has changed. + */ + if (lex->uses_stored_routines() && + m_sp_cache_version != sp_cache_version(&thd->sp_func_cache) && + thd->m_reprepare_observer && + thd->m_reprepare_observer->report_error(thd)) + { + return TRUE; + } + + /* For SHOW VARIABLES lex->result is NULL, as it's a non-SELECT command. For such queries we don't return an error and don't From 730847898d04a4212986e52a25f709a0ba73e6f2 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 4 Jul 2008 17:02:17 +0300 Subject: [PATCH 063/352] Bug#37627: Killing query with sum(exists()) or avg(exists()) reproducibly crashes server When there is an error executing EXISTS predicates they return NULL as their string or decimal value but don't set the NULL value flag. Fixed by returning 0 (as a decimal or a string) on error exectuting the subquery. Note that we can't return NULL as EXISTS is not supposed to return NULL. --- mysql-test/r/subselect.result | 13 ++++++++++++ mysql-test/t/subselect.test | 16 +++++++++++++++ sql/item_subselect.cc | 38 +++++++++++++++++++++++++++++------ 3 files changed, 61 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 923bc2254bd..04983ef19ab 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4398,3 +4398,16 @@ INSERT INTO t1 VALUES (1), (3); SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); a b DROP TABLE t1,t2; +CREATE TABLE t1(id INT); +INSERT INTO t1 VALUES (1),(2),(3),(4); +INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d; +INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c; +SET SESSION debug="d,subselect_exec_fail"; +SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1; +SUM(EXISTS(SELECT RAND() FROM t1)) +0 +SELECT REVERSE(EXISTS(SELECT RAND() FROM t1)); +REVERSE(EXISTS(SELECT RAND() FROM t1)) +0 +SET SESSION debug=DEFAULT; +DROP TABLE t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 85b21c83612..08e0f6592ab 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3298,3 +3298,19 @@ INSERT INTO t1 VALUES (1), (3); SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); DROP TABLE t1,t2; + +# +# Bug #37627: Killing query with sum(exists()) or avg(exists()) reproducibly +# crashes server +# + +CREATE TABLE t1(id INT); +INSERT INTO t1 VALUES (1),(2),(3),(4); +INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d; +INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c; +# Setup the mysqld to crash at certain point +SET SESSION debug="d,subselect_exec_fail"; +SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1; +SELECT REVERSE(EXISTS(SELECT RAND() FROM t1)); +SET SESSION debug=DEFAULT; +DROP TABLE t1; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index ea16f3c3518..3981b91a27c 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -254,6 +254,11 @@ bool Item_subselect::exec() if (thd->is_error()) /* Do not execute subselect in case of a fatal error */ return 1; + /* + Simulate a failure in sub-query execution. Used to test e.g. + out of memory or query being killed conditions. + */ + DBUG_EXECUTE_IF("subselect_exec_fail", return 1;); res= engine->exec(); @@ -719,27 +724,48 @@ longlong Item_exists_subselect::val_int() return value; } + +/** + Return the result of EXISTS as a string value + + Converts the true/false result into a string value. + Note that currently this cannot be NULL, so if the query exection fails + it will return 0. + + @param decimal_value[out] buffer to hold the resulting string value + @retval Pointer to the converted string. + Can't be a NULL pointer, as currently + EXISTS cannot return NULL. +*/ + String *Item_exists_subselect::val_str(String *str) { DBUG_ASSERT(fixed == 1); if (exec()) - { reset(); - return 0; - } str->set((ulonglong)value,&my_charset_bin); return str; } +/** + Return the result of EXISTS as a decimal value + + Converts the true/false result into a decimal value. + Note that currently this cannot be NULL, so if the query exection fails + it will return 0. + + @param decimal_value[out] Buffer to hold the resulting decimal value + @retval Pointer to the converted decimal. + Can't be a NULL pointer, as currently + EXISTS cannot return NULL. +*/ + my_decimal *Item_exists_subselect::val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); if (exec()) - { reset(); - return 0; - } int2my_decimal(E_DEC_FATAL_ERROR, value, 0, decimal_value); return decimal_value; } From 43ba41548e8810b00cf563b752c4c085cbd5e7e1 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Fri, 4 Jul 2008 12:41:27 -0400 Subject: [PATCH 064/352] Bug#30563: Is not possible to create rpl_ or innodb test if needed \ to use ANSI_QUOTES Make all have_* tests universally safe by using ANSI quotes. --- mysql-test/include/have_archive.inc | 2 +- mysql-test/include/have_bdb.inc | 2 +- mysql-test/include/have_big5.inc | 2 +- mysql-test/include/have_blackhole.inc | 2 +- mysql-test/include/have_case_sensitive_file_system.inc | 2 +- mysql-test/include/have_compress.inc | 2 +- mysql-test/include/have_cp1250_ch.inc | 2 +- mysql-test/include/have_cp932.inc | 2 +- mysql-test/include/have_crypt.inc | 2 +- mysql-test/include/have_csv.inc | 2 +- mysql-test/include/have_eucjpms.inc | 2 +- mysql-test/include/have_euckr.inc | 2 +- mysql-test/include/have_exampledb.inc | 2 +- mysql-test/include/have_federated_db.inc | 2 +- mysql-test/include/have_gb2312.inc | 2 +- mysql-test/include/have_gbk.inc | 2 +- mysql-test/include/have_geometry.inc | 2 +- mysql-test/include/have_innodb.inc | 2 +- mysql-test/include/have_latin2_ch.inc | 2 +- mysql-test/include/have_log_bin.inc | 2 +- mysql-test/include/have_lowercase0.inc | 2 +- mysql-test/include/have_multi_ndb.inc | 4 ++-- mysql-test/include/have_ndb.inc | 2 +- mysql-test/include/have_query_cache.inc | 2 +- mysql-test/include/have_sjis.inc | 2 +- mysql-test/include/have_ssl.inc | 2 +- mysql-test/include/have_tis620.inc | 2 +- mysql-test/include/have_ucs2.inc | 2 +- mysql-test/include/have_udf.inc | 2 +- mysql-test/include/have_ujis.inc | 2 +- 30 files changed, 31 insertions(+), 31 deletions(-) diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc index 262f66076a8..75460316322 100644 --- a/mysql-test/include/have_archive.inc +++ b/mysql-test/include/have_archive.inc @@ -1,4 +1,4 @@ --require r/have_archive.require --disable_query_log -show variables like "have_archive"; +show variables like 'have_archive'; --enable_query_log diff --git a/mysql-test/include/have_bdb.inc b/mysql-test/include/have_bdb.inc index 3f7377e7515..c2f29e0d286 100644 --- a/mysql-test/include/have_bdb.inc +++ b/mysql-test/include/have_bdb.inc @@ -1,4 +1,4 @@ -- require r/have_bdb.require disable_query_log; -show variables like "have_bdb"; +show variables like 'have_bdb'; enable_query_log; diff --git a/mysql-test/include/have_big5.inc b/mysql-test/include/have_big5.inc index 790e8085e1a..dad4a0a8eeb 100644 --- a/mysql-test/include/have_big5.inc +++ b/mysql-test/include/have_big5.inc @@ -1,4 +1,4 @@ -- require r/have_big5.require disable_query_log; -show collation like "big5_chinese_ci"; +show collation like 'big5_chinese_ci'; enable_query_log; diff --git a/mysql-test/include/have_blackhole.inc b/mysql-test/include/have_blackhole.inc index c2b6ea18830..d13c9fda3f5 100644 --- a/mysql-test/include/have_blackhole.inc +++ b/mysql-test/include/have_blackhole.inc @@ -1,4 +1,4 @@ -- require r/have_blackhole.require disable_query_log; -show variables like "have_blackhole_engine"; +show variables like 'have_blackhole_engine'; enable_query_log; diff --git a/mysql-test/include/have_case_sensitive_file_system.inc b/mysql-test/include/have_case_sensitive_file_system.inc index 730af975497..7bb1bef93fd 100644 --- a/mysql-test/include/have_case_sensitive_file_system.inc +++ b/mysql-test/include/have_case_sensitive_file_system.inc @@ -1,4 +1,4 @@ --require r/case_sensitive_file_system.require --disable_query_log -show variables like "lower_case_file_system"; +show variables like 'lower_case_file_system'; --enable_query_log diff --git a/mysql-test/include/have_compress.inc b/mysql-test/include/have_compress.inc index c042cd7452a..150c7f3448d 100644 --- a/mysql-test/include/have_compress.inc +++ b/mysql-test/include/have_compress.inc @@ -1,4 +1,4 @@ -- require r/have_compress.require disable_query_log; -show variables like "have_compress"; +show variables like 'have_compress'; enable_query_log; diff --git a/mysql-test/include/have_cp1250_ch.inc b/mysql-test/include/have_cp1250_ch.inc index eec5d69fbd6..426fa658597 100644 --- a/mysql-test/include/have_cp1250_ch.inc +++ b/mysql-test/include/have_cp1250_ch.inc @@ -1,4 +1,4 @@ -- require r/have_cp1250_ch.require disable_query_log; -show collation like "cp1250_czech_cs"; +show collation like 'cp1250_czech_cs'; enable_query_log; diff --git a/mysql-test/include/have_cp932.inc b/mysql-test/include/have_cp932.inc index b500dac0bbe..ecad979c02a 100644 --- a/mysql-test/include/have_cp932.inc +++ b/mysql-test/include/have_cp932.inc @@ -1,4 +1,4 @@ -- require r/have_cp932.require disable_query_log; -show collation like "cp932_japanese_ci"; +show collation like 'cp932_japanese_ci'; enable_query_log; diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc index fe1f974bffd..cbf0a7ac876 100644 --- a/mysql-test/include/have_crypt.inc +++ b/mysql-test/include/have_crypt.inc @@ -1,4 +1,4 @@ -- require r/have_crypt.require disable_query_log; -show variables like "have_crypt"; +show variables like 'have_crypt'; enable_query_log; diff --git a/mysql-test/include/have_csv.inc b/mysql-test/include/have_csv.inc index d28199831b8..12e69962486 100644 --- a/mysql-test/include/have_csv.inc +++ b/mysql-test/include/have_csv.inc @@ -1,4 +1,4 @@ -- require r/have_csv.require disable_query_log; -show variables like "have_csv"; +show variables like 'have_csv'; enable_query_log; diff --git a/mysql-test/include/have_eucjpms.inc b/mysql-test/include/have_eucjpms.inc index a5e1a5ac547..6d96eefcc31 100644 --- a/mysql-test/include/have_eucjpms.inc +++ b/mysql-test/include/have_eucjpms.inc @@ -1,4 +1,4 @@ -- require r/have_eucjpms.require disable_query_log; -show collation like "eucjpms_japanese_ci"; +show collation like 'eucjpms_japanese_ci'; enable_query_log; diff --git a/mysql-test/include/have_euckr.inc b/mysql-test/include/have_euckr.inc index af794aafc04..4b4e870cf47 100644 --- a/mysql-test/include/have_euckr.inc +++ b/mysql-test/include/have_euckr.inc @@ -1,4 +1,4 @@ -- require r/have_euckr.require disable_query_log; -show collation like "euckr_korean_ci"; +show collation like 'euckr_korean_ci'; enable_query_log; diff --git a/mysql-test/include/have_exampledb.inc b/mysql-test/include/have_exampledb.inc index 7ddd15c48b3..b8f9a24463e 100644 --- a/mysql-test/include/have_exampledb.inc +++ b/mysql-test/include/have_exampledb.inc @@ -1,4 +1,4 @@ -- require r/have_exampledb.require disable_query_log; -show variables like "have_example_engine"; +show variables like 'have_example_engine'; enable_query_log; diff --git a/mysql-test/include/have_federated_db.inc b/mysql-test/include/have_federated_db.inc index e4cf1366fda..4745534780d 100644 --- a/mysql-test/include/have_federated_db.inc +++ b/mysql-test/include/have_federated_db.inc @@ -1,4 +1,4 @@ -- require r/have_federated_db.require disable_query_log; -show variables like "have_federated_engine"; +show variables like 'have_federated_engine'; enable_query_log; diff --git a/mysql-test/include/have_gb2312.inc b/mysql-test/include/have_gb2312.inc index 4328bc67639..27591c01b6c 100644 --- a/mysql-test/include/have_gb2312.inc +++ b/mysql-test/include/have_gb2312.inc @@ -1,4 +1,4 @@ -- require r/have_gb2312.require disable_query_log; -show collation like "gb2312_chinese_ci"; +show collation like 'gb2312_chinese_ci'; enable_query_log; diff --git a/mysql-test/include/have_gbk.inc b/mysql-test/include/have_gbk.inc index 55805da0495..72252d6b00d 100644 --- a/mysql-test/include/have_gbk.inc +++ b/mysql-test/include/have_gbk.inc @@ -1,4 +1,4 @@ -- require r/have_gbk.require disable_query_log; -show collation like "gbk_chinese_ci"; +show collation like 'gbk_chinese_ci'; enable_query_log; diff --git a/mysql-test/include/have_geometry.inc b/mysql-test/include/have_geometry.inc index f0ec22af172..f1836469017 100644 --- a/mysql-test/include/have_geometry.inc +++ b/mysql-test/include/have_geometry.inc @@ -1,4 +1,4 @@ --require r/have_geometry.require --disable_query_log -show variables like "have_geometry"; +show variables like 'have_geometry'; --enable_query_log diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc index 4f83d378cbc..4142b84813b 100644 --- a/mysql-test/include/have_innodb.inc +++ b/mysql-test/include/have_innodb.inc @@ -1,4 +1,4 @@ -- require r/have_innodb.require disable_query_log; -show variables like "have_innodb"; +show variables like 'have_innodb'; enable_query_log; diff --git a/mysql-test/include/have_latin2_ch.inc b/mysql-test/include/have_latin2_ch.inc index 9d3ee6b341c..215715a6aaf 100644 --- a/mysql-test/include/have_latin2_ch.inc +++ b/mysql-test/include/have_latin2_ch.inc @@ -1,4 +1,4 @@ -- require r/have_latin2_ch.require disable_query_log; -show collation like "latin2_czech_cs"; +show collation like 'latin2_czech_cs'; enable_query_log; diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc index 11530dc953e..5bcdb30b3e0 100644 --- a/mysql-test/include/have_log_bin.inc +++ b/mysql-test/include/have_log_bin.inc @@ -1,4 +1,4 @@ -- require r/have_log_bin.require disable_query_log; -show variables like "log_bin"; +show variables like 'log_bin'; enable_query_log; diff --git a/mysql-test/include/have_lowercase0.inc b/mysql-test/include/have_lowercase0.inc index 8d3ae02f61e..6192acb7b01 100644 --- a/mysql-test/include/have_lowercase0.inc +++ b/mysql-test/include/have_lowercase0.inc @@ -1,4 +1,4 @@ --require r/lowercase0.require --disable_query_log -show variables like "lower_case_%"; +show variables like 'lower_case_%'; --enable_query_log diff --git a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc index 45a551274f7..7f922d85ff2 100644 --- a/mysql-test/include/have_multi_ndb.inc +++ b/mysql-test/include/have_multi_ndb.inc @@ -10,7 +10,7 @@ drop table if exists t1, t2; --enable_warnings flush tables; --require r/have_ndb.require -show variables like "have_ndbcluster"; +show variables like 'have_ndbcluster'; enable_query_log; # Check that server2 has NDB support @@ -21,7 +21,7 @@ drop table if exists t1, t2; --enable_warnings flush tables; --require r/have_ndb.require -show variables like "have_ndbcluster"; +show variables like 'have_ndbcluster'; enable_query_log; # Set the default connection to 'server1' diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index 721d79392b7..691adc12231 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -1,7 +1,7 @@ # Check that server is compiled and started with support for NDB -- require r/have_ndb.require disable_query_log; -show variables like "have_ndbcluster"; +show variables like 'have_ndbcluster'; enable_query_log; # Check that NDB is installed and known to be working diff --git a/mysql-test/include/have_query_cache.inc b/mysql-test/include/have_query_cache.inc index 39549157849..647f8598ae6 100644 --- a/mysql-test/include/have_query_cache.inc +++ b/mysql-test/include/have_query_cache.inc @@ -3,5 +3,5 @@ # of query cache hits -- disable_ps_protocol disable_query_log; -show variables like "have_query_cache"; +show variables like 'have_query_cache'; enable_query_log; diff --git a/mysql-test/include/have_sjis.inc b/mysql-test/include/have_sjis.inc index 0d580a3a232..ac6531ca868 100644 --- a/mysql-test/include/have_sjis.inc +++ b/mysql-test/include/have_sjis.inc @@ -1,4 +1,4 @@ -- require r/have_sjis.require disable_query_log; -show collation like "sjis_japanese_ci"; +show collation like 'sjis_japanese_ci'; enable_query_log; diff --git a/mysql-test/include/have_ssl.inc b/mysql-test/include/have_ssl.inc index fab57d630e5..6f2d5587a75 100644 --- a/mysql-test/include/have_ssl.inc +++ b/mysql-test/include/have_ssl.inc @@ -1,4 +1,4 @@ -- require r/have_ssl.require disable_query_log; -show variables like "have_ssl"; +show variables like 'have_ssl'; enable_query_log; diff --git a/mysql-test/include/have_tis620.inc b/mysql-test/include/have_tis620.inc index c1e775681b0..ad5ba9dea69 100644 --- a/mysql-test/include/have_tis620.inc +++ b/mysql-test/include/have_tis620.inc @@ -1,4 +1,4 @@ -- require r/have_tis620.require disable_query_log; -show collation like "tis620_thai_ci"; +show collation like 'tis620_thai_ci'; enable_query_log; diff --git a/mysql-test/include/have_ucs2.inc b/mysql-test/include/have_ucs2.inc index 92ec9b5fb44..324ed52dd02 100644 --- a/mysql-test/include/have_ucs2.inc +++ b/mysql-test/include/have_ucs2.inc @@ -1,4 +1,4 @@ -- require r/have_ucs2.require disable_query_log; -show collation like "ucs2_general_ci"; +show collation like 'ucs2_general_ci'; enable_query_log; diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc index 42b9942f74d..154dccf2270 100644 --- a/mysql-test/include/have_udf.inc +++ b/mysql-test/include/have_udf.inc @@ -4,7 +4,7 @@ # --require r/have_udf.require disable_query_log; -show variables like "have_dynamic_loading"; +show variables like 'have_dynamic_loading'; enable_query_log; # diff --git a/mysql-test/include/have_ujis.inc b/mysql-test/include/have_ujis.inc index ecceb7a8408..e4b2f50cf93 100644 --- a/mysql-test/include/have_ujis.inc +++ b/mysql-test/include/have_ujis.inc @@ -1,4 +1,4 @@ -- require r/have_ujis.require disable_query_log; -show collation like "ujis_japanese_ci"; +show collation like 'ujis_japanese_ci'; enable_query_log; From 43af930e7115e1b62355eebc22178f2ad306d1e7 Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Sat, 5 Jul 2008 09:44:10 +0200 Subject: [PATCH 065/352] ild can not be expected on all matching installs --- configure.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 247a17da940..c34cd661bbd 100644 --- a/configure.in +++ b/configure.in @@ -2812,9 +2812,15 @@ EOF case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in *solaris*-i?86-no-yes) - # ndb fail for whatever strange reason to link Sun Forte/x86 - # unless using incremental linker - CXXFLAGS="$CXXFLAGS -xildon" + if $CC -xildon 2>&1 | grep "illegal option" >/dev/null + then + # This Solaris ld does not support -xildon + true + else + # ndb fail for whatever strange reason to link Sun Forte/x86 + # unless using incremental linker + CXXFLAGS="$CXXFLAGS -xildon" + fi ;; *) ;; esac From b9d6d4c0d8a5858b32f6045323be89459af31a2d Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 7 Jul 2008 09:58:27 +0200 Subject: [PATCH 066/352] Bug #37150 Risk for crash in User_var_log_event::exec_event() On certain kinds of errors (e.g., out of stack), a call to Item_func_ set_user_var::fix_fields() might fail. Since the return value of this call was not checked inside User_var_log_event::exec_event(), continuing execution after this will cause a crash inside Item_func_set_user_var:: update_hash(). The bug is fixed by aborting execution of the event with an error if fix_fields() fails, since it is not possible to continue execution anyway. --- sql/log_event.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 05dccd782ad..ef419aaee40 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -4154,8 +4154,14 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) /* Item_func_set_user_var can't substitute something else on its place => 0 can be passed as last argument (reference on item) + + Fix_fields() can fail, in which case a call of update_hash() might + crash the server, so if fix fields fails, we just return with an + error. */ - e.fix_fields(thd, 0); + if (e.fix_fields(thd, 0)) + return 1; + /* A variable can just be considered as a table with a single record and with a single column. Thus, like From 0a638f6b0d3324d1809e765839b397458942a1e3 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 7 Jul 2008 11:43:56 +0300 Subject: [PATCH 067/352] Bug#37627: addendum : - moved the test into a separate file to check for presence of the test variable --- mysql-test/r/subselect.result | 14 +------------- mysql-test/r/subselect_debug.result | 12 ++++++++++++ mysql-test/t/subselect.test | 16 +--------------- mysql-test/t/subselect_debug.test | 16 ++++++++++++++++ 4 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 mysql-test/r/subselect_debug.result create mode 100644 mysql-test/t/subselect_debug.test diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 04983ef19ab..da512cd0a4f 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4398,16 +4398,4 @@ INSERT INTO t1 VALUES (1), (3); SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); a b DROP TABLE t1,t2; -CREATE TABLE t1(id INT); -INSERT INTO t1 VALUES (1),(2),(3),(4); -INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d; -INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c; -SET SESSION debug="d,subselect_exec_fail"; -SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1; -SUM(EXISTS(SELECT RAND() FROM t1)) -0 -SELECT REVERSE(EXISTS(SELECT RAND() FROM t1)); -REVERSE(EXISTS(SELECT RAND() FROM t1)) -0 -SET SESSION debug=DEFAULT; -DROP TABLE t1; +End of 5.0 tests. diff --git a/mysql-test/r/subselect_debug.result b/mysql-test/r/subselect_debug.result new file mode 100644 index 00000000000..9ba552bbdf7 --- /dev/null +++ b/mysql-test/r/subselect_debug.result @@ -0,0 +1,12 @@ +CREATE TABLE t1(id INT); +INSERT INTO t1 VALUES (1),(2),(3),(4); +INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d; +SET SESSION debug="d,subselect_exec_fail"; +SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1; +SUM(EXISTS(SELECT RAND() FROM t1)) +0 +SELECT REVERSE(EXISTS(SELECT RAND() FROM t1)); +REVERSE(EXISTS(SELECT RAND() FROM t1)) +0 +SET SESSION debug=DEFAULT; +DROP TABLE t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 08e0f6592ab..d13f6230339 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3299,18 +3299,4 @@ SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); DROP TABLE t1,t2; -# -# Bug #37627: Killing query with sum(exists()) or avg(exists()) reproducibly -# crashes server -# - -CREATE TABLE t1(id INT); -INSERT INTO t1 VALUES (1),(2),(3),(4); -INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d; -INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c; -# Setup the mysqld to crash at certain point -SET SESSION debug="d,subselect_exec_fail"; -SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1; -SELECT REVERSE(EXISTS(SELECT RAND() FROM t1)); -SET SESSION debug=DEFAULT; -DROP TABLE t1; +--echo End of 5.0 tests. diff --git a/mysql-test/t/subselect_debug.test b/mysql-test/t/subselect_debug.test new file mode 100644 index 00000000000..358705da4f2 --- /dev/null +++ b/mysql-test/t/subselect_debug.test @@ -0,0 +1,16 @@ +--source include/have_debug.inc + +# +# Bug #37627: Killing query with sum(exists()) or avg(exists()) reproducibly +# crashes server +# + +CREATE TABLE t1(id INT); +INSERT INTO t1 VALUES (1),(2),(3),(4); +INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d; +# Setup the mysqld to crash at certain point +SET SESSION debug="d,subselect_exec_fail"; +SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1; +SELECT REVERSE(EXISTS(SELECT RAND() FROM t1)); +SET SESSION debug=DEFAULT; +DROP TABLE t1; From da29c528d3ed59182ad3013ee225e2107cab93a7 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 7 Jul 2008 17:54:42 +0200 Subject: [PATCH 068/352] Bug#35161: --myisam-recover does not work for partitioned MyISAM tables Problem was that auto_repair, is_crashed and check_and_repair was not implemented in ha_partition. Solution, implemented them as loop over all partitions for is_crashed and check_and_repair, and using the first partition for auto_repair. (Recommit after fixing review comments) --- mysql-test/lib/mtr_report.pl | 5 +- mysql-test/std_data/corrupt_t1#P#p1.MYI | Bin 0 -> 1024 bytes mysql-test/std_data/corrupt_t1.MYI | Bin 0 -> 1024 bytes .../parts/r/partition_repair_myisam.result | 56 +++++++++++++++ .../t/partition_repair_myisam-master.opt | 1 + .../parts/t/partition_repair_myisam.test | 30 ++++++++ sql/ha_partition.cc | 64 ++++++++++++++++++ sql/ha_partition.h | 6 +- 8 files changed, 158 insertions(+), 4 deletions(-) create mode 100644 mysql-test/std_data/corrupt_t1#P#p1.MYI create mode 100644 mysql-test/std_data/corrupt_t1.MYI create mode 100644 mysql-test/suite/parts/r/partition_repair_myisam.result create mode 100644 mysql-test/suite/parts/t/partition_repair_myisam-master.opt create mode 100644 mysql-test/suite/parts/t/partition_repair_myisam.test diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index b83f40626aa..bee03e82e24 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -402,7 +402,10 @@ sub mtr_report_stats ($) { )) or # Test case for Bug#31590 produces the following error: - /Out of sort memory; increase server sort buffer size/ + /Out of sort memory; increase server sort buffer size/ or + + # Bug#35161, test of auto repair --myisam-recover + /able.*_will_crash/ ) { next; # Skip these lines diff --git a/mysql-test/std_data/corrupt_t1#P#p1.MYI b/mysql-test/std_data/corrupt_t1#P#p1.MYI new file mode 100644 index 0000000000000000000000000000000000000000..27a37c710b4b4bda630d643db697d34450a14533 GIT binary patch literal 1024 zcmezOkDZZ$i7|v>149bK5e7yEAmRX$42+ilfg}ikc*ub9KNLU&Ibd?^Fa~a#>ljdu z7b*`mmxTeoMBZnfz3gm&@3Zg++1c;e{n1PKA;v}F+0w6vz kU}R+Q0E%;iAd5X%c>vf-Sm?lf1C~P8Im#Xlfx#OB06NqgwEzGB literal 0 HcmV?d00001 diff --git a/mysql-test/std_data/corrupt_t1.MYI b/mysql-test/std_data/corrupt_t1.MYI new file mode 100644 index 0000000000000000000000000000000000000000..10df2e8c3e18db097bd1ccaad6d35443d47ff7c1 GIT binary patch literal 1024 zcmezOkDZZ$i7|v>149bK5e7yEAmRX$42+ilfg}ikc*ub9KNLU&Ibd?^Fa~b=%TJ)3 z2vi corrupt_t1.MYI +SELECT * FROM t1_will_crash; +a +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +Warnings: +Error 145 Table './test/t1_will_crash' is marked as crashed and should be repaired +Error 1194 Table 't1_will_crash' is marked as crashed and should be repaired +Error 1034 1 client is using or hasn't closed the table properly +Error 1034 Size of indexfile is: 1024 Should be: 2048 +Error 1034 Size of datafile is: 77 Should be: 7 +Error 1034 Number of rows changed from 1 to 11 +DROP TABLE t1_will_crash; +CREATE TABLE t1_will_crash (a INT, KEY (a)) +ENGINE=MyISAM +PARTITION BY HASH(a) +PARTITIONS 3; +INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11); +FLUSH TABLES; +# replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing: +# 'create table t1 (a int key(a)) partition by hash (a) partitions 3' +# head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI +SELECT * FROM t1_will_crash; +a +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +Warnings: +Error 145 Table './test/t1_will_crash#P#p1' is marked as crashed and should be repaired +Error 1194 Table 't1_will_crash' is marked as crashed and should be repaired +Error 1034 1 client is using or hasn't closed the table properly +Error 1034 Size of indexfile is: 1024 Should be: 2048 +Error 1034 Size of datafile is: 28 Should be: 7 +Error 1034 Number of rows changed from 1 to 4 +DROP TABLE t1_will_crash; diff --git a/mysql-test/suite/parts/t/partition_repair_myisam-master.opt b/mysql-test/suite/parts/t/partition_repair_myisam-master.opt new file mode 100644 index 00000000000..787371a854a --- /dev/null +++ b/mysql-test/suite/parts/t/partition_repair_myisam-master.opt @@ -0,0 +1 @@ +--myisam-recover diff --git a/mysql-test/suite/parts/t/partition_repair_myisam.test b/mysql-test/suite/parts/t/partition_repair_myisam.test new file mode 100644 index 00000000000..551d344f60e --- /dev/null +++ b/mysql-test/suite/parts/t/partition_repair_myisam.test @@ -0,0 +1,30 @@ +--source include/have_partition.inc +--disable_warnings +--disable_query_log +drop table if exists t1_will_crash; +--enable_query_log +--enable_warnings + + +CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM; +INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11); +FLUSH TABLES; +--echo # replacing t1.MYI with a corrupt + unclosed one created by doing: +--echo # 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI +--remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI +--copy_file std_data/corrupt_t1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash.MYI +SELECT * FROM t1_will_crash; +DROP TABLE t1_will_crash; +CREATE TABLE t1_will_crash (a INT, KEY (a)) +ENGINE=MyISAM +PARTITION BY HASH(a) +PARTITIONS 3; +INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11); +FLUSH TABLES; +--echo # replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing: +--echo # 'create table t1 (a int key(a)) partition by hash (a) partitions 3' +--echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI +--remove_file $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI +--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLTEST_VARDIR/master-data/test/t1_will_crash#P#p1.MYI +SELECT * FROM t1_will_crash; +DROP TABLE t1_will_crash; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 2e0bb090ad2..0959d6db974 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1129,6 +1129,70 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, #endif } + +/** + @brief Check and repair the table if neccesary + + @param thd Thread object + + @retval TRUE Error/Not supported + @retval FALSE Success +*/ + +bool ha_partition::check_and_repair(THD *thd) +{ + handler **file= m_file; + DBUG_ENTER("ha_partition::check_and_repair"); + + do + { + if ((*file)->ha_check_and_repair(thd)) + DBUG_RETURN(TRUE); + } while (*(++file)); + DBUG_RETURN(FALSE); +} + + +/** + @breif Check if the table can be automatically repaired + + @retval TRUE Can be auto repaired + @retval FALSE Cannot be auto repaired +*/ + +bool ha_partition::auto_repair() const +{ + DBUG_ENTER("ha_partition::auto_repair"); + + /* + As long as we only support one storage engine per table, + we can use the first partition for this function. + */ + DBUG_RETURN(m_file[0]->auto_repair()); +} + + +/** + @breif Check if the table is crashed + + @retval TRUE Crashed + @retval FALSE Not crashed +*/ + +bool ha_partition::is_crashed() const +{ + handler **file= m_file; + DBUG_ENTER("ha_partition::is_crashed"); + + do + { + if ((*file)->is_crashed()) + DBUG_RETURN(TRUE); + } while (*(++file)); + DBUG_RETURN(FALSE); +} + + /* Prepare by creating a new partition diff --git a/sql/ha_partition.h b/sql/ha_partition.h index ac00581fae0..e758dd1eeee 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -935,6 +935,9 @@ public: virtual int analyze_partitions(THD *thd); virtual int check_partitions(THD *thd); virtual int repair_partitions(THD *thd); + virtual bool check_and_repair(THD *thd); + virtual bool auto_repair() const; + virtual bool is_crashed() const; private: int handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, @@ -950,12 +953,9 @@ public: virtual int restore(THD* thd, HA_CHECK_OPT *check_opt); virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt); virtual int preload_keys(THD *thd, HA_CHECK_OPT *check_opt); - virtual bool check_and_repair(THD *thd); virtual int dump(THD* thd, int fd = -1); virtual int net_read_dump(NET* net); virtual uint checksum() const; - virtual bool is_crashed() const; - virtual bool auto_repair() const; */ /* From f3ff1aeb9c04c3cf26e1373f9a92fc2f2edcff4d Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 7 Jul 2008 10:00:08 -0600 Subject: [PATCH 069/352] Bug#26030 (Parsing fails for stored routine w/multi-statement execution enabled) Before this fix, the lexer and parser would treat the ';' character as a different token (either ';' or END_OF_INPUT), based on convoluted logic, which failed in simple cases where a stored procedure is implemented as a single statement, and used in a multi query. With this fix: - the character ';' is always parsed as a ';' token in the lexer, - parsing multi queries is implemented in the parser, in the 'query:' rules, - the value of thd->client_capabilities, which is the capabilities negotiated between the client and the server during bootstrap, is immutable and not arbitrarily modified during parsing (which was the root cause of the bug) --- mysql-test/r/comments.result | 2 +- mysql-test/r/parser.result | 68 ++++++++++++++++++++++++++ mysql-test/r/ps.result | 4 +- mysql-test/t/parser.test | 59 +++++++++++++++++++++++ sql/sp_head.h | 1 - sql/sql_lex.cc | 19 ++------ sql/sql_parse.cc | 5 ++ sql/sql_yacc.yy | 93 +++++++++++++++++++----------------- 8 files changed, 186 insertions(+), 65 deletions(-) create mode 100644 mysql-test/r/parser.result create mode 100644 mysql-test/t/parser.test diff --git a/mysql-test/r/comments.result b/mysql-test/r/comments.result index 1040c3fc8e9..b9d0028dc7c 100644 --- a/mysql-test/r/comments.result +++ b/mysql-test/r/comments.result @@ -35,7 +35,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;"; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*"; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';*' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*' at line 1 prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';"; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!98765' AND b = 'bar'' at line 1 prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*"; diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result new file mode 100644 index 00000000000..18391bd2a45 --- /dev/null +++ b/mysql-test/r/parser.result @@ -0,0 +1,68 @@ +DROP PROCEDURE IF EXISTS p26030; +select "non terminated"$$ +non terminated +non terminated +select "terminated";$$ +terminated +terminated +select "non terminated, space" $$ +non terminated, space +non terminated, space +select "terminated, space"; $$ +terminated, space +terminated, space +select "non terminated, comment" /* comment */$$ +non terminated, comment +non terminated, comment +select "terminated, comment"; /* comment */$$ +terminated, comment +terminated, comment +select "stmt 1";select "stmt 2 non terminated"$$ +stmt 1 +stmt 1 +stmt 2 non terminated +stmt 2 non terminated +select "stmt 1";select "stmt 2 terminated";$$ +stmt 1 +stmt 1 +stmt 2 terminated +stmt 2 terminated +select "stmt 1";select "stmt 2 non terminated, space" $$ +stmt 1 +stmt 1 +stmt 2 non terminated, space +stmt 2 non terminated, space +select "stmt 1";select "stmt 2 terminated, space"; $$ +stmt 1 +stmt 1 +stmt 2 terminated, space +stmt 2 terminated, space +select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$ +stmt 1 +stmt 1 +stmt 2 non terminated, comment +stmt 2 non terminated, comment +select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$ +stmt 1 +stmt 1 +stmt 2 terminated, comment +stmt 2 terminated, comment +select "stmt 1"; select "space, stmt 2"$$ +stmt 1 +stmt 1 +space, stmt 2 +space, stmt 2 +select "stmt 1";/* comment */select "comment, stmt 2"$$ +stmt 1 +stmt 1 +comment, stmt 2 +comment, stmt 2 +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030() +$$ +1 +1 +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030() +$$ +1 +1 +DROP PROCEDURE p26030; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 9aef58d5702..09deaf2f322 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -85,9 +85,9 @@ NULL NULL NULL prepare stmt6 from 'select 1; select2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1 prepare stmt6 from 'insert into t1 values (5,"five"); select2'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select2' at line 1 explain prepare stmt6 from 'insert into t1 values (5,"five"); select2'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1 create table t2 diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test new file mode 100644 index 00000000000..02fe98dc7b2 --- /dev/null +++ b/mysql-test/t/parser.test @@ -0,0 +1,59 @@ +# +# This file contains tests covering the parser +# + +#============================================================================= +# LEXICAL PARSER (lex) +#============================================================================= + +# +# Maintainer: these tests are for the lexical parser, so every character, +# even whitespace or comments, is significant here. +# + +# +# Bug#26030 (Parsing fails for stored routine w/multi-statement execution +# enabled) +# + +--disable_warnings +DROP PROCEDURE IF EXISTS p26030; +--enable_warnings + +delimiter $$; + +select "non terminated"$$ +select "terminated";$$ +select "non terminated, space" $$ +select "terminated, space"; $$ +select "non terminated, comment" /* comment */$$ +select "terminated, comment"; /* comment */$$ + +# Multi queries can not be used in --ps-protocol test mode +--disable_ps_protocol + +select "stmt 1";select "stmt 2 non terminated"$$ +select "stmt 1";select "stmt 2 terminated";$$ +select "stmt 1";select "stmt 2 non terminated, space" $$ +select "stmt 1";select "stmt 2 terminated, space"; $$ +select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$ +select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$ + +select "stmt 1"; select "space, stmt 2"$$ +select "stmt 1";/* comment */select "comment, stmt 2"$$ + +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030() +$$ + +DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030() +$$ + +--enable_ps_protocol + +delimiter ;$$ +DROP PROCEDURE p26030; + +#============================================================================r +# SYNTACTIC PARSER (bison) +#============================================================================= + diff --git a/sql/sp_head.h b/sql/sp_head.h index 11ff7160c03..91f465a4e2a 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -117,7 +117,6 @@ public: create_field m_return_field_def; /* This is used for FUNCTIONs only. */ const char *m_tmp_query; // Temporary pointer to sub query string - uint m_old_cmq; // Old CLIENT_MULTI_QUERIES value st_sp_chistics *m_chistics; ulong m_sql_mode; // For SHOW CREATE and execution LEX_STRING m_qname; // db.name diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 6bfcd982b04..a1bfc3edc6c 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1010,21 +1010,8 @@ int MYSQLlex(void *arg, void *yythd) yySkip(); return (SET_VAR); case MY_LEX_SEMICOLON: // optional line terminator - if (yyPeek()) - { - if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) && - !lip->stmt_prepare_mode) - { - lex->safe_to_cache_query= 0; - lip->found_semicolon= lip->ptr; - thd->server_status|= SERVER_MORE_RESULTS_EXISTS; - lip->next_state= MY_LEX_END; - return (END_OF_INPUT); - } - state= MY_LEX_CHAR; // Return ';' - break; - } - /* fall true */ + state= MY_LEX_CHAR; // Return ';' + break; case MY_LEX_EOL: if (lip->ptr >= lip->end_of_query) { @@ -1039,7 +1026,7 @@ int MYSQLlex(void *arg, void *yythd) case MY_LEX_END: lip->next_state=MY_LEX_END; return(0); // We found end of input last time - + /* Actually real shouldn't start with . but allow them anyhow */ case MY_LEX_REAL_OR_POINT: if (my_isdigit(cs,yyPeek())) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 98e04e45bdd..62a5a79a833 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6169,6 +6169,11 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, (thd->query_length= (ulong)(lip.found_semicolon - thd->query))) thd->query_length--; /* Actually execute the query */ + if (*found_semicolon) + { + lex->safe_to_cache_query= 0; + thd->server_status|= SERVER_MORE_RESULTS_EXISTS; + } lex->set_trg_event_type_for_tables(); mysql_execute_command(thd); query_cache_end_of_result(thd); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ffc84bde9c1..090585392a0 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1203,21 +1203,54 @@ END_OF_INPUT query: - END_OF_INPUT - { - THD *thd= YYTHD; - if (!thd->bootstrap && - (!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT))) - { - my_message(ER_EMPTY_QUERY, ER(ER_EMPTY_QUERY), MYF(0)); - MYSQL_YYABORT; - } - else - { - thd->lex->sql_command= SQLCOM_EMPTY_QUERY; - } - } - | verb_clause END_OF_INPUT {}; + END_OF_INPUT + { + THD *thd= YYTHD; + if (!thd->bootstrap && + (!(thd->lex->select_lex.options & OPTION_FOUND_COMMENT))) + { + my_message(ER_EMPTY_QUERY, ER(ER_EMPTY_QUERY), MYF(0)); + MYSQL_YYABORT; + } + thd->lex->sql_command= SQLCOM_EMPTY_QUERY; + thd->m_lip->found_semicolon= NULL; + } + | verb_clause + { + Lex_input_stream *lip = YYTHD->m_lip; + + if ((YYTHD->client_capabilities & CLIENT_MULTI_QUERIES) && + ! lip->stmt_prepare_mode && + ! (lip->ptr >= lip->end_of_query)) + { + /* + We found a well formed query, and multi queries are allowed: + - force the parser to stop after the ';' + - mark the start of the next query for the next invocation + of the parser. + */ + lip->next_state= MY_LEX_END; + lip->found_semicolon= lip->ptr; + } + else + { + /* Single query, terminated. */ + lip->found_semicolon= NULL; + } + } + ';' + opt_end_of_input + | verb_clause END_OF_INPUT + { + /* Single query, not terminated. */ + YYTHD->m_lip->found_semicolon= NULL; + } + ; + +opt_end_of_input: + /* empty */ + | END_OF_INPUT + ; verb_clause: statement @@ -9867,13 +9900,6 @@ trigger_tail: lex->sphead= sp; lex->spname= $3; - /* - We have to turn of CLIENT_MULTI_QUERIES while parsing a - stored procedure, otherwise yylex will chop it into pieces - at each ';'. - */ - sp->m_old_cmq= thd->client_capabilities & CLIENT_MULTI_QUERIES; - thd->client_capabilities &= ~CLIENT_MULTI_QUERIES; bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics)); lex->sphead->m_chistics= &lex->sp_chistics; @@ -9888,9 +9914,6 @@ trigger_tail: lex->sql_command= SQLCOM_CREATE_TRIGGER; sp->init_strings(YYTHD, lex); - /* Restore flag if it was cleared above */ - if (sp->m_old_cmq) - YYTHD->client_capabilities |= CLIENT_MULTI_QUERIES; sp->restore_thd_mem_root(YYTHD); if (sp->is_not_allowed_in_function("trigger")) @@ -9968,13 +9991,6 @@ sf_tail: sp->m_type= TYPE_ENUM_FUNCTION; lex->sphead= sp; - /* - * We have to turn of CLIENT_MULTI_QUERIES while parsing a - * stored procedure, otherwise yylex will chop it into pieces - * at each ';'. - */ - sp->m_old_cmq= thd->client_capabilities & CLIENT_MULTI_QUERIES; - thd->client_capabilities &= ~CLIENT_MULTI_QUERIES; lex->sphead->m_param_begin= lip->tok_start+1; } sp_fdparam_list /* $6 */ @@ -10030,9 +10046,6 @@ sf_tail: my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str); MYSQL_YYABORT; } - /* Restore flag if it was cleared above */ - if (sp->m_old_cmq) - YYTHD->client_capabilities |= CLIENT_MULTI_QUERIES; sp->restore_thd_mem_root(YYTHD); } ; @@ -10062,13 +10075,6 @@ sp_tail: sp->init_sp_name(YYTHD, $3); lex->sphead= sp; - /* - * We have to turn of CLIENT_MULTI_QUERIES while parsing a - * stored procedure, otherwise yylex will chop it into pieces - * at each ';'. - */ - sp->m_old_cmq= YYTHD->client_capabilities & CLIENT_MULTI_QUERIES; - YYTHD->client_capabilities &= (~CLIENT_MULTI_QUERIES); } '(' { @@ -10104,9 +10110,6 @@ sp_tail: sp->init_strings(YYTHD, lex); lex->sql_command= SQLCOM_CREATE_PROCEDURE; - /* Restore flag if it was cleared above */ - if (sp->m_old_cmq) - YYTHD->client_capabilities |= CLIENT_MULTI_QUERIES; sp->restore_thd_mem_root(YYTHD); } ; From c499df928c1ee1454baa5048913759aee20884b6 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 7 Jul 2008 22:42:19 +0200 Subject: [PATCH 070/352] Bug#35745: SELECT COUNT(*) is not correct for some partitioned tables. problem was that ha_partition::records was not implemented, thus using the default handler::records, which is not correct if the engine does not support HA_STATS_RECORDS_IS_EXACT. Solution was to implement ha_partition::records as a wrapper around the underlying partitions records. The rows column in explain partitions will now include the total number of records in the partitioned table. (recommit after removing out-commented code) --- mysql-test/r/partition.result | 2 +- mysql-test/r/partition_hash.result | 12 ++-- mysql-test/r/partition_pruning.result | 66 +++++++++---------- mysql-test/r/partition_range.result | 12 ++-- .../parts/r/partition_alter3_innodb.result | 36 +++++----- .../parts/r/partition_alter3_myisam.result | 36 +++++----- sql/ha_partition.cc | 28 ++++++++ sql/ha_partition.h | 1 + 8 files changed, 111 insertions(+), 82 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index d34fad02832..51e851125e9 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1131,7 +1131,7 @@ NULL 2 explain partitions select * from t1 where a is null or a < 0 or a > 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 4 Using where drop table t1; CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20)) ENGINE=MyISAM DEFAULT CHARSET=latin1 diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result index 94fefe77a77..19da70db5a0 100644 --- a/mysql-test/r/partition_hash.result +++ b/mysql-test/r/partition_hash.result @@ -69,25 +69,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a is null or (a >= 5 and a <= 7); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a is null; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a is not null; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a >= 1 and a < 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a >= 3 and a <= 5; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a > 2 and a < 4; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a > 3 and a <= 6; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 9 Using where explain partitions select * from t1 where a > 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 396400f9010..b153ad9ad47 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -31,7 +31,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t2 where a=1 and b=1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 3 Using where create table t3 ( a int ) @@ -89,25 +89,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra explain partitions select * from t5 where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t5 where (a=10 and b=2) or (a=10 and b=3) or (a=10 and b = 4); id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t5 where (c=1 and d=1); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t5 where (c=2 and d=1); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or (c=2 and d=1); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or (b=2 and c=2 and d=1); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where create table t6 (a int not null) partition by LIST(a) ( partition p1 values in (1), partition p3 values in (3), @@ -145,7 +145,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1 explain partitions select * from t6 where a >= 3 and a <= 8; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t6 where a > 3 and a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables @@ -187,7 +187,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1 explain partitions select * from t6 where a >= 3 and a <= 8; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t6 where a > 3 and a < 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables @@ -342,7 +342,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra explain partitions select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE X p1,p2 ALL a NULL NULL NULL 2 Using where +1 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where 1 SIMPLE Y p1,p2 ref a a 4 test.X.a 2 drop table t1; create table t1 (a int) partition by hash(a) partitions 20; @@ -355,7 +355,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 where a > 1 and a <= 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t1 where a >= 1 and a <= 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2,p3 ALL NULL NULL NULL NULL 3 Using where @@ -445,22 +445,22 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 explain partitions select * from t2 where a < 801 and a > 200; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 800 Using where +1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where explain partitions select * from t2 where a < 801 and a > 800; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where +1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 1010 Using where explain partitions select * from t2 where a > 600; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where +1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where explain partitions select * from t2 where a > 600 and b = 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where +1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where explain partitions select * from t2 where a > 600 and b = 4; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where +1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where explain partitions select * from t2 where a > 600 and b = 5; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where +1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where explain partitions select * from t2 where b = 5; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where @@ -515,19 +515,19 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 910 explain partitions select * from t2 where a = 101; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 110 Using where +1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 910 Using where explain partitions select * from t2 where a = 550; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 200 Using where +1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 910 Using where explain partitions select * from t2 where a = 833; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where +1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 910 Using where explain partitions select * from t2 where (a = 100 OR a = 900); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 310 Using where +1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 910 Using where explain partitions select * from t2 where (a > 100 AND a < 600); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0,p1,p2,p3 ALL NULL NULL NULL NULL 710 Using where +1 SIMPLE t2 p0,p1,p2,p3 ALL NULL NULL NULL NULL 910 Using where explain partitions select * from t2 where b = 4; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ref b b 5 const 76 Using where @@ -813,17 +813,17 @@ id select_type table partitions type possible_keys key key_len ref rows Extra explain partitions select * from t1 where a >= 18446744073709551000-1 and a <= 18446744073709551000+1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a between 18446744073709551001 and 18446744073709551002; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a = 18446744073709551000; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a = 18446744073709551613; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a = 18446744073709551614; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables @@ -850,10 +850,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 where a=0xFE; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t2 where a=0xFE; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a > 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables @@ -862,22 +862,22 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a < 64 AND a >= 63; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t2 where a < 64 AND a >= 63; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a <= 64 AND a >= 63; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 6 Using where explain partitions select * from t2 where a <= 64 AND a >= 63; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 6 Using where drop table t1; drop table t2; create table t1(a bigint unsigned not null) partition by range(a+0) ( diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index b027ef088ae..e4e5a748b0d 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -57,13 +57,13 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 pnull system NULL NULL NULL NULL 1 explain partitions select * from t1 where a >= 0; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t1 where a < 0; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables explain partitions select * from t1 where a <= 0; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 3 Using where explain partitions select * from t1 where a > 1; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables @@ -96,16 +96,16 @@ select * from t1 where a > 1; a b explain partitions select * from t1 where a is null; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where explain partitions select * from t1 where a >= 0; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 6 Using where explain partitions select * from t1 where a < 0; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where explain partitions select * from t1 where a <= 0; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 6 Using where explain partitions select * from t1 where a > 1; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result index 2ca1e783839..898d6cbb42a 100644 --- a/mysql-test/suite/parts/r/partition_alter3_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result @@ -134,7 +134,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -153,7 +153,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -169,7 +169,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -197,7 +197,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -212,7 +212,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -227,7 +227,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -242,7 +242,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -257,7 +257,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -272,7 +272,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -391,7 +391,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -410,7 +410,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -429,7 +429,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -455,7 +455,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -473,7 +473,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -491,7 +491,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 23 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -509,7 +509,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -527,7 +527,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -545,7 +545,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result index 5684ca89b1c..04dd90ebdfc 100644 --- a/mysql-test/suite/parts/r/partition_alter3_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result @@ -148,7 +148,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -175,7 +175,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -207,7 +207,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -249,7 +249,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -276,7 +276,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -301,7 +301,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -324,7 +324,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -345,7 +345,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -364,7 +364,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -491,7 +491,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -518,7 +518,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -553,7 +553,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -593,7 +593,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -623,7 +623,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -651,7 +651,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -677,7 +677,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -701,7 +701,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 @@ -723,7 +723,7 @@ MYSQLTEST_VARDIR/master-data/test/t1.frm MYSQLTEST_VARDIR/master-data/test/t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where # check read single success: 1 # check read all success: 1 # check read row by row success: 1 diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 3a78e6601f0..b06e2572f44 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -5364,6 +5364,34 @@ ha_rows ha_partition::estimate_rows_upper_bound() } +/** + Number of rows in table. see handler.h + + SYNOPSIS + records() + + RETURN VALUE + Number of total rows in a partitioned table. +*/ + +ha_rows ha_partition::records() +{ + ha_rows rows, tot_rows= 0; + handler **file; + DBUG_ENTER("ha_partition::records"); + + file= m_file; + do + { + rows= (*file)->records(); + if (rows == HA_POS_ERROR) + DBUG_RETURN(HA_POS_ERROR); + tot_rows+= rows; + } while (*(++file)); + DBUG_RETURN(tot_rows); +} + + /* Is it ok to switch to a new engine for this table diff --git a/sql/ha_partition.h b/sql/ha_partition.h index ac00581fae0..2ec700978bc 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -531,6 +531,7 @@ public: underlying handlers must have the same implementation for it to work. */ virtual uint8 table_cache_type(); + virtual ha_rows records(); /* ------------------------------------------------------------------------- From d61bc87c580bbeef3aa5e8cee29f0fcdd39205c5 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 8 Jul 2008 10:32:02 -0600 Subject: [PATCH 071/352] Bug#37525 funcs_1: _storedproc.test fail Fixed the test to expect the correct result. The previous test script was in fact affected by 26030, and wrongly expected a ER_PARSE_ERROR error. --- .../suite/funcs_1/r/innodb_storedproc.result | 8 ++------ .../suite/funcs_1/r/memory_storedproc.result | 8 ++------ .../suite/funcs_1/r/myisam_storedproc.result | 8 ++------ .../funcs_1/storedproc/storedproc_master.inc | 17 ++++++++++++++--- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc.result b/mysql-test/suite/funcs_1/r/innodb_storedproc.result index 3fd7020c114..04c1a45e67e 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc.result @@ -3635,13 +3635,9 @@ SELECT count(*) into cnt from t2; set @count = cnt; SELECT @count; END// -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; -set @count = cnt; -SELECT @count; -END' at line 2 +ERROR 42S22: Unknown column 'cnt' in 'field list' CALL sp1( 10 ); -ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; CREATE PROCEDURE sp1( cnt int(20) ) END SELECT count(*) into cnt from t2; diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc.result b/mysql-test/suite/funcs_1/r/memory_storedproc.result index e05b08932a9..47e8ab24a01 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc.result @@ -3636,13 +3636,9 @@ SELECT count(*) into cnt from t2; set @count = cnt; SELECT @count; END// -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; -set @count = cnt; -SELECT @count; -END' at line 2 +ERROR 42S22: Unknown column 'cnt' in 'field list' CALL sp1( 10 ); -ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; CREATE PROCEDURE sp1( cnt int(20) ) END SELECT count(*) into cnt from t2; diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc.result b/mysql-test/suite/funcs_1/r/myisam_storedproc.result index e05b08932a9..47e8ab24a01 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc.result @@ -3636,13 +3636,9 @@ SELECT count(*) into cnt from t2; set @count = cnt; SELECT @count; END// -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; -set @count = cnt; -SELECT @count; -END' at line 2 +ERROR 42S22: Unknown column 'cnt' in 'field list' CALL sp1( 10 ); -ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; CREATE PROCEDURE sp1( cnt int(20) ) END SELECT count(*) into cnt from t2; diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc index ca51f3c0432..b740cf38708 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc @@ -2862,8 +2862,20 @@ DROP PROCEDURE IF EXISTS sp1; --enable_warnings # missing BEGIN +# PLEASE NOTE: +# this test client has the MULTI_QUERY capability, +# so that the following request (starting at 'CREATE' and ending at the // +# delimiter) is interpreted as follows: +# 1) it's a multi query +# 2) the first query is a valid CREATE PROCEDURE statement, and the +# procedure consist of only one SELECT statement +# 3) the second query is a SET statement, which is broken since it's +# referencing an unknown column 'cnt' +# 4) the next query (SELECT @count) is not parsed or executed, since 3) +# failed + delimiter //; ---error ER_PARSE_ERROR +--error ER_BAD_FIELD_ERROR CREATE PROCEDURE sp1( cnt int(20) ) SELECT count(*) into cnt from t2; set @count = cnt; @@ -2871,11 +2883,10 @@ CREATE PROCEDURE sp1( cnt int(20) ) END// delimiter ;// ---error ER_SP_DOES_NOT_EXIST CALL sp1( 10 ); --disable_warnings -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; --enable_warnings # wrong order of BEGIN and END From 6affa021b6578a431d065feb1c9e65f098ded9fb Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 8 Jul 2008 10:33:09 -0600 Subject: [PATCH 072/352] Cleanup merge issues in mysql-test/t/parser.test --- mysql-test/r/parser.result | 549 +++++++++++++++++++++++ mysql-test/r/parser.result.moved | 617 -------------------------- mysql-test/t/parser.test | 669 +++++++++++++++++++++++++++- mysql-test/t/parser.test.moved | 726 ------------------------------- 4 files changed, 1217 insertions(+), 1344 deletions(-) delete mode 100644 mysql-test/r/parser.result.moved delete mode 100644 mysql-test/t/parser.test.moved diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 18391bd2a45..270c1ec5670 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -1,3 +1,289 @@ +SET @save_sql_mode=@@sql_mode; +set SQL_MODE=''; +create table ADDDATE(a int); +drop table ADDDATE; +create table ADDDATE (a int); +drop table ADDDATE; +create table BIT_AND(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1 +create table BIT_AND (a int); +drop table BIT_AND; +create table BIT_OR(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1 +create table BIT_OR (a int); +drop table BIT_OR; +create table BIT_XOR(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1 +create table BIT_XOR (a int); +drop table BIT_XOR; +create table CAST(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1 +create table CAST (a int); +drop table CAST; +create table COUNT(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1 +create table COUNT (a int); +drop table COUNT; +create table CURDATE(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1 +create table CURDATE (a int); +drop table CURDATE; +create table CURTIME(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1 +create table CURTIME (a int); +drop table CURTIME; +create table DATE_ADD(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1 +create table DATE_ADD (a int); +drop table DATE_ADD; +create table DATE_SUB(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1 +create table DATE_SUB (a int); +drop table DATE_SUB; +create table EXTRACT(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1 +create table EXTRACT (a int); +drop table EXTRACT; +create table GROUP_CONCAT(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1 +create table GROUP_CONCAT (a int); +drop table GROUP_CONCAT; +create table GROUP_UNIQUE_USERS(a int); +drop table GROUP_UNIQUE_USERS; +create table GROUP_UNIQUE_USERS (a int); +drop table GROUP_UNIQUE_USERS; +create table MAX(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1 +create table MAX (a int); +drop table MAX; +create table MID(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1 +create table MID (a int); +drop table MID; +create table MIN(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1 +create table MIN (a int); +drop table MIN; +create table NOW(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1 +create table NOW (a int); +drop table NOW; +create table POSITION(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1 +create table POSITION (a int); +drop table POSITION; +create table SESSION_USER(a int); +drop table SESSION_USER; +create table SESSION_USER (a int); +drop table SESSION_USER; +create table STD(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1 +create table STD (a int); +drop table STD; +create table STDDEV(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1 +create table STDDEV (a int); +drop table STDDEV; +create table STDDEV_POP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1 +create table STDDEV_POP (a int); +drop table STDDEV_POP; +create table STDDEV_SAMP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1 +create table STDDEV_SAMP (a int); +drop table STDDEV_SAMP; +create table SUBDATE(a int); +drop table SUBDATE; +create table SUBDATE (a int); +drop table SUBDATE; +create table SUBSTR(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1 +create table SUBSTR (a int); +drop table SUBSTR; +create table SUBSTRING(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1 +create table SUBSTRING (a int); +drop table SUBSTRING; +create table SUM(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1 +create table SUM (a int); +drop table SUM; +create table SYSDATE(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1 +create table SYSDATE (a int); +drop table SYSDATE; +create table SYSTEM_USER(a int); +drop table SYSTEM_USER; +create table SYSTEM_USER (a int); +drop table SYSTEM_USER; +create table TRIM(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1 +create table TRIM (a int); +drop table TRIM; +create table UNIQUE_USERS(a int); +drop table UNIQUE_USERS; +create table UNIQUE_USERS (a int); +drop table UNIQUE_USERS; +create table VARIANCE(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1 +create table VARIANCE (a int); +drop table VARIANCE; +create table VAR_POP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1 +create table VAR_POP (a int); +drop table VAR_POP; +create table VAR_SAMP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1 +create table VAR_SAMP (a int); +drop table VAR_SAMP; +set SQL_MODE='IGNORE_SPACE'; +create table ADDDATE(a int); +drop table ADDDATE; +create table ADDDATE (a int); +drop table ADDDATE; +create table BIT_AND(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1 +create table BIT_AND (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND (a int)' at line 1 +create table BIT_OR(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1 +create table BIT_OR (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR (a int)' at line 1 +create table BIT_XOR(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1 +create table BIT_XOR (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR (a int)' at line 1 +create table CAST(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1 +create table CAST (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST (a int)' at line 1 +create table COUNT(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1 +create table COUNT (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT (a int)' at line 1 +create table CURDATE(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1 +create table CURDATE (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE (a int)' at line 1 +create table CURTIME(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1 +create table CURTIME (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME (a int)' at line 1 +create table DATE_ADD(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1 +create table DATE_ADD (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD (a int)' at line 1 +create table DATE_SUB(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1 +create table DATE_SUB (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB (a int)' at line 1 +create table EXTRACT(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1 +create table EXTRACT (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT (a int)' at line 1 +create table GROUP_CONCAT(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1 +create table GROUP_CONCAT (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT (a int)' at line 1 +create table GROUP_UNIQUE_USERS(a int); +drop table GROUP_UNIQUE_USERS; +create table GROUP_UNIQUE_USERS (a int); +drop table GROUP_UNIQUE_USERS; +create table MAX(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1 +create table MAX (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX (a int)' at line 1 +create table MID(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1 +create table MID (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID (a int)' at line 1 +create table MIN(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1 +create table MIN (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN (a int)' at line 1 +create table NOW(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1 +create table NOW (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW (a int)' at line 1 +create table POSITION(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1 +create table POSITION (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION (a int)' at line 1 +create table SESSION_USER(a int); +drop table SESSION_USER; +create table SESSION_USER (a int); +drop table SESSION_USER; +create table STD(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1 +create table STD (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD (a int)' at line 1 +create table STDDEV(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1 +create table STDDEV (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV (a int)' at line 1 +create table STDDEV_POP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1 +create table STDDEV_POP (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP (a int)' at line 1 +create table STDDEV_SAMP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1 +create table STDDEV_SAMP (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP (a int)' at line 1 +create table SUBDATE(a int); +drop table SUBDATE; +create table SUBDATE (a int); +drop table SUBDATE; +create table SUBSTR(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1 +create table SUBSTR (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR (a int)' at line 1 +create table SUBSTRING(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1 +create table SUBSTRING (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING (a int)' at line 1 +create table SUM(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1 +create table SUM (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM (a int)' at line 1 +create table SYSDATE(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1 +create table SYSDATE (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE (a int)' at line 1 +create table SYSTEM_USER(a int); +drop table SYSTEM_USER; +create table SYSTEM_USER (a int); +drop table SYSTEM_USER; +create table TRIM(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1 +create table TRIM (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM (a int)' at line 1 +create table UNIQUE_USERS(a int); +drop table UNIQUE_USERS; +create table UNIQUE_USERS (a int); +drop table UNIQUE_USERS; +create table VARIANCE(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1 +create table VARIANCE (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE (a int)' at line 1 +create table VAR_POP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1 +create table VAR_POP (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP (a int)' at line 1 +create table VAR_SAMP(a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1 +create table VAR_SAMP (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP (a int)' at line 1 +DROP TABLE IF EXISTS table_25930_a; +DROP TABLE IF EXISTS table_25930_b; +SET SQL_MODE = 'ANSI_QUOTES'; +CREATE TABLE table_25930_a ( "blah" INT ); +CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a; +desc table_25930_b; +Field Type Null Key Default Extra +"blah" - 1 bigint(12) YES NULL +DROP TABLE table_25930_a; +DROP TABLE table_25930_b; +SET @@sql_mode=@save_sql_mode; DROP PROCEDURE IF EXISTS p26030; select "non terminated"$$ non terminated @@ -66,3 +352,266 @@ $$ 1 1 DROP PROCEDURE p26030; +select pi(3.14); +ERROR 42000: Incorrect parameter count in the call to native function 'pi' +select tan(); +ERROR 42000: Incorrect parameter count in the call to native function 'tan' +select tan(1, 2); +ERROR 42000: Incorrect parameter count in the call to native function 'tan' +select makedate(1); +ERROR 42000: Incorrect parameter count in the call to native function 'makedate' +select makedate(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'makedate' +select maketime(); +ERROR 42000: Incorrect parameter count in the call to native function 'maketime' +select maketime(1); +ERROR 42000: Incorrect parameter count in the call to native function 'maketime' +select maketime(1, 2); +ERROR 42000: Incorrect parameter count in the call to native function 'maketime' +select maketime(1, 2, 3, 4); +ERROR 42000: Incorrect parameter count in the call to native function 'maketime' +select atan(); +ERROR 42000: Incorrect parameter count in the call to native function 'atan' +select atan2(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'atan2' +select concat(); +ERROR 42000: Incorrect parameter count in the call to native function 'concat' +select concat("foo"); +concat("foo") +foo +select concat_ws(); +ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws' +select concat_ws("foo"); +ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws' +select encrypt(); +ERROR 42000: Incorrect parameter count in the call to native function 'encrypt' +select encrypt(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'encrypt' +select des_encrypt("p1", "p2", "not expected"); +ERROR 42000: Incorrect parameter count in the call to native function 'des_encrypt' +select des_decrypt("p1", "p2", "not expected"); +ERROR 42000: Incorrect parameter count in the call to native function 'des_decrypt' +select elt(); +ERROR 42000: Incorrect parameter count in the call to native function 'elt' +select elt(1); +ERROR 42000: Incorrect parameter count in the call to native function 'elt' +select export_set(); +ERROR 42000: Incorrect parameter count in the call to native function 'export_set' +select export_set("p1"); +ERROR 42000: Incorrect parameter count in the call to native function 'export_set' +select export_set("p1", "p2"); +ERROR 42000: Incorrect parameter count in the call to native function 'export_set' +select export_set("p1", "p2", "p3", "p4", "p5", "p6"); +ERROR 42000: Incorrect parameter count in the call to native function 'export_set' +select field(); +ERROR 42000: Incorrect parameter count in the call to native function 'field' +select field("p1"); +ERROR 42000: Incorrect parameter count in the call to native function 'field' +select from_unixtime(); +ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime' +select from_unixtime(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime' +select unix_timestamp(1, 2); +ERROR 42000: Incorrect parameter count in the call to native function 'unix_timestamp' +select greatest(); +ERROR 42000: Incorrect parameter count in the call to native function 'greatest' +select greatest(12); +ERROR 42000: Incorrect parameter count in the call to native function 'greatest' +select last_insert_id(1, 2); +ERROR 42000: Incorrect parameter count in the call to native function 'last_insert_id' +select least(); +ERROR 42000: Incorrect parameter count in the call to native function 'least' +select least(12); +ERROR 42000: Incorrect parameter count in the call to native function 'least' +select locate(); +ERROR 42000: Incorrect parameter count in the call to native function 'locate' +select locate(1); +ERROR 42000: Incorrect parameter count in the call to native function 'locate' +select locate(1, 2, 3, 4); +ERROR 42000: Incorrect parameter count in the call to native function 'locate' +select log(); +ERROR 42000: Incorrect parameter count in the call to native function 'log' +select log(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'log' +select make_set(); +ERROR 42000: Incorrect parameter count in the call to native function 'make_set' +select make_set(1); +ERROR 42000: Incorrect parameter count in the call to native function 'make_set' +select master_pos_wait(); +ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' +select master_pos_wait(1); +ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' +select master_pos_wait(1, 2, 3, 4); +ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' +select rand(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'rand' +select round(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'round' +select yearweek(); +ERROR 42000: Incorrect parameter count in the call to native function 'yearweek' +select yearweek(1, 2, 3); +ERROR 42000: Incorrect parameter count in the call to native function 'yearweek' +select abs(3); +abs(3) +3 +select abs(3 AS three); +ERROR 42000: Incorrect parameters in the call to native function 'abs' +select abs(3 three); +ERROR 42000: Incorrect parameters in the call to native function 'abs' +select abs(3 AS "three"); +ERROR 42000: Incorrect parameters in the call to native function 'abs' +select abs(3 "three"); +ERROR 42000: Incorrect parameters in the call to native function 'abs' +set @bar="bar"; +set @foobar="foobar"; +select instr("foobar", "bar"); +instr("foobar", "bar") +4 +select instr("foobar" AS p1, "bar"); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar" p1, "bar"); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar" AS "p1", "bar"); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar" "p1", "bar"); +instr("foobar" "p1", "bar") +4 +select instr(@foobar "p1", "bar"); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar", "bar" AS p2); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar", "bar" p2); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar", "bar" AS "p2"); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar", "bar" "p2"); +instr("foobar", "bar" "p2") +0 +select instr("foobar", @bar "p2"); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select instr("foobar" AS p1, "bar" AS p2); +ERROR 42000: Incorrect parameters in the call to native function 'instr' +select conv(255, 10, 16); +conv(255, 10, 16) +FF +select conv(255 AS p1, 10, 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255 p1, 10, 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255 AS "p1", 10, 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255 "p1", 10, 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10 AS p2, 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10 p2, 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10 AS "p2", 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10 "p2", 16); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10, 16 AS p3); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10, 16 p3); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10, 16 AS "p3"); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255, 10, 16 "p3"); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select conv(255 AS p1, 10 AS p2, 16 AS p3); +ERROR 42000: Incorrect parameters in the call to native function 'conv' +select atan(10); +atan(10) +1.4711276743037 +select atan(10 AS p1); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10 p1); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10 AS "p1"); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10 "p1"); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10, 20); +atan(10, 20) +0.46364760900081 +select atan(10 AS p1, 20); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10 p1, 20); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10 AS "p1", 20); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10 "p1", 20); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10, 20 AS p2); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10, 20 p2); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10, 20 AS "p2"); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10, 20 "p2"); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +select atan(10 AS p1, 20 AS p2); +ERROR 42000: Incorrect parameters in the call to native function 'atan' +DROP TABLE IF EXISTS t1; +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; +STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE +NULL +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE; +STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE +NULL +SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND; +"1997-12-31 23:59:59" + INTERVAL 1 SECOND +1998-01-01 00:00:00 +SELECT 1 + INTERVAL(1,0,1,2) + 1; +1 + INTERVAL(1,0,1,2) + 1 +4 +SELECT INTERVAL(1^1,0,1,2) + 1; +INTERVAL(1^1,0,1,2) + 1 +2 +SELECT INTERVAL(1,0+1,2,3) * 5.5; +INTERVAL(1,0+1,2,3) * 5.5 +5.5 +SELECT INTERVAL(3,3,1+3,4+4) / 0.5; +INTERVAL(3,3,1+3,4+4) / 0.5 +2.0000 +SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2; +(INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2 +50.0000 +SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2); +INTERVAL(1,0,1,2) + 1 5 * INTERVAL(1,0,1,2) +3 10 +SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3); +INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3) +2 +SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND; +1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND +NULL +SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND; +1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND +NULL +CREATE TABLE t1 (a INT, b DATETIME); +INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND); +SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1; +a b +3 1998-01-01 00:00:00 +DROP TABLE t1; +DROP TABLE IF EXISTS t1,t2,t3; +CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2; +a1 a2 a3 a4 +SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)}; +a1 a2 a3 a4 a1 a2 a3 a4 +SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))}; +a1 a2 a3 a4 a1 a2 a3 a4 +SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)}; +a1 a2 a3 a4 a1 a2 a3 a4 +SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10; +a1 a2 a3 a4 a1 a2 a3 a4 +SELECT {fn CONCAT(a1,a2)} FROM t1; +{fn CONCAT(a1,a2)} +UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0; +SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')}; +a1 a4 +DROP TABLE t1, t2, t3; diff --git a/mysql-test/r/parser.result.moved b/mysql-test/r/parser.result.moved deleted file mode 100644 index 270c1ec5670..00000000000 --- a/mysql-test/r/parser.result.moved +++ /dev/null @@ -1,617 +0,0 @@ -SET @save_sql_mode=@@sql_mode; -set SQL_MODE=''; -create table ADDDATE(a int); -drop table ADDDATE; -create table ADDDATE (a int); -drop table ADDDATE; -create table BIT_AND(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1 -create table BIT_AND (a int); -drop table BIT_AND; -create table BIT_OR(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1 -create table BIT_OR (a int); -drop table BIT_OR; -create table BIT_XOR(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1 -create table BIT_XOR (a int); -drop table BIT_XOR; -create table CAST(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1 -create table CAST (a int); -drop table CAST; -create table COUNT(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1 -create table COUNT (a int); -drop table COUNT; -create table CURDATE(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1 -create table CURDATE (a int); -drop table CURDATE; -create table CURTIME(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1 -create table CURTIME (a int); -drop table CURTIME; -create table DATE_ADD(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1 -create table DATE_ADD (a int); -drop table DATE_ADD; -create table DATE_SUB(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1 -create table DATE_SUB (a int); -drop table DATE_SUB; -create table EXTRACT(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1 -create table EXTRACT (a int); -drop table EXTRACT; -create table GROUP_CONCAT(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1 -create table GROUP_CONCAT (a int); -drop table GROUP_CONCAT; -create table GROUP_UNIQUE_USERS(a int); -drop table GROUP_UNIQUE_USERS; -create table GROUP_UNIQUE_USERS (a int); -drop table GROUP_UNIQUE_USERS; -create table MAX(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1 -create table MAX (a int); -drop table MAX; -create table MID(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1 -create table MID (a int); -drop table MID; -create table MIN(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1 -create table MIN (a int); -drop table MIN; -create table NOW(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1 -create table NOW (a int); -drop table NOW; -create table POSITION(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1 -create table POSITION (a int); -drop table POSITION; -create table SESSION_USER(a int); -drop table SESSION_USER; -create table SESSION_USER (a int); -drop table SESSION_USER; -create table STD(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1 -create table STD (a int); -drop table STD; -create table STDDEV(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1 -create table STDDEV (a int); -drop table STDDEV; -create table STDDEV_POP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1 -create table STDDEV_POP (a int); -drop table STDDEV_POP; -create table STDDEV_SAMP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1 -create table STDDEV_SAMP (a int); -drop table STDDEV_SAMP; -create table SUBDATE(a int); -drop table SUBDATE; -create table SUBDATE (a int); -drop table SUBDATE; -create table SUBSTR(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1 -create table SUBSTR (a int); -drop table SUBSTR; -create table SUBSTRING(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1 -create table SUBSTRING (a int); -drop table SUBSTRING; -create table SUM(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1 -create table SUM (a int); -drop table SUM; -create table SYSDATE(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1 -create table SYSDATE (a int); -drop table SYSDATE; -create table SYSTEM_USER(a int); -drop table SYSTEM_USER; -create table SYSTEM_USER (a int); -drop table SYSTEM_USER; -create table TRIM(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1 -create table TRIM (a int); -drop table TRIM; -create table UNIQUE_USERS(a int); -drop table UNIQUE_USERS; -create table UNIQUE_USERS (a int); -drop table UNIQUE_USERS; -create table VARIANCE(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1 -create table VARIANCE (a int); -drop table VARIANCE; -create table VAR_POP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1 -create table VAR_POP (a int); -drop table VAR_POP; -create table VAR_SAMP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1 -create table VAR_SAMP (a int); -drop table VAR_SAMP; -set SQL_MODE='IGNORE_SPACE'; -create table ADDDATE(a int); -drop table ADDDATE; -create table ADDDATE (a int); -drop table ADDDATE; -create table BIT_AND(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1 -create table BIT_AND (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND (a int)' at line 1 -create table BIT_OR(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1 -create table BIT_OR (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR (a int)' at line 1 -create table BIT_XOR(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1 -create table BIT_XOR (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR (a int)' at line 1 -create table CAST(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1 -create table CAST (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST (a int)' at line 1 -create table COUNT(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1 -create table COUNT (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT (a int)' at line 1 -create table CURDATE(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1 -create table CURDATE (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE (a int)' at line 1 -create table CURTIME(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1 -create table CURTIME (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME (a int)' at line 1 -create table DATE_ADD(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1 -create table DATE_ADD (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD (a int)' at line 1 -create table DATE_SUB(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1 -create table DATE_SUB (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB (a int)' at line 1 -create table EXTRACT(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1 -create table EXTRACT (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT (a int)' at line 1 -create table GROUP_CONCAT(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1 -create table GROUP_CONCAT (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT (a int)' at line 1 -create table GROUP_UNIQUE_USERS(a int); -drop table GROUP_UNIQUE_USERS; -create table GROUP_UNIQUE_USERS (a int); -drop table GROUP_UNIQUE_USERS; -create table MAX(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1 -create table MAX (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX (a int)' at line 1 -create table MID(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1 -create table MID (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID (a int)' at line 1 -create table MIN(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1 -create table MIN (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN (a int)' at line 1 -create table NOW(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1 -create table NOW (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW (a int)' at line 1 -create table POSITION(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1 -create table POSITION (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION (a int)' at line 1 -create table SESSION_USER(a int); -drop table SESSION_USER; -create table SESSION_USER (a int); -drop table SESSION_USER; -create table STD(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1 -create table STD (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD (a int)' at line 1 -create table STDDEV(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1 -create table STDDEV (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV (a int)' at line 1 -create table STDDEV_POP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1 -create table STDDEV_POP (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP (a int)' at line 1 -create table STDDEV_SAMP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1 -create table STDDEV_SAMP (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP (a int)' at line 1 -create table SUBDATE(a int); -drop table SUBDATE; -create table SUBDATE (a int); -drop table SUBDATE; -create table SUBSTR(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1 -create table SUBSTR (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR (a int)' at line 1 -create table SUBSTRING(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1 -create table SUBSTRING (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING (a int)' at line 1 -create table SUM(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1 -create table SUM (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM (a int)' at line 1 -create table SYSDATE(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1 -create table SYSDATE (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE (a int)' at line 1 -create table SYSTEM_USER(a int); -drop table SYSTEM_USER; -create table SYSTEM_USER (a int); -drop table SYSTEM_USER; -create table TRIM(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1 -create table TRIM (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM (a int)' at line 1 -create table UNIQUE_USERS(a int); -drop table UNIQUE_USERS; -create table UNIQUE_USERS (a int); -drop table UNIQUE_USERS; -create table VARIANCE(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1 -create table VARIANCE (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE (a int)' at line 1 -create table VAR_POP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1 -create table VAR_POP (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP (a int)' at line 1 -create table VAR_SAMP(a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1 -create table VAR_SAMP (a int); -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP (a int)' at line 1 -DROP TABLE IF EXISTS table_25930_a; -DROP TABLE IF EXISTS table_25930_b; -SET SQL_MODE = 'ANSI_QUOTES'; -CREATE TABLE table_25930_a ( "blah" INT ); -CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a; -desc table_25930_b; -Field Type Null Key Default Extra -"blah" - 1 bigint(12) YES NULL -DROP TABLE table_25930_a; -DROP TABLE table_25930_b; -SET @@sql_mode=@save_sql_mode; -DROP PROCEDURE IF EXISTS p26030; -select "non terminated"$$ -non terminated -non terminated -select "terminated";$$ -terminated -terminated -select "non terminated, space" $$ -non terminated, space -non terminated, space -select "terminated, space"; $$ -terminated, space -terminated, space -select "non terminated, comment" /* comment */$$ -non terminated, comment -non terminated, comment -select "terminated, comment"; /* comment */$$ -terminated, comment -terminated, comment -select "stmt 1";select "stmt 2 non terminated"$$ -stmt 1 -stmt 1 -stmt 2 non terminated -stmt 2 non terminated -select "stmt 1";select "stmt 2 terminated";$$ -stmt 1 -stmt 1 -stmt 2 terminated -stmt 2 terminated -select "stmt 1";select "stmt 2 non terminated, space" $$ -stmt 1 -stmt 1 -stmt 2 non terminated, space -stmt 2 non terminated, space -select "stmt 1";select "stmt 2 terminated, space"; $$ -stmt 1 -stmt 1 -stmt 2 terminated, space -stmt 2 terminated, space -select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$ -stmt 1 -stmt 1 -stmt 2 non terminated, comment -stmt 2 non terminated, comment -select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$ -stmt 1 -stmt 1 -stmt 2 terminated, comment -stmt 2 terminated, comment -select "stmt 1"; select "space, stmt 2"$$ -stmt 1 -stmt 1 -space, stmt 2 -space, stmt 2 -select "stmt 1";/* comment */select "comment, stmt 2"$$ -stmt 1 -stmt 1 -comment, stmt 2 -comment, stmt 2 -DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030() -$$ -1 -1 -DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030() -$$ -1 -1 -DROP PROCEDURE p26030; -select pi(3.14); -ERROR 42000: Incorrect parameter count in the call to native function 'pi' -select tan(); -ERROR 42000: Incorrect parameter count in the call to native function 'tan' -select tan(1, 2); -ERROR 42000: Incorrect parameter count in the call to native function 'tan' -select makedate(1); -ERROR 42000: Incorrect parameter count in the call to native function 'makedate' -select makedate(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'makedate' -select maketime(); -ERROR 42000: Incorrect parameter count in the call to native function 'maketime' -select maketime(1); -ERROR 42000: Incorrect parameter count in the call to native function 'maketime' -select maketime(1, 2); -ERROR 42000: Incorrect parameter count in the call to native function 'maketime' -select maketime(1, 2, 3, 4); -ERROR 42000: Incorrect parameter count in the call to native function 'maketime' -select atan(); -ERROR 42000: Incorrect parameter count in the call to native function 'atan' -select atan2(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'atan2' -select concat(); -ERROR 42000: Incorrect parameter count in the call to native function 'concat' -select concat("foo"); -concat("foo") -foo -select concat_ws(); -ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws' -select concat_ws("foo"); -ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws' -select encrypt(); -ERROR 42000: Incorrect parameter count in the call to native function 'encrypt' -select encrypt(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'encrypt' -select des_encrypt("p1", "p2", "not expected"); -ERROR 42000: Incorrect parameter count in the call to native function 'des_encrypt' -select des_decrypt("p1", "p2", "not expected"); -ERROR 42000: Incorrect parameter count in the call to native function 'des_decrypt' -select elt(); -ERROR 42000: Incorrect parameter count in the call to native function 'elt' -select elt(1); -ERROR 42000: Incorrect parameter count in the call to native function 'elt' -select export_set(); -ERROR 42000: Incorrect parameter count in the call to native function 'export_set' -select export_set("p1"); -ERROR 42000: Incorrect parameter count in the call to native function 'export_set' -select export_set("p1", "p2"); -ERROR 42000: Incorrect parameter count in the call to native function 'export_set' -select export_set("p1", "p2", "p3", "p4", "p5", "p6"); -ERROR 42000: Incorrect parameter count in the call to native function 'export_set' -select field(); -ERROR 42000: Incorrect parameter count in the call to native function 'field' -select field("p1"); -ERROR 42000: Incorrect parameter count in the call to native function 'field' -select from_unixtime(); -ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime' -select from_unixtime(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime' -select unix_timestamp(1, 2); -ERROR 42000: Incorrect parameter count in the call to native function 'unix_timestamp' -select greatest(); -ERROR 42000: Incorrect parameter count in the call to native function 'greatest' -select greatest(12); -ERROR 42000: Incorrect parameter count in the call to native function 'greatest' -select last_insert_id(1, 2); -ERROR 42000: Incorrect parameter count in the call to native function 'last_insert_id' -select least(); -ERROR 42000: Incorrect parameter count in the call to native function 'least' -select least(12); -ERROR 42000: Incorrect parameter count in the call to native function 'least' -select locate(); -ERROR 42000: Incorrect parameter count in the call to native function 'locate' -select locate(1); -ERROR 42000: Incorrect parameter count in the call to native function 'locate' -select locate(1, 2, 3, 4); -ERROR 42000: Incorrect parameter count in the call to native function 'locate' -select log(); -ERROR 42000: Incorrect parameter count in the call to native function 'log' -select log(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'log' -select make_set(); -ERROR 42000: Incorrect parameter count in the call to native function 'make_set' -select make_set(1); -ERROR 42000: Incorrect parameter count in the call to native function 'make_set' -select master_pos_wait(); -ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' -select master_pos_wait(1); -ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' -select master_pos_wait(1, 2, 3, 4); -ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait' -select rand(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'rand' -select round(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'round' -select yearweek(); -ERROR 42000: Incorrect parameter count in the call to native function 'yearweek' -select yearweek(1, 2, 3); -ERROR 42000: Incorrect parameter count in the call to native function 'yearweek' -select abs(3); -abs(3) -3 -select abs(3 AS three); -ERROR 42000: Incorrect parameters in the call to native function 'abs' -select abs(3 three); -ERROR 42000: Incorrect parameters in the call to native function 'abs' -select abs(3 AS "three"); -ERROR 42000: Incorrect parameters in the call to native function 'abs' -select abs(3 "three"); -ERROR 42000: Incorrect parameters in the call to native function 'abs' -set @bar="bar"; -set @foobar="foobar"; -select instr("foobar", "bar"); -instr("foobar", "bar") -4 -select instr("foobar" AS p1, "bar"); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar" p1, "bar"); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar" AS "p1", "bar"); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar" "p1", "bar"); -instr("foobar" "p1", "bar") -4 -select instr(@foobar "p1", "bar"); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar", "bar" AS p2); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar", "bar" p2); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar", "bar" AS "p2"); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar", "bar" "p2"); -instr("foobar", "bar" "p2") -0 -select instr("foobar", @bar "p2"); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select instr("foobar" AS p1, "bar" AS p2); -ERROR 42000: Incorrect parameters in the call to native function 'instr' -select conv(255, 10, 16); -conv(255, 10, 16) -FF -select conv(255 AS p1, 10, 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255 p1, 10, 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255 AS "p1", 10, 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255 "p1", 10, 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10 AS p2, 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10 p2, 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10 AS "p2", 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10 "p2", 16); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10, 16 AS p3); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10, 16 p3); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10, 16 AS "p3"); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255, 10, 16 "p3"); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select conv(255 AS p1, 10 AS p2, 16 AS p3); -ERROR 42000: Incorrect parameters in the call to native function 'conv' -select atan(10); -atan(10) -1.4711276743037 -select atan(10 AS p1); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10 p1); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10 AS "p1"); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10 "p1"); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10, 20); -atan(10, 20) -0.46364760900081 -select atan(10 AS p1, 20); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10 p1, 20); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10 AS "p1", 20); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10 "p1", 20); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10, 20 AS p2); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10, 20 p2); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10, 20 AS "p2"); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10, 20 "p2"); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -select atan(10 AS p1, 20 AS p2); -ERROR 42000: Incorrect parameters in the call to native function 'atan' -DROP TABLE IF EXISTS t1; -SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; -STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE -NULL -SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE; -STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE -NULL -SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND; -"1997-12-31 23:59:59" + INTERVAL 1 SECOND -1998-01-01 00:00:00 -SELECT 1 + INTERVAL(1,0,1,2) + 1; -1 + INTERVAL(1,0,1,2) + 1 -4 -SELECT INTERVAL(1^1,0,1,2) + 1; -INTERVAL(1^1,0,1,2) + 1 -2 -SELECT INTERVAL(1,0+1,2,3) * 5.5; -INTERVAL(1,0+1,2,3) * 5.5 -5.5 -SELECT INTERVAL(3,3,1+3,4+4) / 0.5; -INTERVAL(3,3,1+3,4+4) / 0.5 -2.0000 -SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2; -(INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2 -50.0000 -SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2); -INTERVAL(1,0,1,2) + 1 5 * INTERVAL(1,0,1,2) -3 10 -SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3); -INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3) -2 -SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND; -1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND -NULL -SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND; -1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND -NULL -CREATE TABLE t1 (a INT, b DATETIME); -INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND); -SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1; -a b -3 1998-01-01 00:00:00 -DROP TABLE t1; -DROP TABLE IF EXISTS t1,t2,t3; -CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME); -CREATE TABLE t2 LIKE t1; -CREATE TABLE t3 LIKE t1; -SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2; -a1 a2 a3 a4 -SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)}; -a1 a2 a3 a4 a1 a2 a3 a4 -SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))}; -a1 a2 a3 a4 a1 a2 a3 a4 -SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)}; -a1 a2 a3 a4 a1 a2 a3 a4 -SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10; -a1 a2 a3 a4 a1 a2 a3 a4 -SELECT {fn CONCAT(a1,a2)} FROM t1; -{fn CONCAT(a1,a2)} -UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0; -SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')}; -a1 a4 -DROP TABLE t1, t2, t3; diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test index 02fe98dc7b2..7efc519e441 100644 --- a/mysql-test/t/parser.test +++ b/mysql-test/t/parser.test @@ -11,6 +11,387 @@ # even whitespace or comments, is significant here. # +SET @save_sql_mode=@@sql_mode; + +# +# Documenting the current behavior, to detect incompatible changes. +# In each cases: +# - no error is the correct result +# - an error is the expected result with the current implementation, +# and is a limitation. + +set SQL_MODE=''; + +create table ADDDATE(a int); +drop table ADDDATE; +create table ADDDATE (a int); +drop table ADDDATE; + +--error ER_PARSE_ERROR +create table BIT_AND(a int); +create table BIT_AND (a int); +drop table BIT_AND; + +--error ER_PARSE_ERROR +create table BIT_OR(a int); +create table BIT_OR (a int); +drop table BIT_OR; + +--error ER_PARSE_ERROR +create table BIT_XOR(a int); +create table BIT_XOR (a int); +drop table BIT_XOR; + +--error ER_PARSE_ERROR +create table CAST(a int); +create table CAST (a int); +drop table CAST; + +--error ER_PARSE_ERROR +create table COUNT(a int); +create table COUNT (a int); +drop table COUNT; + +--error ER_PARSE_ERROR +create table CURDATE(a int); +create table CURDATE (a int); +drop table CURDATE; + +--error ER_PARSE_ERROR +create table CURTIME(a int); +create table CURTIME (a int); +drop table CURTIME; + +--error ER_PARSE_ERROR +create table DATE_ADD(a int); +create table DATE_ADD (a int); +drop table DATE_ADD; + +--error ER_PARSE_ERROR +create table DATE_SUB(a int); +create table DATE_SUB (a int); +drop table DATE_SUB; + +--error ER_PARSE_ERROR +create table EXTRACT(a int); +create table EXTRACT (a int); +drop table EXTRACT; + +--error ER_PARSE_ERROR +create table GROUP_CONCAT(a int); +create table GROUP_CONCAT (a int); +drop table GROUP_CONCAT; + +# Limitation removed in 5.1 +create table GROUP_UNIQUE_USERS(a int); +drop table GROUP_UNIQUE_USERS; +create table GROUP_UNIQUE_USERS (a int); +drop table GROUP_UNIQUE_USERS; + +--error ER_PARSE_ERROR +create table MAX(a int); +create table MAX (a int); +drop table MAX; + +--error ER_PARSE_ERROR +create table MID(a int); +create table MID (a int); +drop table MID; + +--error ER_PARSE_ERROR +create table MIN(a int); +create table MIN (a int); +drop table MIN; + +--error ER_PARSE_ERROR +create table NOW(a int); +create table NOW (a int); +drop table NOW; + +--error ER_PARSE_ERROR +create table POSITION(a int); +create table POSITION (a int); +drop table POSITION; + +create table SESSION_USER(a int); +drop table SESSION_USER; +create table SESSION_USER (a int); +drop table SESSION_USER; + +--error ER_PARSE_ERROR +create table STD(a int); +create table STD (a int); +drop table STD; + +--error ER_PARSE_ERROR +create table STDDEV(a int); +create table STDDEV (a int); +drop table STDDEV; + +--error ER_PARSE_ERROR +create table STDDEV_POP(a int); +create table STDDEV_POP (a int); +drop table STDDEV_POP; + +--error ER_PARSE_ERROR +create table STDDEV_SAMP(a int); +create table STDDEV_SAMP (a int); +drop table STDDEV_SAMP; + +create table SUBDATE(a int); +drop table SUBDATE; +create table SUBDATE (a int); +drop table SUBDATE; + +--error ER_PARSE_ERROR +create table SUBSTR(a int); +create table SUBSTR (a int); +drop table SUBSTR; + +--error ER_PARSE_ERROR +create table SUBSTRING(a int); +create table SUBSTRING (a int); +drop table SUBSTRING; + +--error ER_PARSE_ERROR +create table SUM(a int); +create table SUM (a int); +drop table SUM; + +--error ER_PARSE_ERROR +create table SYSDATE(a int); +create table SYSDATE (a int); +drop table SYSDATE; + +create table SYSTEM_USER(a int); +drop table SYSTEM_USER; +create table SYSTEM_USER (a int); +drop table SYSTEM_USER; + +--error ER_PARSE_ERROR +create table TRIM(a int); +create table TRIM (a int); +drop table TRIM; + +# Limitation removed in 5.1 +create table UNIQUE_USERS(a int); +drop table UNIQUE_USERS; +create table UNIQUE_USERS (a int); +drop table UNIQUE_USERS; + +--error ER_PARSE_ERROR +create table VARIANCE(a int); +create table VARIANCE (a int); +drop table VARIANCE; + +--error ER_PARSE_ERROR +create table VAR_POP(a int); +create table VAR_POP (a int); +drop table VAR_POP; + +--error ER_PARSE_ERROR +create table VAR_SAMP(a int); +create table VAR_SAMP (a int); +drop table VAR_SAMP; + +set SQL_MODE='IGNORE_SPACE'; + +create table ADDDATE(a int); +drop table ADDDATE; +create table ADDDATE (a int); +drop table ADDDATE; + +--error ER_PARSE_ERROR +create table BIT_AND(a int); +--error ER_PARSE_ERROR +create table BIT_AND (a int); + +--error ER_PARSE_ERROR +create table BIT_OR(a int); +--error ER_PARSE_ERROR +create table BIT_OR (a int); + +--error ER_PARSE_ERROR +create table BIT_XOR(a int); +--error ER_PARSE_ERROR +create table BIT_XOR (a int); + +--error ER_PARSE_ERROR +create table CAST(a int); +--error ER_PARSE_ERROR +create table CAST (a int); + +--error ER_PARSE_ERROR +create table COUNT(a int); +--error ER_PARSE_ERROR +create table COUNT (a int); + +--error ER_PARSE_ERROR +create table CURDATE(a int); +--error ER_PARSE_ERROR +create table CURDATE (a int); + +--error ER_PARSE_ERROR +create table CURTIME(a int); +--error ER_PARSE_ERROR +create table CURTIME (a int); + +--error ER_PARSE_ERROR +create table DATE_ADD(a int); +--error ER_PARSE_ERROR +create table DATE_ADD (a int); + +--error ER_PARSE_ERROR +create table DATE_SUB(a int); +--error ER_PARSE_ERROR +create table DATE_SUB (a int); + +--error ER_PARSE_ERROR +create table EXTRACT(a int); +--error ER_PARSE_ERROR +create table EXTRACT (a int); + +--error ER_PARSE_ERROR +create table GROUP_CONCAT(a int); +--error ER_PARSE_ERROR +create table GROUP_CONCAT (a int); + +# Limitation removed in 5.1 +create table GROUP_UNIQUE_USERS(a int); +drop table GROUP_UNIQUE_USERS; +create table GROUP_UNIQUE_USERS (a int); +drop table GROUP_UNIQUE_USERS; + +--error ER_PARSE_ERROR +create table MAX(a int); +--error ER_PARSE_ERROR +create table MAX (a int); + +--error ER_PARSE_ERROR +create table MID(a int); +--error ER_PARSE_ERROR +create table MID (a int); + +--error ER_PARSE_ERROR +create table MIN(a int); +--error ER_PARSE_ERROR +create table MIN (a int); + +--error ER_PARSE_ERROR +create table NOW(a int); +--error ER_PARSE_ERROR +create table NOW (a int); + +--error ER_PARSE_ERROR +create table POSITION(a int); +--error ER_PARSE_ERROR +create table POSITION (a int); + +create table SESSION_USER(a int); +drop table SESSION_USER; +create table SESSION_USER (a int); +drop table SESSION_USER; + +--error ER_PARSE_ERROR +create table STD(a int); +--error ER_PARSE_ERROR +create table STD (a int); + +--error ER_PARSE_ERROR +create table STDDEV(a int); +--error ER_PARSE_ERROR +create table STDDEV (a int); + +--error ER_PARSE_ERROR +create table STDDEV_POP(a int); +--error ER_PARSE_ERROR +create table STDDEV_POP (a int); + +--error ER_PARSE_ERROR +create table STDDEV_SAMP(a int); +--error ER_PARSE_ERROR +create table STDDEV_SAMP (a int); + +create table SUBDATE(a int); +drop table SUBDATE; +create table SUBDATE (a int); +drop table SUBDATE; + +--error ER_PARSE_ERROR +create table SUBSTR(a int); +--error ER_PARSE_ERROR +create table SUBSTR (a int); + +--error ER_PARSE_ERROR +create table SUBSTRING(a int); +--error ER_PARSE_ERROR +create table SUBSTRING (a int); + +--error ER_PARSE_ERROR +create table SUM(a int); +--error ER_PARSE_ERROR +create table SUM (a int); + +--error ER_PARSE_ERROR +create table SYSDATE(a int); +--error ER_PARSE_ERROR +create table SYSDATE (a int); + +create table SYSTEM_USER(a int); +drop table SYSTEM_USER; +create table SYSTEM_USER (a int); +drop table SYSTEM_USER; + +--error ER_PARSE_ERROR +create table TRIM(a int); +--error ER_PARSE_ERROR +create table TRIM (a int); + +# Limitation removed in 5.1 +create table UNIQUE_USERS(a int); +drop table UNIQUE_USERS; +create table UNIQUE_USERS (a int); +drop table UNIQUE_USERS; + +--error ER_PARSE_ERROR +create table VARIANCE(a int); +--error ER_PARSE_ERROR +create table VARIANCE (a int); + +--error ER_PARSE_ERROR +create table VAR_POP(a int); +--error ER_PARSE_ERROR +create table VAR_POP (a int); + +--error ER_PARSE_ERROR +create table VAR_SAMP(a int); +--error ER_PARSE_ERROR +create table VAR_SAMP (a int); + +# +# Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with +# ANSI_QUOTES mode) +# + +--disable_warnings +DROP TABLE IF EXISTS table_25930_a; +DROP TABLE IF EXISTS table_25930_b; +--enable_warnings + +SET SQL_MODE = 'ANSI_QUOTES'; +CREATE TABLE table_25930_a ( "blah" INT ); +CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a; + +# The lexer used to chop the first <">, +# not marking the start of the token "blah" correctly. +desc table_25930_b; + +DROP TABLE table_25930_a; +DROP TABLE table_25930_b; + + +SET @@sql_mode=@save_sql_mode; + # # Bug#26030 (Parsing fails for stored routine w/multi-statement execution # enabled) @@ -53,7 +434,293 @@ $$ delimiter ;$$ DROP PROCEDURE p26030; -#============================================================================r +#============================================================================= # SYNTACTIC PARSER (bison) #============================================================================= +# +# +# Bug#21114 (Foreign key creation fails to table with name format) +# + +# Test coverage with edge conditions + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select pi(3.14); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select tan(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select tan(1, 2); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select makedate(1); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select makedate(1, 2, 3); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select maketime(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select maketime(1); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select maketime(1, 2); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select maketime(1, 2, 3, 4); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select atan(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select atan2(1, 2, 3); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select concat(); +select concat("foo"); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select concat_ws(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select concat_ws("foo"); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select encrypt(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select encrypt(1, 2, 3); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select des_encrypt("p1", "p2", "not expected"); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select des_decrypt("p1", "p2", "not expected"); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select elt(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select elt(1); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select export_set(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select export_set("p1"); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select export_set("p1", "p2"); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select export_set("p1", "p2", "p3", "p4", "p5", "p6"); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select field(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select field("p1"); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select from_unixtime(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select from_unixtime(1, 2, 3); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select unix_timestamp(1, 2); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select greatest(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select greatest(12); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select last_insert_id(1, 2); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select least(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select least(12); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select locate(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select locate(1); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select locate(1, 2, 3, 4); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select log(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select log(1, 2, 3); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select make_set(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select make_set(1); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select master_pos_wait(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select master_pos_wait(1); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select master_pos_wait(1, 2, 3, 4); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select rand(1, 2, 3); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select round(1, 2, 3); + +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select yearweek(); +-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +select yearweek(1, 2, 3); + +# +# Bug#24736: UDF functions parsed as Stored Functions +# + +# Verify that the syntax for calling UDF : foo(expr AS param, ...) +# can not be used when calling native functions + +# Native function with 1 argument + +select abs(3); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select abs(3 AS three); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select abs(3 three); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select abs(3 AS "three"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select abs(3 "three"); + +# Native function with 2 arguments + +set @bar="bar"; +set @foobar="foobar"; + +select instr("foobar", "bar"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar" AS p1, "bar"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar" p1, "bar"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar" AS "p1", "bar"); +## String concatenation, valid syntax +select instr("foobar" "p1", "bar"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr(@foobar "p1", "bar"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar", "bar" AS p2); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar", "bar" p2); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar", "bar" AS "p2"); +## String concatenation, valid syntax +select instr("foobar", "bar" "p2"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar", @bar "p2"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select instr("foobar" AS p1, "bar" AS p2); + +# Native function with 3 arguments + +select conv(255, 10, 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255 AS p1, 10, 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255 p1, 10, 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255 AS "p1", 10, 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255 "p1", 10, 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10 AS p2, 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10 p2, 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10 AS "p2", 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10 "p2", 16); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10, 16 AS p3); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10, 16 p3); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10, 16 AS "p3"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255, 10, 16 "p3"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select conv(255 AS p1, 10 AS p2, 16 AS p3); + +# Native function with a variable number of arguments + +select atan(10); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 AS p1); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 p1); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 AS "p1"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 "p1"); + +select atan(10, 20); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 AS p1, 20); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 p1, 20); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 AS "p1", 20); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 "p1", 20); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10, 20 AS p2); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10, 20 p2); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10, 20 AS "p2"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10, 20 "p2"); +-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT +select atan(10 AS p1, 20 AS p2); + +# +# Bug#22312 Syntax error in expression with INTERVAL() +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; +SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE; +SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND; +SELECT 1 + INTERVAL(1,0,1,2) + 1; +SELECT INTERVAL(1^1,0,1,2) + 1; +SELECT INTERVAL(1,0+1,2,3) * 5.5; +SELECT INTERVAL(3,3,1+3,4+4) / 0.5; +SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2; +SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2); +SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3); + +--disable_warnings +SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND; +SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND; +--enable_warnings + +CREATE TABLE t1 (a INT, b DATETIME); +INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND); +SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1; +DROP TABLE t1; + +# +# Bug#28317 Left Outer Join with {oj outer-join} +# + +--disable_warnings +DROP TABLE IF EXISTS t1,t2,t3; +--enable_warnings +CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2; +SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)}; +SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))}; +SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)}; +SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10; +SELECT {fn CONCAT(a1,a2)} FROM t1; +UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0; +SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')}; +DROP TABLE t1, t2, t3; diff --git a/mysql-test/t/parser.test.moved b/mysql-test/t/parser.test.moved deleted file mode 100644 index 7efc519e441..00000000000 --- a/mysql-test/t/parser.test.moved +++ /dev/null @@ -1,726 +0,0 @@ -# -# This file contains tests covering the parser -# - -#============================================================================= -# LEXICAL PARSER (lex) -#============================================================================= - -# -# Maintainer: these tests are for the lexical parser, so every character, -# even whitespace or comments, is significant here. -# - -SET @save_sql_mode=@@sql_mode; - -# -# Documenting the current behavior, to detect incompatible changes. -# In each cases: -# - no error is the correct result -# - an error is the expected result with the current implementation, -# and is a limitation. - -set SQL_MODE=''; - -create table ADDDATE(a int); -drop table ADDDATE; -create table ADDDATE (a int); -drop table ADDDATE; - ---error ER_PARSE_ERROR -create table BIT_AND(a int); -create table BIT_AND (a int); -drop table BIT_AND; - ---error ER_PARSE_ERROR -create table BIT_OR(a int); -create table BIT_OR (a int); -drop table BIT_OR; - ---error ER_PARSE_ERROR -create table BIT_XOR(a int); -create table BIT_XOR (a int); -drop table BIT_XOR; - ---error ER_PARSE_ERROR -create table CAST(a int); -create table CAST (a int); -drop table CAST; - ---error ER_PARSE_ERROR -create table COUNT(a int); -create table COUNT (a int); -drop table COUNT; - ---error ER_PARSE_ERROR -create table CURDATE(a int); -create table CURDATE (a int); -drop table CURDATE; - ---error ER_PARSE_ERROR -create table CURTIME(a int); -create table CURTIME (a int); -drop table CURTIME; - ---error ER_PARSE_ERROR -create table DATE_ADD(a int); -create table DATE_ADD (a int); -drop table DATE_ADD; - ---error ER_PARSE_ERROR -create table DATE_SUB(a int); -create table DATE_SUB (a int); -drop table DATE_SUB; - ---error ER_PARSE_ERROR -create table EXTRACT(a int); -create table EXTRACT (a int); -drop table EXTRACT; - ---error ER_PARSE_ERROR -create table GROUP_CONCAT(a int); -create table GROUP_CONCAT (a int); -drop table GROUP_CONCAT; - -# Limitation removed in 5.1 -create table GROUP_UNIQUE_USERS(a int); -drop table GROUP_UNIQUE_USERS; -create table GROUP_UNIQUE_USERS (a int); -drop table GROUP_UNIQUE_USERS; - ---error ER_PARSE_ERROR -create table MAX(a int); -create table MAX (a int); -drop table MAX; - ---error ER_PARSE_ERROR -create table MID(a int); -create table MID (a int); -drop table MID; - ---error ER_PARSE_ERROR -create table MIN(a int); -create table MIN (a int); -drop table MIN; - ---error ER_PARSE_ERROR -create table NOW(a int); -create table NOW (a int); -drop table NOW; - ---error ER_PARSE_ERROR -create table POSITION(a int); -create table POSITION (a int); -drop table POSITION; - -create table SESSION_USER(a int); -drop table SESSION_USER; -create table SESSION_USER (a int); -drop table SESSION_USER; - ---error ER_PARSE_ERROR -create table STD(a int); -create table STD (a int); -drop table STD; - ---error ER_PARSE_ERROR -create table STDDEV(a int); -create table STDDEV (a int); -drop table STDDEV; - ---error ER_PARSE_ERROR -create table STDDEV_POP(a int); -create table STDDEV_POP (a int); -drop table STDDEV_POP; - ---error ER_PARSE_ERROR -create table STDDEV_SAMP(a int); -create table STDDEV_SAMP (a int); -drop table STDDEV_SAMP; - -create table SUBDATE(a int); -drop table SUBDATE; -create table SUBDATE (a int); -drop table SUBDATE; - ---error ER_PARSE_ERROR -create table SUBSTR(a int); -create table SUBSTR (a int); -drop table SUBSTR; - ---error ER_PARSE_ERROR -create table SUBSTRING(a int); -create table SUBSTRING (a int); -drop table SUBSTRING; - ---error ER_PARSE_ERROR -create table SUM(a int); -create table SUM (a int); -drop table SUM; - ---error ER_PARSE_ERROR -create table SYSDATE(a int); -create table SYSDATE (a int); -drop table SYSDATE; - -create table SYSTEM_USER(a int); -drop table SYSTEM_USER; -create table SYSTEM_USER (a int); -drop table SYSTEM_USER; - ---error ER_PARSE_ERROR -create table TRIM(a int); -create table TRIM (a int); -drop table TRIM; - -# Limitation removed in 5.1 -create table UNIQUE_USERS(a int); -drop table UNIQUE_USERS; -create table UNIQUE_USERS (a int); -drop table UNIQUE_USERS; - ---error ER_PARSE_ERROR -create table VARIANCE(a int); -create table VARIANCE (a int); -drop table VARIANCE; - ---error ER_PARSE_ERROR -create table VAR_POP(a int); -create table VAR_POP (a int); -drop table VAR_POP; - ---error ER_PARSE_ERROR -create table VAR_SAMP(a int); -create table VAR_SAMP (a int); -drop table VAR_SAMP; - -set SQL_MODE='IGNORE_SPACE'; - -create table ADDDATE(a int); -drop table ADDDATE; -create table ADDDATE (a int); -drop table ADDDATE; - ---error ER_PARSE_ERROR -create table BIT_AND(a int); ---error ER_PARSE_ERROR -create table BIT_AND (a int); - ---error ER_PARSE_ERROR -create table BIT_OR(a int); ---error ER_PARSE_ERROR -create table BIT_OR (a int); - ---error ER_PARSE_ERROR -create table BIT_XOR(a int); ---error ER_PARSE_ERROR -create table BIT_XOR (a int); - ---error ER_PARSE_ERROR -create table CAST(a int); ---error ER_PARSE_ERROR -create table CAST (a int); - ---error ER_PARSE_ERROR -create table COUNT(a int); ---error ER_PARSE_ERROR -create table COUNT (a int); - ---error ER_PARSE_ERROR -create table CURDATE(a int); ---error ER_PARSE_ERROR -create table CURDATE (a int); - ---error ER_PARSE_ERROR -create table CURTIME(a int); ---error ER_PARSE_ERROR -create table CURTIME (a int); - ---error ER_PARSE_ERROR -create table DATE_ADD(a int); ---error ER_PARSE_ERROR -create table DATE_ADD (a int); - ---error ER_PARSE_ERROR -create table DATE_SUB(a int); ---error ER_PARSE_ERROR -create table DATE_SUB (a int); - ---error ER_PARSE_ERROR -create table EXTRACT(a int); ---error ER_PARSE_ERROR -create table EXTRACT (a int); - ---error ER_PARSE_ERROR -create table GROUP_CONCAT(a int); ---error ER_PARSE_ERROR -create table GROUP_CONCAT (a int); - -# Limitation removed in 5.1 -create table GROUP_UNIQUE_USERS(a int); -drop table GROUP_UNIQUE_USERS; -create table GROUP_UNIQUE_USERS (a int); -drop table GROUP_UNIQUE_USERS; - ---error ER_PARSE_ERROR -create table MAX(a int); ---error ER_PARSE_ERROR -create table MAX (a int); - ---error ER_PARSE_ERROR -create table MID(a int); ---error ER_PARSE_ERROR -create table MID (a int); - ---error ER_PARSE_ERROR -create table MIN(a int); ---error ER_PARSE_ERROR -create table MIN (a int); - ---error ER_PARSE_ERROR -create table NOW(a int); ---error ER_PARSE_ERROR -create table NOW (a int); - ---error ER_PARSE_ERROR -create table POSITION(a int); ---error ER_PARSE_ERROR -create table POSITION (a int); - -create table SESSION_USER(a int); -drop table SESSION_USER; -create table SESSION_USER (a int); -drop table SESSION_USER; - ---error ER_PARSE_ERROR -create table STD(a int); ---error ER_PARSE_ERROR -create table STD (a int); - ---error ER_PARSE_ERROR -create table STDDEV(a int); ---error ER_PARSE_ERROR -create table STDDEV (a int); - ---error ER_PARSE_ERROR -create table STDDEV_POP(a int); ---error ER_PARSE_ERROR -create table STDDEV_POP (a int); - ---error ER_PARSE_ERROR -create table STDDEV_SAMP(a int); ---error ER_PARSE_ERROR -create table STDDEV_SAMP (a int); - -create table SUBDATE(a int); -drop table SUBDATE; -create table SUBDATE (a int); -drop table SUBDATE; - ---error ER_PARSE_ERROR -create table SUBSTR(a int); ---error ER_PARSE_ERROR -create table SUBSTR (a int); - ---error ER_PARSE_ERROR -create table SUBSTRING(a int); ---error ER_PARSE_ERROR -create table SUBSTRING (a int); - ---error ER_PARSE_ERROR -create table SUM(a int); ---error ER_PARSE_ERROR -create table SUM (a int); - ---error ER_PARSE_ERROR -create table SYSDATE(a int); ---error ER_PARSE_ERROR -create table SYSDATE (a int); - -create table SYSTEM_USER(a int); -drop table SYSTEM_USER; -create table SYSTEM_USER (a int); -drop table SYSTEM_USER; - ---error ER_PARSE_ERROR -create table TRIM(a int); ---error ER_PARSE_ERROR -create table TRIM (a int); - -# Limitation removed in 5.1 -create table UNIQUE_USERS(a int); -drop table UNIQUE_USERS; -create table UNIQUE_USERS (a int); -drop table UNIQUE_USERS; - ---error ER_PARSE_ERROR -create table VARIANCE(a int); ---error ER_PARSE_ERROR -create table VARIANCE (a int); - ---error ER_PARSE_ERROR -create table VAR_POP(a int); ---error ER_PARSE_ERROR -create table VAR_POP (a int); - ---error ER_PARSE_ERROR -create table VAR_SAMP(a int); ---error ER_PARSE_ERROR -create table VAR_SAMP (a int); - -# -# Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with -# ANSI_QUOTES mode) -# - ---disable_warnings -DROP TABLE IF EXISTS table_25930_a; -DROP TABLE IF EXISTS table_25930_b; ---enable_warnings - -SET SQL_MODE = 'ANSI_QUOTES'; -CREATE TABLE table_25930_a ( "blah" INT ); -CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a; - -# The lexer used to chop the first <">, -# not marking the start of the token "blah" correctly. -desc table_25930_b; - -DROP TABLE table_25930_a; -DROP TABLE table_25930_b; - - -SET @@sql_mode=@save_sql_mode; - -# -# Bug#26030 (Parsing fails for stored routine w/multi-statement execution -# enabled) -# - ---disable_warnings -DROP PROCEDURE IF EXISTS p26030; ---enable_warnings - -delimiter $$; - -select "non terminated"$$ -select "terminated";$$ -select "non terminated, space" $$ -select "terminated, space"; $$ -select "non terminated, comment" /* comment */$$ -select "terminated, comment"; /* comment */$$ - -# Multi queries can not be used in --ps-protocol test mode ---disable_ps_protocol - -select "stmt 1";select "stmt 2 non terminated"$$ -select "stmt 1";select "stmt 2 terminated";$$ -select "stmt 1";select "stmt 2 non terminated, space" $$ -select "stmt 1";select "stmt 2 terminated, space"; $$ -select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$ -select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$ - -select "stmt 1"; select "space, stmt 2"$$ -select "stmt 1";/* comment */select "comment, stmt 2"$$ - -DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030() -$$ - -DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030() -$$ - ---enable_ps_protocol - -delimiter ;$$ -DROP PROCEDURE p26030; - -#============================================================================= -# SYNTACTIC PARSER (bison) -#============================================================================= - -# -# -# Bug#21114 (Foreign key creation fails to table with name format) -# - -# Test coverage with edge conditions - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select pi(3.14); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select tan(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select tan(1, 2); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select makedate(1); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select makedate(1, 2, 3); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select maketime(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select maketime(1); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select maketime(1, 2); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select maketime(1, 2, 3, 4); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select atan(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select atan2(1, 2, 3); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select concat(); -select concat("foo"); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select concat_ws(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select concat_ws("foo"); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select encrypt(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select encrypt(1, 2, 3); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select des_encrypt("p1", "p2", "not expected"); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select des_decrypt("p1", "p2", "not expected"); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select elt(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select elt(1); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select export_set(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select export_set("p1"); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select export_set("p1", "p2"); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select export_set("p1", "p2", "p3", "p4", "p5", "p6"); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select field(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select field("p1"); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select from_unixtime(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select from_unixtime(1, 2, 3); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select unix_timestamp(1, 2); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select greatest(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select greatest(12); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select last_insert_id(1, 2); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select least(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select least(12); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select locate(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select locate(1); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select locate(1, 2, 3, 4); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select log(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select log(1, 2, 3); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select make_set(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select make_set(1); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select master_pos_wait(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select master_pos_wait(1); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select master_pos_wait(1, 2, 3, 4); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select rand(1, 2, 3); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select round(1, 2, 3); - --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select yearweek(); --- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -select yearweek(1, 2, 3); - -# -# Bug#24736: UDF functions parsed as Stored Functions -# - -# Verify that the syntax for calling UDF : foo(expr AS param, ...) -# can not be used when calling native functions - -# Native function with 1 argument - -select abs(3); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select abs(3 AS three); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select abs(3 three); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select abs(3 AS "three"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select abs(3 "three"); - -# Native function with 2 arguments - -set @bar="bar"; -set @foobar="foobar"; - -select instr("foobar", "bar"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar" AS p1, "bar"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar" p1, "bar"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar" AS "p1", "bar"); -## String concatenation, valid syntax -select instr("foobar" "p1", "bar"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr(@foobar "p1", "bar"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar", "bar" AS p2); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar", "bar" p2); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar", "bar" AS "p2"); -## String concatenation, valid syntax -select instr("foobar", "bar" "p2"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar", @bar "p2"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select instr("foobar" AS p1, "bar" AS p2); - -# Native function with 3 arguments - -select conv(255, 10, 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255 AS p1, 10, 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255 p1, 10, 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255 AS "p1", 10, 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255 "p1", 10, 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10 AS p2, 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10 p2, 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10 AS "p2", 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10 "p2", 16); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10, 16 AS p3); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10, 16 p3); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10, 16 AS "p3"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255, 10, 16 "p3"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select conv(255 AS p1, 10 AS p2, 16 AS p3); - -# Native function with a variable number of arguments - -select atan(10); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 AS p1); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 p1); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 AS "p1"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 "p1"); - -select atan(10, 20); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 AS p1, 20); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 p1, 20); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 AS "p1", 20); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 "p1", 20); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10, 20 AS p2); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10, 20 p2); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10, 20 AS "p2"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10, 20 "p2"); --- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT -select atan(10 AS p1, 20 AS p2); - -# -# Bug#22312 Syntax error in expression with INTERVAL() -# - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE; -SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE; -SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND; -SELECT 1 + INTERVAL(1,0,1,2) + 1; -SELECT INTERVAL(1^1,0,1,2) + 1; -SELECT INTERVAL(1,0+1,2,3) * 5.5; -SELECT INTERVAL(3,3,1+3,4+4) / 0.5; -SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2; -SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2); -SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3); - ---disable_warnings -SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND; -SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND; ---enable_warnings - -CREATE TABLE t1 (a INT, b DATETIME); -INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND); -SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1; -DROP TABLE t1; - -# -# Bug#28317 Left Outer Join with {oj outer-join} -# - ---disable_warnings -DROP TABLE IF EXISTS t1,t2,t3; ---enable_warnings -CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME); -CREATE TABLE t2 LIKE t1; -CREATE TABLE t3 LIKE t1; -SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2; -SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)}; -SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))}; -SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)}; -SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10; -SELECT {fn CONCAT(a1,a2)} FROM t1; -UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0; -SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')}; -DROP TABLE t1, t2, t3; From 0bb92b600e38333b353568679e1918377ea6c7f2 Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Tue, 8 Jul 2008 19:17:06 +0200 Subject: [PATCH 073/352] let's make a real honest attempt at finding the daemons in libexec --- mysql-test/mysql-test-run.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index fa41d25a034..eb59fd94f0f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1579,13 +1579,15 @@ sub executable_setup_ndb () { $exe_ndbd= mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd", - "$ndb_path/ndbd"); + "$ndb_path/ndbd", + "$glob_basedir/libexec/ndbd"); $exe_ndb_mgm= mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm", "$ndb_path/ndb_mgm"); $exe_ndb_mgmd= mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd", - "$ndb_path/ndb_mgmd"); + "$ndb_path/ndb_mgmd", + "$glob_basedir/libexec/ndb_mgmd"); $exe_ndb_waiter= mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter", "$ndb_path/ndb_waiter"); From 449d359fa00d29920518f1e9e1ffc0074f8c3aaf Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 8 Jul 2008 13:17:28 -0600 Subject: [PATCH 074/352] Fixed remaining test failure --- mysql-test/suite/funcs_1/r/ndb_storedproc.result | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc.result b/mysql-test/suite/funcs_1/r/ndb_storedproc.result index 3fd7020c114..04c1a45e67e 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc.result @@ -3635,13 +3635,9 @@ SELECT count(*) into cnt from t2; set @count = cnt; SELECT @count; END// -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; -set @count = cnt; -SELECT @count; -END' at line 2 +ERROR 42S22: Unknown column 'cnt' in 'field list' CALL sp1( 10 ); -ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; CREATE PROCEDURE sp1( cnt int(20) ) END SELECT count(*) into cnt from t2; From 443698a56d078915cc31850b40d7ae3206cda29e Mon Sep 17 00:00:00 2001 From: "kent@mysql.com" <> Date: Wed, 9 Jul 2008 08:23:30 +0200 Subject: [PATCH 075/352] Raise version number after cloning 5.0.66 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 247a17da940..40d04c19430 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.66) +AM_INIT_AUTOMAKE(mysql, 5.0.68) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=66 +NDB_VERSION_BUILD=68 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 28e02b178f198e3355a7877393e576ab756e15ab Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 9 Jul 2008 13:03:48 +0300 Subject: [PATCH 076/352] fixed a compilation warning on windows 64. --- mysys/default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/default.c b/mysys/default.c index bf32261129b..b7eb963e395 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1017,7 +1017,7 @@ static const char *my_get_module_parent(char *buf, size_t size) { char *last= NULL; char *end; - if (!GetModuleFileName(NULL, buf, size)) + if (!GetModuleFileName(NULL, buf, (DWORD) size)) return NULL; end= strend(buf); From e438f9f29d70d7e66abeef81d32bf03e77b7435c Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Wed, 9 Jul 2008 13:19:04 +0200 Subject: [PATCH 077/352] Bug#35736 Test 'parts.partition_basic_symlink_myisam' depends on output of 'ls' The problem is that relying on the output of the 'ls' command is not portable as its behavior is not the same between systems and it might even not be available at all in (Windows). So I added list_files that relies on the portable mysys library instead. (and also list_files_write_file and list_files_append_file, since the test was using '--exec ls' in that way.) --- client/mysqltest.c | 133 +- mysql-test/r/mysqltest.result | 3 + .../suite/parts/inc/partition_check_drop.inc | 20 +- .../suite/parts/inc/partition_layout.inc | 2 +- .../parts/inc/partition_layout_check1.inc | 8 +- .../parts/inc/partition_layout_check2.inc | 11 +- .../r/partition_alter1_1_2_myisam.result | 496 +- .../parts/r/partition_alter1_1_myisam.result | 496 +- .../parts/r/partition_alter1_2_myisam.result | 992 ++-- .../parts/r/partition_alter2_myisam.result | 4464 ++++++++--------- .../parts/r/partition_alter3_innodb.result | 104 +- .../parts/r/partition_alter3_myisam.result | 480 +- .../parts/r/partition_basic_innodb.result | 256 +- .../parts/r/partition_basic_myisam.result | 992 ++-- .../r/partition_basic_symlink_myisam.result | 2168 ++++---- .../parts/r/partition_engine_myisam.result | 176 +- .../parts/r/partition_syntax_myisam.result | 160 +- mysql-test/t/mysqltest.test | 12 + 18 files changed, 5557 insertions(+), 5416 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index f5a5c05b236..3bdaa270805 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -276,7 +276,8 @@ enum enum_commands { Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST, Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP, Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES, - Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR, + Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR, Q_LIST_FILES, + Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ @@ -368,6 +369,9 @@ const char *command_names[]= "change_user", "mkdir", "rmdir", + "list_files", + "list_files_write_file", + "list_files_append_file", 0 }; @@ -2836,6 +2840,126 @@ void do_rmdir(struct st_command *command) } +/* + SYNOPSIS + get_list_files + ds output + ds_dirname dir to list + ds_wild wild-card file pattern (can be empty) + + DESCRIPTION + list all entries in directory (matching ds_wild if given) +*/ + +static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname, + const DYNAMIC_STRING *ds_wild) +{ + uint i; + MY_DIR *dir_info; + FILEINFO *file; + DBUG_ENTER("get_list_files"); + + DBUG_PRINT("info", ("listing directory: %s", ds_dirname->str)); + /* Note that my_dir sorts the list if not given any flags */ + if (!(dir_info= my_dir(ds_dirname->str, MYF(0)))) + DBUG_RETURN(1); + for (i= 0; i < (uint) dir_info->number_off_files; i++) + { + file= dir_info->dir_entry + i; + if (file->name[0] == '.' && + (file->name[1] == '\0' || + (file->name[1] == '.' && file->name[2] == '\0'))) + continue; /* . or .. */ + if (ds_wild && ds_wild->length && + wild_compare(file->name, ds_wild->str, 0)) + continue; + dynstr_append(ds, file->name); + dynstr_append(ds, "\n"); + } + my_dirend(dir_info); + DBUG_RETURN(0); +} + + +/* + SYNOPSIS + do_list_files + command called command + + DESCRIPTION + list_files [] + List files and directories in directory (like `ls`) + [Matching , where wild-cards are allowed] +*/ + +static void do_list_files(struct st_command *command) +{ + int error; + static DYNAMIC_STRING ds_dirname; + static DYNAMIC_STRING ds_wild; + const struct command_arg list_files_args[] = { + {"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to list"}, + {"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"} + }; + DBUG_ENTER("do_list_files"); + + check_command_args(command, command->first_argument, + list_files_args, + sizeof(list_files_args)/sizeof(struct command_arg), ' '); + + error= get_list_files(&ds_res, &ds_dirname, &ds_wild); + handle_command_error(command, error); + dynstr_free(&ds_dirname); + dynstr_free(&ds_wild); + DBUG_VOID_RETURN; +} + + +/* + SYNOPSIS + do_list_files_write_file_command + command called command + append append file, or create new + + DESCRIPTION + list_files_{write|append}_file [] + List files and directories in directory (like `ls`) + [Matching , where wild-cards are allowed] + + Note: File will be truncated if exists and append is not true. +*/ + +static void do_list_files_write_file_command(struct st_command *command, + my_bool append) +{ + int error; + static DYNAMIC_STRING ds_content; + static DYNAMIC_STRING ds_filename; + static DYNAMIC_STRING ds_dirname; + static DYNAMIC_STRING ds_wild; + const struct command_arg list_files_args[] = { + {"filename", ARG_STRING, TRUE, &ds_filename, "Filename for write"}, + {"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to list"}, + {"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"} + }; + DBUG_ENTER("do_list_files_write_file"); + + check_command_args(command, command->first_argument, + list_files_args, + sizeof(list_files_args)/sizeof(struct command_arg), ' '); + + init_dynamic_string(&ds_content, "", 1024, 1024); + error= get_list_files(&ds_content, &ds_dirname, &ds_wild); + handle_command_error(command, error); + str_to_file2(ds_filename.str, ds_content.str, ds_content.length, append); + dynstr_free(&ds_content); + dynstr_free(&ds_filename); + dynstr_free(&ds_dirname); + dynstr_free(&ds_wild); + DBUG_VOID_RETURN; +} + + /* Read characters from line buffer or file. This is needed to allow my_ungetc() to buffer MAX_DELIMITER_LENGTH characters for a file @@ -7147,6 +7271,13 @@ int main(int argc, char **argv) case Q_REMOVE_FILE: do_remove_file(command); break; case Q_MKDIR: do_mkdir(command); break; case Q_RMDIR: do_rmdir(command); break; + case Q_LIST_FILES: do_list_files(command); break; + case Q_LIST_FILES_WRITE_FILE: + do_list_files_write_file_command(command, FALSE); + break; + case Q_LIST_FILES_APPEND_FILE: + do_list_files_write_file_command(command, TRUE); + break; case Q_FILE_EXIST: do_file_exist(command); break; case Q_WRITE_FILE: do_write_file(command); break; case Q_APPEND_FILE: do_append_file(command); break; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index adf99185d89..6ceed6b8d14 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -725,6 +725,9 @@ drop table t1; mysqltest: At line 1: change user failed: Unknown database 'inexistent' mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO) mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES) +file1.txt +file1.txt +file2.txt SELECT 'c:\\a.txt' AS col; col z diff --git a/mysql-test/suite/parts/inc/partition_check_drop.inc b/mysql-test/suite/parts/inc/partition_check_drop.inc index 34a921374e6..1ab12e738ab 100644 --- a/mysql-test/suite/parts/inc/partition_check_drop.inc +++ b/mysql-test/suite/parts/inc/partition_check_drop.inc @@ -11,9 +11,6 @@ #------------------------------------------------------------------------------# # Original Author: mleich # # Original Date: 2006-05-12 # -# Change Author: # -# Change Date: # -# Change: # ################################################################################ if ($no_debug) @@ -23,25 +20,26 @@ if ($no_debug) if ($do_file_tests) { +let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2; # List the files belonging to the table t1 ---exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 || true +--list_files_write_file $ls_file $MYSQLTEST_VARDIR/master-data/test t1* +--chmod 0644 $ls_file if ($with_directories) { ---exec ls $MYSQLTEST_VARDIR/tmp/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 || true +--list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1* } -eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2'')'); -let $file_list= `SELECT @aux`; +eval SET @aux = load_file('$ls_file'); } if (!$do_file_tests) { -let $file_list= '--- not determined ---'; +SET @aux = '--- not determined ---'; } # UPDATE the current filelist of the table t1 within t0_definition # Note: This list should be empty, because the table t1 was dropped ! -eval INSERT INTO t0_definition SET state = 'old', file_list = $file_list -ON DUPLICATE KEY UPDATE file_list = $file_list; -# eval UPDATE t0_definition SET file_list = $file_list WHERE state = 'old'; +eval INSERT INTO t0_definition SET state = 'old', file_list = @aux +ON DUPLICATE KEY UPDATE file_list = @aux; +# eval UPDATE t0_definition SET file_list = @aux WHERE state = 'old'; # Check if filelist is empty. let $found_garbage= `SELECT file_list <> '' FROM t0_definition WHERE state = 'old'`; diff --git a/mysql-test/suite/parts/inc/partition_layout.inc b/mysql-test/suite/parts/inc/partition_layout.inc index c4181ef1cfd..23872b7ff1f 100644 --- a/mysql-test/suite/parts/inc/partition_layout.inc +++ b/mysql-test/suite/parts/inc/partition_layout.inc @@ -10,5 +10,5 @@ eval SHOW CREATE TABLE t1; if ($ls) { --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR - --exec ls $MYSQLTEST_VARDIR/master-data/test/t1* + --list_files $MYSQLTEST_VARDIR/master-data/test t1* } diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc index 587339e123e..fb5887f9124 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check1.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc @@ -38,12 +38,12 @@ if ($do_file_tests) { # List the files belonging to the table t1 let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2; -let $err_file= $MYSQLTEST_VARDIR/master-data/test/err2; ---exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $ls_file 2>$err_file || true +--list_files_write_file $ls_file $MYSQLTEST_VARDIR/master-data/test t1* +--chmod 0644 $ls_file if ($with_directories) { ---exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true ---exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true +--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1* +--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1* } eval SET @aux = load_file('$ls_file'); } diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc index 2f42fb90c14..17dc0016b1d 100644 --- a/mysql-test/suite/parts/inc/partition_layout_check2.inc +++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc @@ -14,9 +14,6 @@ #------------------------------------------------------------------------------# # Original Author: mleich # # Original Date: 2006-03-05 # -# Change Author: # -# Change Date: # -# Change: # ################################################################################ if ($no_debug) @@ -34,12 +31,12 @@ if ($do_file_tests) { # List the files belonging to the table t1 let $ls_file= $MYSQLTEST_VARDIR/master-data/test/tmp2; -let $err_file= $MYSQLTEST_VARDIR/master-data/test/err2; ---exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $ls_file 2>$err_file || true +--list_files_write_file $ls_file $MYSQLTEST_VARDIR/master-data/test t1* +--chmod 0644 $ls_file if ($with_directories) { ---exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $ls_file 2>>$err_file || true ---exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $ls_file 2>>$err_file || true +--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-data-dir t1* +--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1* } eval SET @aux = load_file('$ls_file'); } diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result index 7533b42340f..d93377694a6 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result @@ -77,12 +77,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -592,18 +592,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1121,24 +1121,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1654,20 +1654,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2179,24 +2179,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2712,24 +2712,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3245,24 +3245,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3776,26 +3776,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4306,12 +4306,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4821,18 +4821,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5350,24 +5350,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5883,20 +5883,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6408,24 +6408,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6941,24 +6941,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7474,24 +7474,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8005,26 +8005,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result index 69b8067d043..e4020cd4074 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result @@ -236,12 +236,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -751,18 +751,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1280,24 +1280,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1813,20 +1813,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2338,24 +2338,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2873,24 +2873,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3406,24 +3406,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3937,26 +3937,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4467,12 +4467,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4982,18 +4982,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5511,24 +5511,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6044,20 +6044,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6569,24 +6569,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7104,24 +7104,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7637,24 +7637,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8168,26 +8168,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result index 23f32a715b4..e3e376eca71 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result @@ -74,12 +74,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -537,18 +537,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1014,24 +1014,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1495,20 +1495,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1968,24 +1968,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2451,24 +2451,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2932,24 +2932,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3411,26 +3411,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3893,12 +3893,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4356,18 +4356,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4833,24 +4833,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5314,20 +5314,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5787,24 +5787,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6268,24 +6268,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6749,24 +6749,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7228,26 +7228,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7706,12 +7706,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8169,18 +8169,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8646,24 +8646,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9127,20 +9127,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9600,24 +9600,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10081,24 +10081,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10562,24 +10562,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11041,26 +11041,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11519,12 +11519,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11982,18 +11982,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12459,24 +12459,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12940,20 +12940,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13413,24 +13413,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13894,24 +13894,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14375,24 +14375,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14854,26 +14854,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_myisam.result index 99cb22b97c3..054e4b297b8 100644 --- a/mysql-test/suite/parts/r/partition_alter2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_myisam.result @@ -76,12 +76,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -539,18 +539,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1016,24 +1016,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1497,20 +1497,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1970,24 +1970,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2453,24 +2453,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2934,24 +2934,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3413,26 +3413,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3893,12 +3893,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4408,18 +4408,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4937,24 +4937,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5470,20 +5470,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5995,24 +5995,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6530,24 +6530,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7063,24 +7063,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7594,26 +7594,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8124,12 +8124,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8639,18 +8639,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9168,24 +9168,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9701,20 +9701,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10226,24 +10226,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10761,24 +10761,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11294,24 +11294,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11825,26 +11825,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12359,12 +12359,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12822,18 +12822,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13299,24 +13299,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13780,20 +13780,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14253,24 +14253,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14736,24 +14736,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15217,24 +15217,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15696,26 +15696,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16174,12 +16174,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16637,18 +16637,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17114,24 +17114,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17595,20 +17595,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18068,24 +18068,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18549,24 +18549,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19030,24 +19030,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19509,26 +19509,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19989,12 +19989,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20504,18 +20504,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21033,24 +21033,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21566,20 +21566,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22091,24 +22091,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22626,24 +22626,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23159,24 +23159,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23690,26 +23690,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24220,12 +24220,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24735,18 +24735,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25264,24 +25264,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25797,20 +25797,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26322,24 +26322,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26855,24 +26855,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27388,24 +27388,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27919,26 +27919,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28449,12 +28449,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28964,18 +28964,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29493,24 +29493,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30026,20 +30026,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30551,24 +30551,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31086,24 +31086,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31619,24 +31619,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32150,26 +32150,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32680,12 +32680,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33195,18 +33195,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33724,24 +33724,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34257,20 +34257,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34782,24 +34782,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35315,24 +35315,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35848,24 +35848,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -36379,26 +36379,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -36917,12 +36917,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -37382,18 +37382,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -37861,24 +37861,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -38344,20 +38344,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -38817,24 +38817,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -39302,24 +39302,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -39783,24 +39783,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -40264,26 +40264,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -40746,12 +40746,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -41263,18 +41263,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -41794,24 +41794,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -42329,20 +42329,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -42854,24 +42854,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -43391,24 +43391,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -43924,24 +43924,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -44457,26 +44457,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -44989,12 +44989,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -45506,18 +45506,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -46037,24 +46037,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -46572,20 +46572,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -47097,24 +47097,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -47634,24 +47634,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -48167,24 +48167,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -48700,26 +48700,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -49235,12 +49235,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -49701,18 +49701,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -50181,24 +50181,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -50665,20 +50665,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -51143,24 +51143,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -51629,24 +51629,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -52115,24 +52115,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -52597,26 +52597,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -53078,12 +53078,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -53544,18 +53544,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54024,24 +54024,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54508,20 +54508,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54986,24 +54986,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -55472,24 +55472,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -55958,24 +55958,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -56440,26 +56440,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -56923,12 +56923,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -57441,18 +57441,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -57973,24 +57973,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -58509,20 +58509,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -59039,24 +59039,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -59577,24 +59577,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -60115,24 +60115,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -60649,26 +60649,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -61182,12 +61182,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -61700,18 +61700,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -62232,24 +62232,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -62768,20 +62768,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -63298,24 +63298,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -63836,24 +63836,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -64374,24 +64374,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -64908,26 +64908,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -65441,12 +65441,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -65959,18 +65959,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -66491,24 +66491,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -67027,20 +67027,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -67557,24 +67557,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -68095,24 +68095,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -68633,24 +68633,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -69167,26 +69167,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -69700,12 +69700,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -70218,18 +70218,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -70750,24 +70750,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -71286,20 +71286,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -71816,24 +71816,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -72354,24 +72354,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -72892,24 +72892,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -73426,26 +73426,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result index 2ca1e783839..16e6c0ff5fd 100644 --- a/mysql-test/suite/parts/r/partition_alter3_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result @@ -56,7 +56,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -77,8 +77,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -94,8 +94,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -109,8 +109,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -130,8 +130,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -149,8 +149,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -165,8 +165,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where @@ -193,8 +193,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -208,8 +208,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where @@ -223,8 +223,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -238,8 +238,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -253,8 +253,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -268,8 +268,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -283,8 +283,8 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -302,7 +302,7 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -363,8 +363,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -387,8 +387,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -406,8 +406,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -425,8 +425,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB, PARTITION p7 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -451,8 +451,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB, PARTITION p6 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -469,8 +469,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB, PARTITION p5 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where @@ -487,8 +487,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB, PARTITION p4 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where @@ -505,8 +505,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -523,8 +523,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB, PARTITION part7 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -541,8 +541,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB, PARTITION part1 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -559,8 +559,8 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = InnoDB) */ -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -581,7 +581,7 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result index 5684ca89b1c..3a017b6576b 100644 --- a/mysql-test/suite/parts/r/partition_alter3_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result @@ -56,9 +56,9 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.MYD -MYSQLTEST_VARDIR/master-data/test/t1.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -79,10 +79,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -98,10 +98,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -115,10 +115,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -138,14 +138,14 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -163,16 +163,16 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -187,24 +187,24 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1#P#p6.MYD +t1#P#p6.MYI +t1#P#p7.MYD +t1#P#p7.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where @@ -231,22 +231,22 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1#P#p6.MYD +t1#P#p6.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -260,20 +260,20 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where @@ -287,18 +287,18 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -312,16 +312,16 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where @@ -335,14 +335,14 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where @@ -356,12 +356,12 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -375,10 +375,10 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) (PARTITION p0 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -396,9 +396,9 @@ t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.MYD -MYSQLTEST_VARDIR/master-data/test/t1.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -431,9 +431,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.MYD -MYSQLTEST_VARDIR/master-data/test/t1.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where @@ -455,10 +455,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -481,14 +481,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -506,16 +506,16 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -533,24 +533,24 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM, PARTITION p7 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p7.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1#P#p6.MYD +t1#P#p6.MYI +t1#P#p7.MYD +t1#P#p7.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where @@ -575,22 +575,22 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM, PARTITION p6 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p6.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1#P#p6.MYD +t1#P#p6.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where @@ -607,20 +607,20 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where @@ -637,18 +637,18 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where @@ -665,16 +665,16 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where @@ -691,14 +691,14 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM, PARTITION part7 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part7.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part7.MYD +t1#P#part7.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where @@ -715,12 +715,12 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM, PARTITION part1 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where @@ -737,10 +737,10 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p0 ENGINE = MyISAM) */ -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm -MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where @@ -761,9 +761,9 @@ t1 CREATE TABLE `t1` ( `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -MYSQLTEST_VARDIR/master-data/test/t1.MYD -MYSQLTEST_VARDIR/master-data/test/t1.MYI -MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 Using where diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index 7f5e7df6061..1c340d913bf 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -75,8 +75,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -527,8 +527,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -987,8 +987,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1445,8 +1445,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1899,8 +1899,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2359,8 +2359,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2821,8 +2821,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3277,8 +3277,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3731,8 +3731,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4183,8 +4183,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4643,8 +4643,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5101,8 +5101,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5555,8 +5555,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6013,8 +6013,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6471,8 +6471,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6927,8 +6927,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7387,8 +7387,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7876,8 +7876,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8373,8 +8373,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8868,8 +8868,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9359,8 +9359,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9856,8 +9856,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10355,8 +10355,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10848,8 +10848,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11338,8 +11338,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11827,8 +11827,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12324,8 +12324,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12819,8 +12819,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13310,8 +13310,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13807,8 +13807,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14306,8 +14306,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14799,8 +14799,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15289,8 +15289,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15794,8 +15794,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16307,8 +16307,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16818,8 +16818,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17325,8 +17325,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17838,8 +17838,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18353,8 +18353,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18862,8 +18862,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19373,8 +19373,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19862,8 +19862,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20359,8 +20359,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20854,8 +20854,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21345,8 +21345,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21840,8 +21840,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22335,8 +22335,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22828,8 +22828,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23318,8 +23318,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23807,8 +23807,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24304,8 +24304,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24799,8 +24799,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25290,8 +25290,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25785,8 +25785,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26280,8 +26280,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26773,8 +26773,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27263,8 +27263,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27768,8 +27768,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28281,8 +28281,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28792,8 +28792,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION parte VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29299,8 +29299,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION partb VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29810,8 +29810,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30321,8 +30321,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30830,8 +30830,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = InnoDB, PARTITION part2 VALUES IN (1) ENGINE = InnoDB, PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result index 4d1f160eace..72592d8ee92 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -75,12 +75,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -533,18 +533,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1005,24 +1005,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1481,20 +1481,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1949,24 +1949,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2427,24 +2427,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2907,24 +2907,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3381,26 +3381,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3855,12 +3855,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4313,18 +4313,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4785,24 +4785,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5261,20 +5261,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5729,24 +5729,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6205,24 +6205,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6681,24 +6681,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7155,26 +7155,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7635,12 +7635,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8146,18 +8146,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8671,24 +8671,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9200,20 +9200,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9721,24 +9721,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10252,24 +10252,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10785,24 +10785,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11312,26 +11312,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11843,12 +11843,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12354,18 +12354,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) PARTITIONS 5 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12879,24 +12879,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13408,20 +13408,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13929,24 +13929,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14458,24 +14458,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14987,24 +14987,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15514,26 +15514,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) ENGINE = MyISAM, PARTITION part2 VALUES IN (1) ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result index c97bdbec83e..658e255dfac 100644 --- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result @@ -85,16 +85,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p1.MYI +t1#P#p2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -562,28 +562,28 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p4.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p5.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p4.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p5.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p3.MYD +t1#P#p4.MYD +t1#P#p5.MYD +t1#P#p1.MYI +t1#P#p2.MYI +t1#P#p3.MYI +t1#P#p4.MYI +t1#P#p5.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1052,40 +1052,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_N.MYI +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par +t1#P#part0.MYD +t1#P#part1.MYD +t1#P#part2.MYD +t1#P#part3.MYD +t1#P#part_1.MYD +t1#P#part_2.MYD +t1#P#part_3.MYD +t1#P#part_N.MYD +t1#P#part0.MYI +t1#P#part1.MYI +t1#P#part2.MYI +t1#P#part3.MYI +t1#P#part_1.MYI +t1#P#part_2.MYI +t1#P#part_3.MYI +t1#P#part_N.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1556,32 +1556,32 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parte.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partf.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parte.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partf.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par +t1#P#parta.MYD +t1#P#partb.MYD +t1#P#partc.MYD +t1#P#partd.MYD +t1#P#parte.MYD +t1#P#partf.MYD +t1#P#parta.MYI +t1#P#partb.MYI +t1#P#partc.MYI +t1#P#partd.MYI +t1#P#parte.MYI +t1#P#partf.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2044,40 +2044,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp1.MYI +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp1.MYD +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp1.MYD +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp1.MYD +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp1.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2542,40 +2542,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart42.MYI +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart12.MYD +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart22.MYD +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart32.MYD +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart42.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3058,40 +3058,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp42.MYI +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp12.MYD +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp22.MYD +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp32.MYD +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp42.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3554,44 +3554,44 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp2.MYI +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp2.MYD +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp2.MYD +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp2.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4052,16 +4052,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p1.MYI +t1#P#p2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4529,28 +4529,28 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p4.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p5.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p4.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p5.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p3.MYD +t1#P#p4.MYD +t1#P#p5.MYD +t1#P#p1.MYI +t1#P#p2.MYI +t1#P#p3.MYI +t1#P#p4.MYI +t1#P#p5.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5019,40 +5019,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_N.MYI +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par +t1#P#part0.MYD +t1#P#part1.MYD +t1#P#part2.MYD +t1#P#part3.MYD +t1#P#part_1.MYD +t1#P#part_2.MYD +t1#P#part_3.MYD +t1#P#part_N.MYD +t1#P#part0.MYI +t1#P#part1.MYI +t1#P#part2.MYI +t1#P#part3.MYI +t1#P#part_1.MYI +t1#P#part_2.MYI +t1#P#part_3.MYI +t1#P#part_N.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5523,32 +5523,32 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parte.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partf.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parte.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partf.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par +t1#P#parta.MYD +t1#P#partb.MYD +t1#P#partc.MYD +t1#P#partd.MYD +t1#P#parte.MYD +t1#P#partf.MYD +t1#P#parta.MYI +t1#P#partb.MYI +t1#P#partc.MYI +t1#P#partd.MYI +t1#P#parte.MYI +t1#P#partf.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6011,40 +6011,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp1.MYI +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp1.MYD +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp1.MYD +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp1.MYD +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp1.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6507,40 +6507,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart42.MYI +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart12.MYD +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart22.MYD +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart32.MYD +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart42.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7023,40 +7023,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp42.MYI +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp12.MYD +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp22.MYD +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp32.MYD +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp42.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7519,44 +7519,44 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp2.MYI +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp2.MYD +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp2.MYD +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp2.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8023,16 +8023,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p1.MYI +t1#P#p2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8553,28 +8553,28 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p4.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p5.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p4.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p5.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p3.MYD +t1#P#p4.MYD +t1#P#p5.MYD +t1#P#p1.MYI +t1#P#p2.MYI +t1#P#p3.MYI +t1#P#p4.MYI +t1#P#p5.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9096,40 +9096,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_N.MYI +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par +t1#P#part0.MYD +t1#P#part1.MYD +t1#P#part2.MYD +t1#P#part3.MYD +t1#P#part_1.MYD +t1#P#part_2.MYD +t1#P#part_3.MYD +t1#P#part_N.MYD +t1#P#part0.MYI +t1#P#part1.MYI +t1#P#part2.MYI +t1#P#part3.MYI +t1#P#part_1.MYI +t1#P#part_2.MYI +t1#P#part_3.MYI +t1#P#part_N.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9653,32 +9653,32 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parte.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partf.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parte.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partf.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par +t1#P#parta.MYD +t1#P#partb.MYD +t1#P#partc.MYD +t1#P#partd.MYD +t1#P#parte.MYD +t1#P#partf.MYD +t1#P#parta.MYI +t1#P#partb.MYI +t1#P#partc.MYI +t1#P#partd.MYI +t1#P#parte.MYI +t1#P#partf.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10194,40 +10194,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp1.MYI +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp1.MYD +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp1.MYD +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp1.MYD +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp1.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10745,40 +10745,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart42.MYI +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart12.MYD +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart22.MYD +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart32.MYD +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart42.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11314,40 +11314,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp42.MYI +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp12.MYD +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp22.MYD +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp32.MYD +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp42.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11863,44 +11863,44 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp2.MYI +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp2.MYD +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp2.MYD +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp2.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12418,16 +12418,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1 + f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p1.MYI +t1#P#p2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12948,28 +12948,28 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1,f_int2) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p5 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p4.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p5.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p4.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p5.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p2.MYD +t1#P#p3.MYD +t1#P#p4.MYD +t1#P#p5.MYD +t1#P#p1.MYI +t1#P#p2.MYI +t1#P#p3.MYI +t1#P#p4.MYI +t1#P#p5.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13491,40 +13491,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1 + f_int2,4)) (PARTITION part_3 VALUES IN (-3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_N.MYI +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par +t1#P#part0.MYD +t1#P#part1.MYD +t1#P#part2.MYD +t1#P#part3.MYD +t1#P#part_1.MYD +t1#P#part_2.MYD +t1#P#part_3.MYD +t1#P#part_N.MYD +t1#P#part0.MYI +t1#P#part1.MYI +t1#P#part2.MYI +t1#P#part3.MYI +t1#P#part_1.MYI +t1#P#part_2.MYI +t1#P#part_3.MYI +t1#P#part_N.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14048,32 +14048,32 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE ((f_int1 + f_int2) DIV 2) (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parte.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partf.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parte.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partf.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par +t1#P#parta.MYD +t1#P#partb.MYD +t1#P#partc.MYD +t1#P#partd.MYD +t1#P#parte.MYD +t1#P#partf.MYD +t1#P#parta.MYI +t1#P#partb.MYI +t1#P#partc.MYI +t1#P#partd.MYI +t1#P#parte.MYI +t1#P#partf.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14589,40 +14589,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int2) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp1.MYI +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp1.MYD +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp1.MYD +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp1.MYD +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp1.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15138,40 +15138,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int2) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#subpart42.MYI +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart12.MYD +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart22.MYD +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart32.MYD +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart42.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15707,40 +15707,40 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int2 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp42.MYI +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp12.MYD +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp22.MYD +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp32.MYD +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp42.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16256,44 +16256,44 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int2) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part2 VALUES IN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#part3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#part1sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#part2sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#part3sp2.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#part1sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#part2sp2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#part3sp2.MYI +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYD +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYD +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYD +t1#P#part3#SP#part3sp2.MYI +t1.frm +t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp2.MYD +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp2.MYD +t1#P#part3#SP#part3sp0.MYD +t1#P#part3#SP#part3sp1.MYD +t1#P#part3#SP#part3sp2.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYI +t1#P#part1#SP#part1sp2.MYI +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYI +t1#P#part2#SP#part2sp2.MYI +t1#P#part3#SP#part3sp0.MYI +t1#P#part3#SP#part3sp1.MYI +t1#P#part3#SP#part3sp2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16807,14 +16807,14 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1.frm +t1.par +t1#P#p1.MYI +t1#P#p2.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17330,23 +17330,23 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION p2 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION p4 ENGINE = MyISAM, PARTITION p5 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p3.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p2.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p5.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1#P#p2.MYD +t1#P#p2.MYI +t1#P#p3.MYD +t1#P#p3.MYI +t1#P#p4.MYD +t1#P#p4.MYI +t1#P#p5.MYD +t1#P#p5.MYI +t1.frm +t1.par +t1#P#p1.MYD +t1#P#p3.MYD +t1#P#p2.MYI +t1#P#p3.MYI +t1#P#p5.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17868,33 +17868,33 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION part0 VALUES IN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION part3 VALUES IN (3) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part_3.MYI +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par +t1#P#part2.MYD +t1#P#part3.MYD +t1#P#part_1.MYD +t1#P#part_2.MYD +t1#P#part_N.MYD +t1#P#part0.MYI +t1#P#part3.MYI +t1#P#part_1.MYI +t1#P#part_3.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18412,26 +18412,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION parte VALUES LESS THAN (20) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partf VALUES LESS THAN (2147483646) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parte.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partf.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partc.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#parte.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partc.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partf.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1#P#partb.MYD +t1#P#partb.MYI +t1#P#partc.MYD +t1#P#partc.MYI +t1#P#partd.MYD +t1#P#partd.MYI +t1#P#parte.MYD +t1#P#parte.MYI +t1#P#partf.MYD +t1#P#partf.MYI +t1.frm +t1.par +t1#P#partb.MYD +t1#P#partc.MYD +t1#P#parte.MYD +t1#P#parta.MYI +t1#P#partc.MYI +t1#P#partf.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18943,32 +18943,32 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0) INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, PARTITION partb VALUES LESS THAN (5) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, PARTITION partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION partd VALUES LESS THAN (2147483646) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partb#SP#partbsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partc#SP#partcsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#partd#SP#partdsp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partb#SP#partbsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp0.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#partd#SP#partdsp1.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#parta#SP#partasp1.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp0.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#partd#SP#partdsp1.MYI +t1#P#parta#SP#partasp0.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYD +t1#P#parta#SP#partasp1.MYI +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp0.MYI +t1#P#partb#SP#partbsp1.MYD +t1#P#partb#SP#partbsp1.MYI +t1#P#partc#SP#partcsp0.MYD +t1#P#partc#SP#partcsp0.MYI +t1#P#partc#SP#partcsp1.MYD +t1#P#partc#SP#partcsp1.MYI +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYD +t1#P#partd#SP#partdsp1.MYI +t1.frm +t1.par +t1#P#partb#SP#partbsp0.MYD +t1#P#partb#SP#partbsp1.MYD +t1#P#partd#SP#partdsp0.MYD +t1#P#partd#SP#partdsp1.MYD +t1#P#parta#SP#partasp0.MYI +t1#P#parta#SP#partasp1.MYI +t1#P#partd#SP#partdsp0.MYI +t1#P#partd#SP#partdsp1.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19486,32 +19486,32 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, SUBPARTITION subpart12 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (5) (SUBPARTITION subpart21 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart22 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (10) (SUBPARTITION subpart31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION subpart32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#subpart32.MYI +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1#P#part4#SP#subpart41.MYD +t1#P#part4#SP#subpart41.MYI +t1#P#part4#SP#subpart42.MYD +t1#P#part4#SP#subpart42.MYI +t1.frm +t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart12.MYD +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart32.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20039,38 +20039,38 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part1 VALUES IN (0) (SUBPARTITION sp11 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp12 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part2 VALUES IN (1) (SUBPARTITION sp21 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' ENGINE = MyISAM, SUBPARTITION sp22 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part3 VALUES IN (2) (SUBPARTITION sp31 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp32 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM, SUBPARTITION sp42 DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part1#SP#sp11.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp21.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part2#SP#sp22.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp31.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part3#SP#sp32.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp41.MYD -$MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#part4#SP#sp42.MYD -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp11.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part1#SP#sp12.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part2#SP#sp22.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp31.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part3#SP#sp32.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp41.MYI -$MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#part4#SP#sp42.MYI +t1#P#part1#SP#sp11.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYD +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp21.MYI +t1#P#part2#SP#sp22.MYD +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYD +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYD +t1#P#part4#SP#sp42.MYI +t1.frm +t1.par +t1#P#part1#SP#sp11.MYD +t1#P#part2#SP#sp21.MYD +t1#P#part2#SP#sp22.MYD +t1#P#part3#SP#sp31.MYD +t1#P#part3#SP#sp32.MYD +t1#P#part4#SP#sp41.MYD +t1#P#part4#SP#sp42.MYD +t1#P#part1#SP#sp11.MYI +t1#P#part1#SP#sp12.MYI +t1#P#part2#SP#sp22.MYI +t1#P#part3#SP#sp31.MYI +t1#P#part3#SP#sp32.MYI +t1#P#part4#SP#sp41.MYI +t1#P#part4#SP#sp42.MYI # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index 2dfea58995e..79fdfbb62b0 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -70,12 +70,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -534,12 +534,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -999,16 +999,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1529,16 +1529,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2035,16 +2035,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2502,16 +2502,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2969,12 +2969,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3434,16 +3434,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3904,16 +3904,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4367,10 +4367,10 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1.MYD +t1#P#part1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4826,12 +4826,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_syntax_myisam.result b/mysql-test/suite/parts/r/partition_syntax_myisam.result index 93cb075ce2f..ab2a5797cd7 100644 --- a/mysql-test/suite/parts/r/partition_syntax_myisam.result +++ b/mysql-test/suite/parts/r/partition_syntax_myisam.result @@ -662,12 +662,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM, PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1.frm +t1.par DROP TABLE t1; # 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0) @@ -694,14 +694,14 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = MyISAM, PARTITION part2 VALUES IN (0) ENGINE = MyISAM, PARTITION part3 VALUES IN (1) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1.frm +t1.par DROP TABLE t1; @@ -734,10 +734,10 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par DROP TABLE t1; # 4.1.2 no partition number, named partitions @@ -761,12 +761,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1.frm +t1.par DROP TABLE t1; # 4.1.3 variations on no partition/subpartition number, named partitions, @@ -852,20 +852,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (20) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1#P#part3#SP#subpart31.MYD +t1#P#part3#SP#subpart31.MYI +t1#P#part3#SP#subpart32.MYD +t1#P#part3#SP#subpart32.MYI +t1.frm +t1.par DROP TABLE t1; #------------------------------------------------------------------------ @@ -893,12 +893,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1#P#p1.MYD +t1#P#p1.MYI +t1.frm +t1.par DROP TABLE t1; CREATE TABLE t1 ( @@ -924,16 +924,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part1#SP#part1sp1.MYD +t1#P#part1#SP#part1sp1.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1#P#part2#SP#part2sp1.MYD +t1#P#part2#SP#part2sp1.MYI +t1.frm +t1.par DROP TABLE t1; CREATE TABLE t1 ( @@ -956,10 +956,10 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 1 */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#p0.MYD +t1#P#p0.MYI +t1.frm +t1.par DROP TABLE t1; CREATE TABLE t1 ( @@ -985,12 +985,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#part1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#part2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#part1sp0.MYD +t1#P#part1#SP#part1sp0.MYI +t1#P#part2#SP#part2sp0.MYD +t1#P#part2#SP#part2sp0.MYI +t1.frm +t1.par DROP TABLE t1; CREATE TABLE t1 ( @@ -1732,12 +1732,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = MyISAM, PARTITION part2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1.frm +t1.par DROP TABLE t1; CREATE TABLE t1 ( @@ -1766,16 +1766,16 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part1#SP#subpart11.MYD +t1#P#part1#SP#subpart11.MYI +t1#P#part1#SP#subpart12.MYD +t1#P#part1#SP#subpart12.MYI +t1#P#part2#SP#subpart21.MYD +t1#P#part2#SP#subpart21.MYI +t1#P#part2#SP#subpart22.MYD +t1#P#part2#SP#subpart22.MYI +t1.frm +t1.par DROP TABLE t1; # 4.3.2 (positive) number of partition/subpartition , diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index b41f033d2af..5a96415d2d9 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -2117,10 +2117,22 @@ mkdir $MYSQLTEST_VARDIR/tmp/testdir; write_file $MYSQLTEST_VARDIR/tmp/testdir/file1.txt; hello EOF + +list_files $MYSQLTEST_VARDIR/tmp/testdir; +# list_files gets the directory list before creating the new file +list_files_write_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR/tmp/testdir *; +list_files_append_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR/tmp/testdir *2*; +list_files_write_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR/tmp/testdir file?.txt; +list_files_append_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt $MYSQLTEST_VARDIR/tmp/testdir file*.txt; +diff_files $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR/tmp/testdir/file3.txt; --error 1 rmdir $MYSQLTEST_VARDIR/tmp/testdir; +cat_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt; + remove_file $MYSQLTEST_VARDIR/tmp/testdir/file1.txt; +remove_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt; +remove_file $MYSQLTEST_VARDIR/tmp/testdir/file3.txt; rmdir $MYSQLTEST_VARDIR/tmp/testdir; # From 72481997837c1255f4ef0f831bb252b57057f828 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Wed, 9 Jul 2008 13:22:07 +0200 Subject: [PATCH 078/352] 1. Fix for Bug#37160 "funcs_2: The tests do not check if optional character sets exist." 2. Minor cleanup --- .../suite/funcs_2/charset/charset_master.test | 90 ++++++++++++++++++- .../suite/funcs_2/t/innodb_charset.test | 12 +-- .../suite/funcs_2/t/memory_charset.test | 12 +-- .../suite/funcs_2/t/myisam_charset.test | 12 +-- mysql-test/suite/funcs_2/t/ndb_charset.test | 12 +-- 5 files changed, 114 insertions(+), 24 deletions(-) diff --git a/mysql-test/suite/funcs_2/charset/charset_master.test b/mysql-test/suite/funcs_2/charset/charset_master.test index a241e62f0f4..09e24e2c246 100644 --- a/mysql-test/suite/funcs_2/charset/charset_master.test +++ b/mysql-test/suite/funcs_2/charset/charset_master.test @@ -1,14 +1,96 @@ ################################################################################# -# Author: Serge Kozlov # -# Date: 09/21/2005 # -# Purpose: used by ../t/*_charset.test # -# Require: set $engine_type= [NDB,MyISAM,InnoDB,etc] before calling # +# Author: Serge Kozlov # +# Date: 2005-09-21 # +# Purpose: used by ../t/*_charset.test # +# Require: set $engine_type= [NDB,MyISAM,InnoDB,etc] before calling # +# # +# Last modification: Matthias Leich # +# Date: 2008-07-02 # +# Purpose: Fix Bug#37160 funcs_2: The tests do not check if optional character # +# sets exist. # +# Add checking of prerequisites + minor cleanup # ################################################################################# # # # +# Check that all character sets needed are available +# Note(mleich): +# It is intentional that the common solution with +# "--source include/have_.inc" +# is not applied. +# - We currently do not have such a prerequisite test for every character set +# /collation needed. +# - There is also no real value in mentioning the first missing character set +# /collation within the "skip message" because it is most probably only +# one of many. +# +# Hint: 5 character_set_names per source line if possible +if (`SELECT COUNT(*) <> 36 FROM information_schema.character_sets + WHERE CHARACTER_SET_NAME IN ( + 'armscii8', 'ascii' , 'big5' , 'binary' , 'cp1250', + 'cp1251' , 'cp1256' , 'cp1257' , 'cp850' , 'cp852' , + 'cp866' , 'cp932' , 'dec8' , 'eucjpms', 'euckr' , + 'gb2312' , 'gbk' , 'geostd8', 'greek' , 'hebrew', + 'hp8' , 'keybcs2', 'koi8r' , 'koi8u' , 'latin1', + 'latin2' , 'latin5' , 'latin7' , 'macce' , 'macroman', + 'sjis' , 'swe7' , 'tis620' , 'ucs2' , 'ujis', + 'utf8' + )`) +{ + --skip Not all character sets required for this test are present +} +# Check that all collations needed are available +# Hint: 4 collation_names per source line if possible +if (`SELECT COUNT(*) <> 123 FROM information_schema.collations +WHERE collation_name IN ( +'armscii8_bin', 'armscii8_general_ci', 'ascii_bin', 'ascii_general_ci', +'big5_bin', 'big5_chinese_ci', 'cp1250_bin', 'cp1250_croatian_ci', +'cp1250_czech_cs', 'cp1250_general_ci', 'cp1251_bin', 'cp1251_bulgarian_ci', +'cp1251_general_ci', 'cp1251_general_cs', 'cp1251_ukrainian_ci', 'cp1256_bin', +'cp1256_general_ci', 'cp1257_bin', 'cp1257_general_ci', 'cp1257_lithuanian_ci', +'cp850_bin', 'cp850_general_ci', 'cp852_bin', 'cp852_general_ci', +'cp866_bin', 'cp866_general_ci', 'cp932_bin', 'cp932_japanese_ci', +'dec8_bin', 'dec8_swedish_ci', 'eucjpms_bin', 'eucjpms_japanese_ci', +'euckr_bin', 'euckr_korean_ci', 'gb2312_bin', 'gb2312_chinese_ci', +'gbk_bin', 'gbk_chinese_ci', 'geostd8_bin', 'geostd8_general_ci', +'greek_bin', 'greek_general_ci', 'hebrew_bin', 'hebrew_general_ci', +'hp8_bin', 'hp8_english_ci', 'keybcs2_bin', 'keybcs2_general_ci', +'koi8r_bin', 'koi8r_general_ci', 'koi8u_bin', 'koi8u_general_ci', +'latin1_bin', 'latin1_danish_ci', 'latin1_general_ci', 'latin1_general_cs', +'latin1_german1_ci', 'latin1_german2_ci', 'latin1_spanish_ci', 'latin1_swedish_ci', +'latin2_bin', 'latin2_croatian_ci', 'latin2_czech_cs', 'latin2_general_ci', +'latin2_hungarian_ci', 'latin5_bin', 'latin5_turkish_ci', 'latin7_bin', +'latin7_estonian_cs', 'latin7_general_ci', 'latin7_general_cs', 'macce_bin', +'macce_general_ci', 'macroman_bin', 'macroman_general_ci', 'sjis_bin', +'sjis_japanese_ci', 'swe7_bin', 'swe7_swedish_ci', 'tis620_bin', +'tis620_thai_ci', 'ucs2_bin', 'ucs2_czech_ci', 'ucs2_danish_ci', +'ucs2_estonian_ci', 'ucs2_general_ci', 'ucs2_hungarian_ci', 'ucs2_icelandic_ci', +'ucs2_latvian_ci', 'ucs2_lithuanian_ci', 'ucs2_persian_ci', 'ucs2_polish_ci', +'ucs2_roman_ci', 'ucs2_romanian_ci', 'ucs2_slovak_ci', 'ucs2_slovenian_ci', +'ucs2_spanish2_ci', 'ucs2_spanish_ci', 'ucs2_swedish_ci', 'ucs2_turkish_ci', +'ucs2_unicode_ci', 'ujis_bin', 'ujis_japanese_ci', 'utf8_bin', +'utf8_czech_ci', 'utf8_danish_ci', 'utf8_estonian_ci', 'utf8_general_ci', +'utf8_hungarian_ci', 'utf8_icelandic_ci', 'utf8_latvian_ci', 'utf8_lithuanian_ci', +'utf8_persian_ci', 'utf8_polish_ci', 'utf8_roman_ci', 'utf8_romanian_ci', +'utf8_slovak_ci', 'utf8_slovenian_ci', 'utf8_spanish2_ci', 'utf8_spanish_ci', +'utf8_swedish_ci', 'utf8_turkish_ci', 'utf8_unicode_ci' +)`) +{ + --skip Not all collations required for this test are present +} + +################################ +let $check_std_csets= 1; +let $check_ucs2_csets= 1; +let $check_utf8_csets= 1; + +# +# Check all charsets/collation combinations +# + +################################ let $check_std_csets= 1; let $check_ucs2_csets= 1; let $check_utf8_csets= 1; diff --git a/mysql-test/suite/funcs_2/t/innodb_charset.test b/mysql-test/suite/funcs_2/t/innodb_charset.test index 5d4a72cfa2e..b77bacfc01c 100644 --- a/mysql-test/suite/funcs_2/t/innodb_charset.test +++ b/mysql-test/suite/funcs_2/t/innodb_charset.test @@ -1,8 +1,10 @@ -################################################################################# -# Author: Serge Kozlov # -# Date: 09/21/2005 # -# Purpose: Testing the charsets for InnoDB engine # -################################################################################# +################################################################################ +# Author: Serge Kozlov # +# Date: 2005-09-21 # +# Purpose: Testing the charsets for InnoDB engine # +# # +# Checking of other prerequisites is in charset_master.test # +################################################################################ --source include/have_innodb.inc diff --git a/mysql-test/suite/funcs_2/t/memory_charset.test b/mysql-test/suite/funcs_2/t/memory_charset.test index ce9b80462f1..cc878652bfa 100644 --- a/mysql-test/suite/funcs_2/t/memory_charset.test +++ b/mysql-test/suite/funcs_2/t/memory_charset.test @@ -1,8 +1,10 @@ -################################################################################# -# Author: Serge Kozlov # -# Date: 09/21/2005 # -# Purpose: Testing the charsets for Memory engine # -################################################################################# +################################################################################ +# Author: Serge Kozlov # +# Date: 2005-09-21 # +# Purpose: Testing the charsets for Memory engine # +# # +# Checking of other prerequisites is in charset_master.test # +################################################################################ let $engine_type= Memory; --source suite/funcs_2/charset/charset_master.test diff --git a/mysql-test/suite/funcs_2/t/myisam_charset.test b/mysql-test/suite/funcs_2/t/myisam_charset.test index b3f862c89de..e9a62e1060b 100644 --- a/mysql-test/suite/funcs_2/t/myisam_charset.test +++ b/mysql-test/suite/funcs_2/t/myisam_charset.test @@ -1,8 +1,10 @@ -################################################################################# -# Author: Serge Kozlov # -# Date: 09/21/2005 # -# Purpose: Testing the charsets for MyISAM engine # -################################################################################# +################################################################################ +# Author: Serge Kozlov # +# Date: 2005-09-21 # +# Purpose: Testing the charsets for MyISAM engine # +# # +# Checking of other prerequisites is in charset_master.test # +################################################################################ let $engine_type= MyISAM; --source suite/funcs_2/charset/charset_master.test diff --git a/mysql-test/suite/funcs_2/t/ndb_charset.test b/mysql-test/suite/funcs_2/t/ndb_charset.test index 72ebbad43d7..68665cc1ae5 100644 --- a/mysql-test/suite/funcs_2/t/ndb_charset.test +++ b/mysql-test/suite/funcs_2/t/ndb_charset.test @@ -1,8 +1,10 @@ -################################################################################# -# Author: Serge Kozlov # -# Date: 09/21/2005 # -# Purpose: Testing the charsets for NDB engine # -################################################################################# +################################################################################ +# Author: Serge Kozlov # +# Date: 09/21/2005 # +# Purpose: Testing the charsets for NDB engine # +# # +# Checking of other prerequisites is in charset_master.test # +################################################################################ --source include/have_ndb.inc --source include/not_embedded.inc From db56fd008c118246a0ee92c2949b3502fbe324ba Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Wed, 9 Jul 2008 16:52:26 +0500 Subject: [PATCH 079/352] Fix for bug#37669: Server crash by setting "@@session.innodb_table_locks" Problem: reading/writing data from/to an address without proper alignment leads to SIGBUS on some platforms. Fix: use the correct data type when dereferencing variable values. --- sql/sql_plugin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 0fe79a8945d..b9733f2eec0 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1882,7 +1882,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, } result= (int) tmp; } - *(int*)save= -result; + *(my_bool *) save= -result; return 0; err: my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue); @@ -2063,7 +2063,7 @@ err: static void update_func_bool(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - *(my_bool *) tgt= *(int *) save ? 1 : 0; + *(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE; } From 2d41201c8a29edeecd51342bc5fbd4d953c3d5aa Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 10 Jul 2008 03:58:30 +0200 Subject: [PATCH 080/352] Bug#35848: UUID() returns UUIDs with the wrong time offset for time part in UUIDs was 1/1000 of what it should be. In other words, offset was off. Also handle the case where we count into the future when several UUIDs are generated in one "tick", and then the next call is late enough for us to unwind some but not all of those borrowed ticks. Lastly, handle the case where we keep borrowing and borrowing until the tick-counter overflows by also changing into a new "numberspace" by creating a new random suffix. --- mysql-test/r/func_misc.result | 14 ++++++++ mysql-test/t/func_misc.test | 19 ++++++++++ sql/item_strfunc.cc | 65 ++++++++++++++++++++++++++++------- 3 files changed, 86 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index d50dda55bfb..ce177b511b9 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -305,4 +305,18 @@ drop table t1; SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs; NAME_CONST('var', 'value') COLLATE latin1_general_cs value +select @@session.time_zone into @save_tz; +set @@session.time_zone='UTC'; +select uuid() into @my_uuid; +select mid(@my_uuid,15,1); +mid(@my_uuid,15,1) +1 +select 24 * 60 * 60 * 1000 * 1000 * 10 into @my_uuid_one_day; +select concat('0',mid(@my_uuid,16,3),mid(@my_uuid,10,4),left(@my_uuid,8)) into @my_uuidate; +select floor(conv(@my_uuidate,16,10)/@my_uuid_one_day) into @my_uuid_date; +select 141427 + datediff(curdate(),'1970-01-01') into @my_uuid_synthetic; +select @my_uuid_date - @my_uuid_synthetic; +@my_uuid_date - @my_uuid_synthetic +0 +set @@session.time_zone=@save_tz; End of 5.0 tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 36c18979154..93fe94ec94f 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -417,5 +417,24 @@ drop table t1; # SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs; +# +# Bug #35848: UUID() returns UUIDs with the wrong time +# +select @@session.time_zone into @save_tz; + +# make sure all times are UTC so the DayNr won't differ +set @@session.time_zone='UTC'; +select uuid() into @my_uuid; +# if version nibble isn't 1, the following calculations will be rubbish +select mid(@my_uuid,15,1); +select 24 * 60 * 60 * 1000 * 1000 * 10 into @my_uuid_one_day; +select concat('0',mid(@my_uuid,16,3),mid(@my_uuid,10,4),left(@my_uuid,8)) into @my_uuidate; +select floor(conv(@my_uuidate,16,10)/@my_uuid_one_day) into @my_uuid_date; +select 141427 + datediff(curdate(),'1970-01-01') into @my_uuid_synthetic; +# these should be identical; date part of UUID should be current date +select @my_uuid_date - @my_uuid_synthetic; + +set @@session.time_zone=@save_tz; + --echo End of 5.0 tests diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index c443364ce52..1d447d6e976 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3258,7 +3258,8 @@ static char clock_seq_and_node_str[]="-0000-000000000000"; /* number of 100-nanosecond intervals between 1582-10-15 00:00:00.00 and 1970-01-01 00:00:00.00 */ -#define UUID_TIME_OFFSET ((ulonglong) 141427 * 24 * 60 * 60 * 1000 * 10 ) +#define UUID_TIME_OFFSET ((ulonglong) 141427 * 24 * 60 * 60 * \ + 1000 * 1000 * 10) #define UUID_VERSION 0x1000 #define UUID_VARIANT 0x8000 @@ -3317,24 +3318,64 @@ String *Item_func_uuid::val_str(String *str) set_clock_seq_str(); } - ulonglong tv=my_getsystime() + UUID_TIME_OFFSET + nanoseq; - if (unlikely(tv < uuid_time)) - set_clock_seq_str(); - else if (unlikely(tv == uuid_time)) + ulonglong tv= my_getsystime() + UUID_TIME_OFFSET + nanoseq; + + if (likely(tv > uuid_time)) { - /* special protection from low-res system clocks */ - nanoseq++; - tv++; + /* + Current time is ahead of last timestamp, as it should be. + If we "borrowed time", give it back, just as long as we + stay ahead of the previous timestamp. + */ + if (nanoseq) + { + DBUG_ASSERT((tv > uuid_time) && (nanoseq > 0)); + /* + -1 so we won't make tv= uuid_time for nanoseq >= (tv - uuid_time) + */ + long delta= min(nanoseq, tv - uuid_time -1); + tv-= delta; + nanoseq-= delta; + } } else { - if (nanoseq) + if (unlikely(tv == uuid_time)) { - tv-=nanoseq; - nanoseq=0; + /* + For low-res system clocks. If several requests for UUIDs + end up on the same tick, we add a nano-second to make them + different. + ( current_timestamp + nanoseq * calls_in_this_period ) + may end up > next_timestamp; this is OK. Nonetheless, we'll + try to unwind nanoseq when we get a chance to. + If nanoseq overflows, we'll start over with a new numberspace + (so the if() below is needed so we can avoid the ++tv and thus + match the follow-up if() if nanoseq overflows!). + */ + if (likely(++nanoseq)) + ++tv; + } + + if (unlikely(tv <= uuid_time)) + { + /* + If the admin changes the system clock (or due to Daylight + Saving Time), the system clock may be turned *back* so we + go through a period once more for which we already gave out + UUIDs. To avoid duplicate UUIDs despite potentially identical + times, we make a new random component. + We also come here if the nanoseq "borrowing" overflows. + In either case, we throw away any nanoseq borrowing since it's + irrelevant in the new numberspace. + */ + set_clock_seq_str(); + tv= my_getsystime() + UUID_TIME_OFFSET; + nanoseq= 0; + DBUG_PRINT("uuid",("making new numberspace")); } - DBUG_ASSERT(tv > uuid_time); } + uuid_time=tv; pthread_mutex_unlock(&LOCK_uuid_generator); From ccd18071a7afac4cbbc4c073b6ce2e93230110c8 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Thu, 10 Jul 2008 12:42:21 +0530 Subject: [PATCH 081/352] WL#4380 Modified the abi_check target to check for only mysql.h and plugin.h for now. --- Makefile.am | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/Makefile.am b/Makefile.am index c2209711879..7e98cc5c504 100644 --- a/Makefile.am +++ b/Makefile.am @@ -232,23 +232,28 @@ test-full-qa: test-fast-cursor test-unit # -# Headers which need to be checked for abi/api compatibility +# Headers which need to be checked for abi/api compatibility. +# API_PREPROCESSOR_HEADER will be used until mysql_priv.h stablizes +# after which TEST_PREPROCESSOR_HEADER will be used. # -PREPROCESSOR_C_HEADER=$(top_srcdir)/include/mysql/plugin.h \ - $(top_srcdir)/sql/mysql_priv.h \ - $(top_srcdir)/include/mysql.h +API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ + $(top_srcdir)/include/mysql.h + +TEST_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ + $(top_srcdir)/sql/mysql_priv.h \ + $(top_srcdir)/include/mysql.h # -# Rule for checking that the abi/api has not changed. +# Rules for checking that the abi/api has not changed. # -# The following steps are followed in the rule below +# The following steps are followed in the do_abi_check rule below # # 1) Generate preprocessor output for the files that need to -# be tested for abi/api changes. use -nostdinc to prevent -# generation of preprocessor output for system headers. This -# results in messages in stderr saying that these headers -# were not found. Redirect the stderr output to /dev/null +# be tested for abi/api changes. use -nostdinc to prevent +# generation of preprocessor output for system headers. This +# results in messages in stderr saying that these headers +# were not found. Redirect the stderr output to /dev/null # to prevent seeing these messages. # 2) sed the output to remove blank lines and lines that begin # with # (The header information is retained to enable easy @@ -273,9 +278,15 @@ PREPROCESSOR_C_HEADER=$(top_srcdir)/include/mysql/plugin.h \ # to replace the old canons with the new ones. # -abi_check: $(PREPROCESSOR_C_HEADER) - set -ex; \ - for file in $(PREPROCESSOR_C_HEADER); do \ +abi_check: $(API_PREPROCESSOR_HEADER) + $(MAKE) abi_headers="$^" do_abi_check + +abi_check_all: $(TEST_PREPROCESSOR_HEADER) + $(MAKE) abi_headers="$^" do_abi_check + +do_abi_check: + set -ex; \ + for file in $(abi_headers); do \ @CC@ -E -nostdinc -dI \ -I$(top_srcdir)/include \ -I$(top_srcdir)/include/mysql \ @@ -285,8 +296,7 @@ abi_check: $(PREPROCESSOR_C_HEADER) -e '/^[ ]*$$/d' > $$file.out; \ @DIFF@ $$file.pp $$file.out; \ @RM@ $$file.out; \ - done - touch $@ + done # Don't update the files from bitkeeper %::SCCS/s.% From 0fe5b015de73fbdbe018148d3c6f9dee032a1096 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 10 Jul 2008 14:41:56 -0600 Subject: [PATCH 082/352] Fixed build warning on Windows (emb_qcache.cc) --- libmysqld/emb_qcache.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc index fdd7f8ed776..b4eddf39c1f 100644 --- a/libmysqld/emb_qcache.cc +++ b/libmysqld/emb_qcache.cc @@ -447,7 +447,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src) if (thd->protocol == &thd->protocol_binary) { uint length; - row= (MYSQL_ROWS *)alloc_root(&data->alloc, rows * sizeof(MYSQL_ROWS)); + row= (MYSQL_ROWS *)alloc_root(&data->alloc, + (size_t) (rows * sizeof(MYSQL_ROWS))); end_row= row + rows; data->data= row; From 04dc6639cc02491e11d15793cb71ccc92bee34a1 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Fri, 11 Jul 2008 02:32:54 +0500 Subject: [PATCH 083/352] warning elimination --- sql/item_strfunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 1d447d6e976..c12a1acc980 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3333,7 +3333,7 @@ String *Item_func_uuid::val_str(String *str) /* -1 so we won't make tv= uuid_time for nanoseq >= (tv - uuid_time) */ - long delta= min(nanoseq, tv - uuid_time -1); + long delta= min(nanoseq, (long) (tv - uuid_time -1)); tv-= delta; nanoseq-= delta; } From 295fc5834aef999a8f77d0b38037699d7a2b26bc Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Fri, 11 Jul 2008 01:14:13 +0200 Subject: [PATCH 084/352] Bug#37402: Mysql cant read partitioned table with capital letter in the name Problem was that ha_partition had HA_FILE_BASED flag set (since it uses a .par file), but after open it uses the first partitions flags, which results in different case handling for create and for open. Solution was to change the underlying partition name so it was consistent. (Only happens when lower_case_table_names = 2, i.e. Mac OS X and storage engines without HA_FILE_BASED, like InnoDB and Memory.) (Recommit after adding rename of check_lowercase_names to get_canonical_filename, and moved it from handler.h to mysql_priv.h) NOTE: if a mixed case name for a partitioned table was created when lower_case_table_name = 2 it should be renamed or dropped before using the updated version (See bug#37402 for more info) --- .../have_case_insensitive_file_system.inc | 4 + mysql-test/include/have_lowercase0.inc | 2 +- mysql-test/include/have_lowercase2.inc | 4 + mysql-test/lib/mtr_report.pl | 11 +- .../r/case_insensitive_file_system.require | 2 + mysql-test/r/lowercase0.require | 1 - mysql-test/suite/parts/inc/partition_mgm.inc | 548 ++++++++++++ .../parts/r/partition_mgm_lc0_archive.result | 834 ++++++++++++++++++ .../parts/r/partition_mgm_lc0_innodb.result | 829 +++++++++++++++++ .../parts/r/partition_mgm_lc0_memory.result | 829 +++++++++++++++++ .../parts/r/partition_mgm_lc0_myisam.result | 829 +++++++++++++++++ .../parts/r/partition_mgm_lc0_ndb.result | 170 ++++ .../parts/r/partition_mgm_lc1_archive.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc1_innodb.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc1_memory.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc1_myisam.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc1_ndb.result | 204 +++++ .../parts/r/partition_mgm_lc2_archive.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc2_innodb.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc2_memory.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc2_myisam.result | 797 +++++++++++++++++ .../parts/r/partition_mgm_lc2_ndb.result | 204 +++++ .../parts/t/partition_mgm_lc0_archive.test | 42 + .../parts/t/partition_mgm_lc0_innodb.test | 41 + .../parts/t/partition_mgm_lc0_memory.test | 41 + .../parts/t/partition_mgm_lc0_myisam.test | 41 + .../suite/parts/t/partition_mgm_lc0_ndb.test | 47 + .../t/partition_mgm_lc1_archive-master.opt | 1 + .../parts/t/partition_mgm_lc1_archive.test | 38 + .../t/partition_mgm_lc1_innodb-master.opt | 1 + .../parts/t/partition_mgm_lc1_innodb.test | 38 + .../t/partition_mgm_lc1_memory-master.opt | 1 + .../parts/t/partition_mgm_lc1_memory.test | 38 + .../t/partition_mgm_lc1_myisam-master.opt | 1 + .../parts/t/partition_mgm_lc1_myisam.test | 38 + .../parts/t/partition_mgm_lc1_ndb-master.opt | 1 + .../suite/parts/t/partition_mgm_lc1_ndb.test | 44 + .../t/partition_mgm_lc2_archive-master.opt | 1 + .../parts/t/partition_mgm_lc2_archive.test | 38 + .../t/partition_mgm_lc2_innodb-master.opt | 1 + .../parts/t/partition_mgm_lc2_innodb.test | 38 + .../t/partition_mgm_lc2_memory-master.opt | 1 + .../parts/t/partition_mgm_lc2_memory.test | 38 + .../t/partition_mgm_lc2_myisam-master.opt | 1 + .../parts/t/partition_mgm_lc2_myisam.test | 38 + .../parts/t/partition_mgm_lc2_ndb-master.opt | 1 + .../suite/parts/t/partition_mgm_lc2_ndb.test | 43 + mysql-test/t/lowercase_table3.test | 1 + sql/ha_partition.cc | 45 +- sql/handler.cc | 10 +- sql/mysql_priv.h | 2 + 51 files changed, 11503 insertions(+), 15 deletions(-) create mode 100644 mysql-test/include/have_case_insensitive_file_system.inc create mode 100644 mysql-test/include/have_lowercase2.inc create mode 100644 mysql-test/r/case_insensitive_file_system.require create mode 100644 mysql-test/suite/parts/inc/partition_mgm.inc create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc0_archive.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc0_memory.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc1_archive.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc1_memory.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc2_archive.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc2_memory.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result create mode 100644 mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc0_archive.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc0_innodb.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc0_memory.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc0_myisam.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_archive-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_archive.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_innodb-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_innodb.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_memory-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_memory.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_myisam-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_myisam.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_archive-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_archive.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_innodb-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_innodb.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_memory-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_memory.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_myisam-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_myisam.test create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt create mode 100644 mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test diff --git a/mysql-test/include/have_case_insensitive_file_system.inc b/mysql-test/include/have_case_insensitive_file_system.inc new file mode 100644 index 00000000000..78bb7c229ca --- /dev/null +++ b/mysql-test/include/have_case_insensitive_file_system.inc @@ -0,0 +1,4 @@ +--require r/case_insensitive_file_system.require +--disable_query_log +show variables like "lower_case_file_system"; +--enable_query_log diff --git a/mysql-test/include/have_lowercase0.inc b/mysql-test/include/have_lowercase0.inc index 8d3ae02f61e..9cd21a42f6a 100644 --- a/mysql-test/include/have_lowercase0.inc +++ b/mysql-test/include/have_lowercase0.inc @@ -1,4 +1,4 @@ --require r/lowercase0.require --disable_query_log -show variables like "lower_case_%"; +show variables like "lower_case_table_names"; --enable_query_log diff --git a/mysql-test/include/have_lowercase2.inc b/mysql-test/include/have_lowercase2.inc new file mode 100644 index 00000000000..43b34653f54 --- /dev/null +++ b/mysql-test/include/have_lowercase2.inc @@ -0,0 +1,4 @@ +--require r/lowercase2.require +--disable_query_log +show variables like 'lower_case_table_names'; +--enable_query_log diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index b83f40626aa..8fd8a672713 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -327,7 +327,6 @@ sub mtr_report_stats ($) { /Sort aborted/ or /Time-out in NDB/ or /One can only use the --user.*root/ or - /Setting lower_case_table_names=2/ or /Table:.* on (delete|rename)/ or /You have an error in your SQL syntax/ or /deprecated/ or @@ -402,7 +401,15 @@ sub mtr_report_stats ($) { )) or # Test case for Bug#31590 produces the following error: - /Out of sort memory; increase server sort buffer size/ + /Out of sort memory; increase server sort buffer size/ or + + # lowercase_table3 using case sensitive option on + # case insensitive filesystem (InnoDB error). + /Cannot find or open table test\/BUG29839 from/ or + + # When trying to set lower_case_table_names = 2 + # on a case sensitive file system. Bug#37402. + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ ) { next; # Skip these lines diff --git a/mysql-test/r/case_insensitive_file_system.require b/mysql-test/r/case_insensitive_file_system.require new file mode 100644 index 00000000000..062ac610ddd --- /dev/null +++ b/mysql-test/r/case_insensitive_file_system.require @@ -0,0 +1,2 @@ +Variable_name Value +lower_case_file_system ON diff --git a/mysql-test/r/lowercase0.require b/mysql-test/r/lowercase0.require index a63906557f8..5550a2e93b8 100644 --- a/mysql-test/r/lowercase0.require +++ b/mysql-test/r/lowercase0.require @@ -1,3 +1,2 @@ Variable_name Value -lower_case_file_system ON lower_case_table_names 0 diff --git a/mysql-test/suite/parts/inc/partition_mgm.inc b/mysql-test/suite/parts/inc/partition_mgm.inc new file mode 100644 index 00000000000..f36b1a9921f --- /dev/null +++ b/mysql-test/suite/parts/inc/partition_mgm.inc @@ -0,0 +1,548 @@ +################################################################################ +# inc/partition_mgm.inc # +# # +# Purpose: # +# Test of partition management functions including different Upper/Lower # +# case names of databases, tables and partitions # +# # +# # +# Uses following variables: # +# engine Use specified storage engine # +# can_only_key Storage engine only able to use HASH/KEY (not range/list) # +# (E.g. not ndbcluster) # +# part_optA-D Extra partitioning options (E.g. INDEX/DATA DIR) # +# # +# have_bug33158 NDB case insensitive create, but case sensitive rename # +# have_bug37719 Archive, crash when rename and then select # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ +--enable_abort_on_error + +let $old_db= `SELECT DATABASE()`; +--echo # Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +--echo # 1.0 KEY partitioning mgm +--echo # Creating KEY partitioned table +eval CREATE TABLE TableA (a INT) +ENGINE = $engine +PARTITION BY KEY (a) +(PARTITION parta $part_optA, + PARTITION partB $part_optB, + PARTITION Partc $part_optC, + PARTITION PartD $part_optD); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +--sorted_result +SELECT * FROM TableA; + +--echo # Test of ADD/COALESCE PARTITIONS +--echo # expecting duplicate partition name +--error ER_SAME_NAME_PARTITION +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, + PARTITION Parta, + PARTITION PartA); +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, + PARTITION Partf, + PARTITION PartG); +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; +ALTER TABLE TableA COALESCE PARTITION 4; +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of REORGANIZE PARTITIONS +--echo # Should not work on HASH/KEY +--error ER_REORG_HASH_ONLY_ON_SAME_NO +eval ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA $part_optA, + PARTITION partc $part_optC); +--error ER_CONSECUTIVE_REORG_PARTITIONS +eval ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB $part_optA, + PARTITION parta $part_optC); +eval ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB $part_optA COMMENT="Previusly named parta", + PARTITION parta $part_optB COMMENT="Previusly named partB"); +if ($fixed_bug20129) +{ +ALTER TABLE TableA ANALYZE PARTITION parta, partB, Partc; +ALTER TABLE TableA CHECK PARTITION parta, partB, Partc; +ALTER TABLE TableA OPTIMIZE PARTITION parta, partB, Partc; +ALTER TABLE TableA REPAIR PARTITION parta, partB, Partc; +} +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of RENAME TABLE +RENAME TABLE TableA to TableB; +--sorted_result +SELECT * FROM TableB; +RENAME TABLE TableB to TableA; +--sorted_result +SELECT * FROM TableA; + +--echo # Checking name comparision Upper vs Lower case +--echo # Error if lower_case_table_names != 0 +let $lower_case_table_names= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'lower_case_table_names'`; +--echo # lower_case_table_names: $lower_case_table_names +if ($lower_case_table_names) +{ +--error ER_TABLE_EXISTS_ERROR +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY KEY (a) +(PARTITION parta $part_optA, + PARTITION partB $part_optB, + PARTITION Partc $part_optC, + PARTITION PartD $part_optD); +SHOW TABLES; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE TableA to tablea; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE tablea to TableA; +--sorted_result +SELECT * FROM tablea; +SHOW CREATE TABLE tablea; +} +if (!$lower_case_table_names) +{ +if (!$have_bug33158) +{ +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY KEY (a) +(PARTITION parta $part_optA, + PARTITION partB $part_optB, + PARTITION Partc $part_optC, + PARTITION PartD $part_optD); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +if (!$have_bug37719) +{ +RENAME TABLE TableA to tableA; +} +--sorted_result +SELECT * FROM tablea; +if (!$have_bug37719) +{ +--sorted_result +SELECT * FROM tableA; +RENAME TABLE tableA to TableA; +} +SHOW CREATE TABLE tablea; +DROP TABLE tablea; +} +} + +--echo # Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; + +if (!$can_only_key) +{ +--echo # 2.0 HASH partitioning mgm +--echo # expecting duplicate partition name +--error ER_SAME_NAME_PARTITION +eval CREATE TABLE TableA (a INT) +ENGINE = $engine +PARTITION BY HASH (a) +(PARTITION parta $part_optA, + PARTITION partA $part_optB, + PARTITION Parta $part_optC, + PARTITION PartA $part_optD); + +--echo # Creating Hash partitioned table +eval CREATE TABLE TableA (a INT) +ENGINE = $engine +PARTITION BY HASH (a) +(PARTITION parta $part_optA, + PARTITION partB $part_optB, + PARTITION Partc $part_optC, + PARTITION PartD $part_optD); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +--sorted_result +SELECT * FROM TableA; + +--echo # Test of ADD/COALESCE PARTITIONS +--echo # expecting duplicate partition name +--error ER_SAME_NAME_PARTITION +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, + PARTITION Parta, + PARTITION PartA); +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, + PARTITION Partf, + PARTITION PartG); +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; +ALTER TABLE TableA COALESCE PARTITION 4; +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of REORGANIZE PARTITIONS +--echo # Should not work on HASH/KEY +--error ER_REORG_HASH_ONLY_ON_SAME_NO +eval ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA $part_optA, + PARTITION partc $part_optC); +--error ER_CONSECUTIVE_REORG_PARTITIONS +eval ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB $part_optA, + PARTITION parta $part_optC); +eval ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB $part_optA COMMENT="Previusly named parta", + PARTITION parta $part_optB COMMENT="Previusly named partB"); +if ($fixed_bug20129) +{ +ALTER TABLE TableA ANALYZE PARTITION parta, partB, Partc; +ALTER TABLE TableA CHECK PARTITION parta, partB, Partc; +ALTER TABLE TableA OPTIMIZE PARTITION parta, partB, Partc; +ALTER TABLE TableA REPAIR PARTITION parta, partB, Partc; +} +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of RENAME TABLE +RENAME TABLE TableA to TableB; +--sorted_result +SELECT * FROM TableB; +RENAME TABLE TableB to TableA; +--sorted_result +SELECT * FROM TableA; + +--echo # Checking name comparision Upper vs Lower case +--echo # Error if lower_case_table_names != 0 +let $lower_case_table_names= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'lower_case_table_names'`; +--echo # lower_case_table_names: $lower_case_table_names +if ($lower_case_table_names) +{ +--error ER_TABLE_EXISTS_ERROR +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY HASH (a) +(PARTITION parta $part_optA, + PARTITION partB $part_optB, + PARTITION Partc $part_optC, + PARTITION PartD $part_optD); +SHOW TABLES; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE TableA to tablea; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE tablea to TableA; +--sorted_result +SELECT * FROM tablea; +SHOW CREATE TABLE tablea; +} +if (!$lower_case_table_names) +{ +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY HASH (a) +(PARTITION parta $part_optA, + PARTITION partB $part_optB, + PARTITION Partc $part_optC, + PARTITION PartD $part_optD); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +if (!$have_bug37719) +{ +RENAME TABLE TableA to tableA; +} +--sorted_result +SELECT * FROM tablea; +if (!$have_bug37719) +{ +--sorted_result +SELECT * FROM tableA; +RENAME TABLE tableA to TableA; +} +SHOW CREATE TABLE tablea; +DROP TABLE tablea; +} + +--echo # Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; + + +--echo # 3.0 RANGE partitioning mgm +--echo # Creating RANGE partitioned table +eval CREATE TABLE TableA (a INT) +ENGINE = $engine +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) $part_optA, + PARTITION partB VALUES LESS THAN (7) $part_optB, + PARTITION Partc VALUES LESS THAN (10) $part_optC, + PARTITION PartD VALUES LESS THAN (13) $part_optD); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +--sorted_result +SELECT * FROM TableA; + +--echo # Test of ADD/DROP PARTITIONS +--echo # expecting duplicate partition name +--error ER_SAME_NAME_PARTITION +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), + PARTITION Partf VALUES LESS THAN (19), + PARTITION PartG VALUES LESS THAN (22)); +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of REORGANIZE PARTITIONS +--echo # Error since it must reorganize a consecutive range +--error ER_CONSECUTIVE_REORG_PARTITIONS +eval ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) $part_optA, + PARTITION parta VALUES LESS THAN (11) $part_optC); +eval ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) $part_optB + COMMENT="Previously partB and partly Partc", + PARTITION partB VALUES LESS THAN (11) $part_optC + COMMENT="Previously partly Partc and partly PartD", + PARTITION partC VALUES LESS THAN (MAXVALUE) $part_optD + COMMENT="Previously partly PartD"); +if ($fixed_bug20129) +{ +ALTER TABLE TableA ANALYZE PARTITION parta, partB, Partc; +ALTER TABLE TableA CHECK PARTITION parta, partB, Partc; +ALTER TABLE TableA OPTIMIZE PARTITION parta, partB, Partc; +ALTER TABLE TableA REPAIR PARTITION parta, partB, Partc; +} +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of RENAME TABLE +RENAME TABLE TableA to TableB; +--sorted_result +SELECT * FROM TableB; +RENAME TABLE TableB to TableA; +--sorted_result +SELECT * FROM TableA; + +--echo # Checking name comparision Upper vs Lower case +--echo # Error if lower_case_table_names != 0 +let $lower_case_table_names= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'lower_case_table_names'`; +--echo # lower_case_table_names: $lower_case_table_names +if ($lower_case_table_names) +{ +--error ER_TABLE_EXISTS_ERROR +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) $part_optA, + PARTITION partB VALUES LESS THAN (7) $part_optB, + PARTITION Partc VALUES LESS THAN (10) $part_optC, + PARTITION PartD VALUES LESS THAN (13) $part_optD); +SHOW TABLES; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE TableA to tablea; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE tablea to TableA; +--sorted_result +SELECT * FROM tablea; +SHOW CREATE TABLE tablea; +} +if (!$lower_case_table_names) +{ +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) $part_optA, + PARTITION partB VALUES LESS THAN (7) $part_optB, + PARTITION Partc VALUES LESS THAN (10) $part_optC, + PARTITION PartD VALUES LESS THAN (13) $part_optD); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +if (!$have_bug37719) +{ +RENAME TABLE TableA to tableA; +} +--sorted_result +SELECT * FROM tablea; +if (!$have_bug37719) +{ +--sorted_result +SELECT * FROM tableA; +RENAME TABLE tableA to TableA; +} +SHOW CREATE TABLE tablea; +DROP TABLE tablea; +} + +--echo # Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; + +--echo # 4.0 LIST partitioning mgm +--echo # Creating LIST partitioned table +eval CREATE TABLE TableA (a INT) +ENGINE = $engine +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) $part_optA, + PARTITION partB VALUES IN (2,10,11) $part_optB, + PARTITION Partc VALUES IN (3,4,7) $part_optC, + PARTITION PartD VALUES IN (5,6,12) $part_optD); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +--sorted_result +SELECT * FROM TableA; + +--echo # Test of ADD/DROP PARTITIONS +--echo # expecting duplicate partition name +--error ER_SAME_NAME_PARTITION +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), + PARTITION Partf VALUES IN (19), + PARTITION PartG VALUES IN (22)); +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of REORGANIZE PARTITIONS +--error ER_CONSECUTIVE_REORG_PARTITIONS +eval ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) $part_optA + COMMENT = "Mix 1 of old parta and Partc", + PARTITION partF VALUES IN (3,9) $part_optC + COMMENT = "Mix 2 of old parta and Partc", + PARTITION parta VALUES IN (4,8) $part_optC + COMMENT = "Mix 3 of old parta and Partc"); +eval ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) $part_optA + COMMENT = "Mix 1 of old parta and Partc", + PARTITION parta VALUES IN (3,9) $part_optC + COMMENT = "Mix 2 of old parta and Partc", + PARTITION partB VALUES IN (4,8) $part_optC + COMMENT = "Mix 3 of old parta and Partc"); +if ($fixed_bug20129) +{ +ALTER TABLE TableA ANALYZE PARTITION parta, partB, Partc; +ALTER TABLE TableA CHECK PARTITION parta, partB, Partc; +ALTER TABLE TableA OPTIMIZE PARTITION parta, partB, Partc; +ALTER TABLE TableA REPAIR PARTITION parta, partB, Partc; +} +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Test of RENAME TABLE +RENAME TABLE TableA to TableB; +--sorted_result +SELECT * FROM TableB; +RENAME TABLE TableB to TableA; +--sorted_result +SELECT * FROM TableA; + +--echo # Checking name comparision Upper vs Lower case +--echo # Error if lower_case_table_names != 0 +let $lower_case_table_names= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'lower_case_table_names'`; +--echo # lower_case_table_names: $lower_case_table_names +if ($lower_case_table_names) +{ +--error ER_TABLE_EXISTS_ERROR +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) $part_optA, + PARTITION partB VALUES IN (2,10,11) $part_optB, + PARTITION Partc VALUES IN (3,4,7) $part_optC, + PARTITION PartD VALUES IN (5,6,12) $part_optD); +SHOW TABLES; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE TableA to tablea; +--error ER_TABLE_EXISTS_ERROR +RENAME TABLE tablea to TableA; +--sorted_result +SELECT * FROM tablea; +SHOW CREATE TABLE tablea; +} +if (!$lower_case_table_names) +{ +eval CREATE TABLE tablea (a INT) +ENGINE = $engine +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) $part_optA, + PARTITION partB VALUES IN (2,10,11) $part_optB, + PARTITION Partc VALUES IN (3,4,7) $part_optC, + PARTITION PartD VALUES IN (5,6,12) $part_optD); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +if (!$have_bug37719) +{ +RENAME TABLE TableA to tableA; +} +--sorted_result +SELECT * FROM tablea; +if (!$have_bug37719) +{ +--sorted_result +SELECT * FROM tableA; +RENAME TABLE tableA to TableA; +} +SHOW CREATE TABLE tablea; +DROP TABLE tablea; +} + +--echo # Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +--sorted_result +SELECT * FROM TableA; +SHOW CREATE TABLE TableA; + +--echo # Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +} +# End of $can_only_key + +--echo # Cleaning up before exit +eval USE $old_db; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result new file mode 100644 index 00000000000..2bb6e7421b1 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_archive.result @@ -0,0 +1,834 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +SELECT * FROM tablea; +a +1 +1 +10 +10 +11 +12 +2 +2 +3 +4 +5 +6 +7 +7 +8 +8 +9 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +7 +8 +8 +9 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +SELECT * FROM tablea; +a +1 +1 +10 +10 +11 +12 +2 +2 +3 +4 +5 +6 +7 +7 +8 +8 +9 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +1 +10 +10 +11 +12 +2 +2 +3 +4 +5 +6 +7 +8 +8 +9 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +SELECT * FROM tablea; +a +1 +1 +10 +10 +11 +12 +2 +2 +3 +4 +5 +6 +7 +7 +8 +8 +9 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +1 +10 +10 +11 +12 +2 +2 +3 +4 +5 +6 +7 +7 +8 +8 +9 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +SELECT * FROM tablea; +a +1 +1 +10 +12 +2 +3 +4 +5 +6 +7 +7 +8 +8 +9 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +1 +10 +12 +2 +3 +4 +5 +6 +7 +7 +8 +8 +9 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result new file mode 100644 index 00000000000..d603dbae9c2 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result @@ -0,0 +1,829 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result new file mode 100644 index 00000000000..092deae1796 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_memory.result @@ -0,0 +1,829 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result new file mode 100644 index 00000000000..046fb40ab35 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result @@ -0,0 +1,829 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO tablea VALUES (1), (2), (7), (8), (9), (10); +SHOW TABLES; +Tables_in_MySQL_Test_DB +TableA +tablea +RENAME TABLE TableA to tableA; +SELECT * FROM tablea; +a +1 +10 +2 +7 +8 +9 +SELECT * FROM tableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE tableA to TableA; +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM) */ +DROP TABLE tablea; +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result new file mode 100644 index 00000000000..3d28cedf3bd --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result @@ -0,0 +1,170 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'NDBCluster' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster, PARTITION PartD ENGINE = ndbcluster, PARTITION partE ENGINE = ndbcluster, PARTITION Partf ENGINE = ndbcluster, PARTITION PartG ENGINE = ndbcluster) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 0 +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result new file mode 100644 index 00000000000..b1eeed58ffb --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_archive.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result new file mode 100644 index 00000000000..910d985c0ea --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result new file mode 100644 index 00000000000..0c6dfbeff94 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_memory.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result new file mode 100644 index 00000000000..714ae639e95 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result new file mode 100644 index 00000000000..3bf9b073c80 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result @@ -0,0 +1,204 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'NDBCluster' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster, PARTITION PartD ENGINE = ndbcluster, PARTITION partE ENGINE = ndbcluster, PARTITION Partf ENGINE = ndbcluster, PARTITION PartG ENGINE = ndbcluster) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 1 +CREATE TABLE tablea (a INT) +ENGINE = 'NDBCluster' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +tablea +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'tablea' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result new file mode 100644 index 00000000000..cdc278f36cd --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_archive.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE, PARTITION PartD ENGINE = ARCHIVE, PARTITION partE ENGINE = ARCHIVE, PARTITION Partf ENGINE = ARCHIVE, PARTITION PartG ENGINE = ARCHIVE) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = ARCHIVE, PARTITION partB ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ARCHIVE, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ARCHIVE, PARTITION Partc ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION partE VALUES LESS THAN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES LESS THAN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES LESS THAN (22) ENGINE = ARCHIVE) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (7) ENGINE = ARCHIVE, PARTITION Partc VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION PartD VALUES LESS THAN (13) ENGINE = ARCHIVE, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = ARCHIVE, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = ARCHIVE, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = ARCHIVE, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Archive' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION partE VALUES IN (16) ENGINE = ARCHIVE, PARTITION Partf VALUES IN (19) ENGINE = ARCHIVE, PARTITION PartG VALUES IN (22) ENGINE = ARCHIVE) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = ARCHIVE, PARTITION partB VALUES IN (2,10,11) ENGINE = ARCHIVE, PARTITION Partc VALUES IN (3,4,7) ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Archive' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = ARCHIVE, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = ARCHIVE, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = ARCHIVE, PARTITION PartD VALUES IN (5,6,12) ENGINE = ARCHIVE, PARTITION PartE VALUES IN (13) ENGINE = ARCHIVE) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result new file mode 100644 index 00000000000..6a71a2e2f44 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB, PARTITION PartD ENGINE = InnoDB, PARTITION partE ENGINE = InnoDB, PARTITION Partf ENGINE = InnoDB, PARTITION PartG ENGINE = InnoDB) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = InnoDB, PARTITION partB ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = InnoDB, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = InnoDB, PARTITION Partc ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION partE VALUES LESS THAN (16) ENGINE = InnoDB, PARTITION Partf VALUES LESS THAN (19) ENGINE = InnoDB, PARTITION PartG VALUES LESS THAN (22) ENGINE = InnoDB) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (7) ENGINE = InnoDB, PARTITION Partc VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION PartD VALUES LESS THAN (13) ENGINE = InnoDB, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = InnoDB, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = InnoDB, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = InnoDB, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'InnoDB' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION partE VALUES IN (16) ENGINE = InnoDB, PARTITION Partf VALUES IN (19) ENGINE = InnoDB, PARTITION PartG VALUES IN (22) ENGINE = InnoDB) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = InnoDB, PARTITION partB VALUES IN (2,10,11) ENGINE = InnoDB, PARTITION Partc VALUES IN (3,4,7) ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'InnoDB' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = InnoDB, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = InnoDB, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = InnoDB, PARTITION PartD VALUES IN (5,6,12) ENGINE = InnoDB, PARTITION PartE VALUES IN (13) ENGINE = InnoDB) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result new file mode 100644 index 00000000000..988f60042e5 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_memory.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY, PARTITION PartD ENGINE = MEMORY, PARTITION partE ENGINE = MEMORY, PARTITION Partf ENGINE = MEMORY, PARTITION PartG ENGINE = MEMORY) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MEMORY, PARTITION partB ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MEMORY, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MEMORY, PARTITION Partc ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION partE VALUES LESS THAN (16) ENGINE = MEMORY, PARTITION Partf VALUES LESS THAN (19) ENGINE = MEMORY, PARTITION PartG VALUES LESS THAN (22) ENGINE = MEMORY) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (7) ENGINE = MEMORY, PARTITION Partc VALUES LESS THAN (10) ENGINE = MEMORY, PARTITION PartD VALUES LESS THAN (13) ENGINE = MEMORY, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MEMORY, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MEMORY, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MEMORY, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'Memory' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION partE VALUES IN (16) ENGINE = MEMORY, PARTITION Partf VALUES IN (19) ENGINE = MEMORY, PARTITION PartG VALUES IN (22) ENGINE = MEMORY) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MEMORY, PARTITION partB VALUES IN (2,10,11) ENGINE = MEMORY, PARTITION Partc VALUES IN (3,4,7) ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'Memory' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MEMORY, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MEMORY, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MEMORY, PARTITION PartD VALUES IN (5,6,12) ENGINE = MEMORY, PARTITION PartE VALUES IN (13) ENGINE = MEMORY) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result new file mode 100644 index 00000000000..c586347f23c --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result @@ -0,0 +1,797 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# 2.0 HASH partitioning mgm +# expecting duplicate partition name +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partA , +PARTITION Parta , +PARTITION PartA ); +ERROR HY000: Duplicate partition name parta +# Creating Hash partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM, PARTITION PartD ENGINE = MyISAM, PARTITION partE ENGINE = MyISAM, PARTITION Partf ENGINE = MyISAM, PARTITION PartG ENGINE = MyISAM) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION parta ENGINE = MyISAM, PARTITION partB ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY HASH (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = MyISAM, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = MyISAM, PARTITION Partc ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after HASH PARTITIONING test +DROP TABLE TableA; +# 3.0 RANGE partitioning mgm +# Creating RANGE partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES LESS THAN (MAXVALUE)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES LESS THAN (16), +PARTITION Partf VALUES LESS THAN (19), +PARTITION PartG VALUES LESS THAN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION partE VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION Partf VALUES LESS THAN (19) ENGINE = MyISAM, PARTITION PartG VALUES LESS THAN (22) ENGINE = MyISAM) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES LESS THAN (MAXVALUE)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (7) ENGINE = MyISAM, PARTITION Partc VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION PartD VALUES LESS THAN (13) ENGINE = MyISAM, PARTITION PartE VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +# Error since it must reorganize a consecutive range +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB VALUES LESS THAN (3) , +PARTITION parta VALUES LESS THAN (11) ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION partB,Partc,PartD,PartE INTO +(PARTITION partD VALUES LESS THAN (8) +COMMENT="Previously partB and partly Partc", +PARTITION partB VALUES LESS THAN (11) +COMMENT="Previously partly Partc and partly PartD", +PARTITION partC VALUES LESS THAN (MAXVALUE) +COMMENT="Previously partly PartD"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY RANGE (a) +(PARTITION parta VALUES LESS THAN (4) , +PARTITION partB VALUES LESS THAN (7) , +PARTITION Partc VALUES LESS THAN (10) , +PARTITION PartD VALUES LESS THAN (13) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION parta VALUES LESS THAN (4) ENGINE = MyISAM, PARTITION partD VALUES LESS THAN (8) COMMENT = 'Previously partB and partly Partc' ENGINE = MyISAM, PARTITION partB VALUES LESS THAN (11) COMMENT = 'Previously partly Partc and partly PartD' ENGINE = MyISAM, PARTITION partC VALUES LESS THAN MAXVALUE COMMENT = 'Previously partly PartD' ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after RANGE PARTITIONING test +DROP TABLE TableA; +# 4.0 LIST partitioning mgm +# Creating LIST partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'MyISAM' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/DROP PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA VALUES IN (0)); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE VALUES IN (16), +PARTITION Partf VALUES IN (19), +PARTITION PartG VALUES IN (22)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION partE VALUES IN (16) ENGINE = MyISAM, PARTITION Partf VALUES IN (19) ENGINE = MyISAM, PARTITION PartG VALUES IN (22) ENGINE = MyISAM) */ +ALTER TABLE TableA DROP PARTITION partE, PartG; +ALTER TABLE TableA DROP PARTITION Partf; +ALTER TABLE TableA ADD PARTITION +(PARTITION PartE VALUES IN (13)); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION parta VALUES IN (1,8,9) ENGINE = MyISAM, PARTITION partB VALUES IN (2,10,11) ENGINE = MyISAM, PARTITION Partc VALUES IN (3,4,7) ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of REORGANIZE PARTITIONS +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION partF VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION parta VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION Partc VALUES IN (1,7) +COMMENT = "Mix 1 of old parta and Partc", +PARTITION parta VALUES IN (3,9) +COMMENT = "Mix 2 of old parta and Partc", +PARTITION partB VALUES IN (4,8) +COMMENT = "Mix 3 of old parta and Partc"); +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'MyISAM' +PARTITION BY LIST (a) +(PARTITION parta VALUES IN (1,8,9) , +PARTITION partB VALUES IN (2,10,11) , +PARTITION Partc VALUES IN (3,4,7) , +PARTITION PartD VALUES IN (5,6,12) ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION Partc VALUES IN (1,7) COMMENT = 'Mix 1 of old parta and Partc' ENGINE = MyISAM, PARTITION parta VALUES IN (3,9) COMMENT = 'Mix 2 of old parta and Partc' ENGINE = MyISAM, PARTITION partB VALUES IN (4,8) COMMENT = 'Mix 3 of old parta and Partc' ENGINE = MyISAM, PARTITION PartD VALUES IN (5,6,12) ENGINE = MyISAM, PARTITION PartE VALUES IN (13) ENGINE = MyISAM) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +12 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Cleaning up after LIST PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result new file mode 100644 index 00000000000..1c9952370f0 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result @@ -0,0 +1,204 @@ +# Creating database MySQL_TEST_DB +CREATE DATABASE MySQL_Test_DB; +USE MySQL_Test_DB; +# 1.0 KEY partitioning mgm +# Creating KEY partitioned table +CREATE TABLE TableA (a INT) +ENGINE = 'NDBCluster' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10); +INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Test of ADD/COALESCE PARTITIONS +# expecting duplicate partition name +ALTER TABLE TableA ADD PARTITION +(PARTITION partA, +PARTITION Parta, +PARTITION PartA); +ERROR HY000: Duplicate partition name parta +ALTER TABLE TableA ADD PARTITION +(PARTITION partE, +PARTITION Partf, +PARTITION PartG); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster, PARTITION PartD ENGINE = ndbcluster, PARTITION partE ENGINE = ndbcluster, PARTITION Partf ENGINE = ndbcluster, PARTITION PartG ENGINE = ndbcluster) */ +ALTER TABLE TableA COALESCE PARTITION 4; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION parta ENGINE = ndbcluster, PARTITION partB ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of REORGANIZE PARTITIONS +# Should not work on HASH/KEY +ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO +(PARTITION PARTA , +PARTITION partc ); +ERROR HY000: REORGANISE PARTITION can only be used to reorganise partitions not to change their numbers +ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO +(PARTITION partB , +PARTITION parta ); +ERROR HY000: When reorganising a set of partitions they must be in consecutive order +ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO +(PARTITION partB COMMENT="Previusly named parta", +PARTITION parta COMMENT="Previusly named partB"); +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of RENAME TABLE +RENAME TABLE TableA to TableB; +SELECT * FROM TableB; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +RENAME TABLE TableB to TableA; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +# Checking name comparision Upper vs Lower case +# Error if lower_case_table_names != 0 +# lower_case_table_names: 2 +CREATE TABLE tablea (a INT) +ENGINE = 'NDBCluster' +PARTITION BY KEY (a) +(PARTITION parta , +PARTITION partB , +PARTITION Partc , +PARTITION PartD ); +ERROR 42S01: Table 'tablea' already exists +SHOW TABLES; +Tables_in_mysql_test_db +TableA +RENAME TABLE TableA to tablea; +ERROR 42S01: Table 'tablea' already exists +RENAME TABLE tablea to TableA; +ERROR 42S01: Table 'TableA' already exists +SELECT * FROM tablea; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE tablea; +Table Create Table +tablea CREATE TABLE `tablea` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster, PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster, PARTITION Partc ENGINE = ndbcluster) */ +# Test of REMOVE PARTITIONING +ALTER TABLE TableA REMOVE PARTITIONING; +SELECT * FROM TableA; +a +1 +10 +11 +12 +2 +3 +4 +5 +6 +7 +8 +9 +SHOW CREATE TABLE TableA; +Table Create Table +TableA CREATE TABLE `TableA` ( + `a` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 +# Cleaning up after KEY PARTITIONING test +DROP TABLE TableA; +# Cleaning up before exit +USE test; +DROP DATABASE MySQL_Test_DB; diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test b/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test new file mode 100644 index 00000000000..460e08bc124 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc0_archive.test @@ -0,0 +1,42 @@ +################################################################################ +# t/partition_mgm_lc0_archive.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# Archive branch + lower_case_table_names = 0 # +# (usually Unix like, apart from Mac OS X) # +# Also requires lower_case_file_system OFF # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase0.inc +--source include/have_case_sensitive_file_system.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements +let $have_bug37719= 1; + +##### Storage engine to be tested +--source include/have_archive.inc +let $engine= 'Archive'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_innodb.test b/mysql-test/suite/parts/t/partition_mgm_lc0_innodb.test new file mode 100644 index 00000000000..ff218dcb1c8 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc0_innodb.test @@ -0,0 +1,41 @@ +################################################################################ +# t/partition_mgm_lc0_innodb.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# InnoDB branch + lower_case_table_names = 0 # +# (usually Unix like, apart from Mac OS X) # +# Also requires lower_case_file_system OFF # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase0.inc +--source include/have_case_sensitive_file_system.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_memory.test b/mysql-test/suite/parts/t/partition_mgm_lc0_memory.test new file mode 100644 index 00000000000..209387a548b --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc0_memory.test @@ -0,0 +1,41 @@ +################################################################################ +# t/partition_mgm_lc0_memory.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# Memory branch + lower_case_table_names = 0 # +# (usually Unix like, apart from Mac OS X) # +# Also requires lower_case_file_system OFF # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase0.inc +--source include/have_case_sensitive_file_system.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +#--source include/have_memory.inc +let $engine= 'Memory'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_myisam.test b/mysql-test/suite/parts/t/partition_mgm_lc0_myisam.test new file mode 100644 index 00000000000..31ed4776530 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc0_myisam.test @@ -0,0 +1,41 @@ +################################################################################ +# t/partition_mgm_lc0_myisam.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# MyISAM branch + lower_case_table_names = 0 # +# (usually Unix like, apart from Mac OS X) # +# Also requires lower_case_file_system OFF # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase0.inc +--source include/have_case_sensitive_file_system.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +#--source include/have_myisam.inc +let $engine= 'MyISAM'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test new file mode 100644 index 00000000000..686c69cca25 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test @@ -0,0 +1,47 @@ +################################################################################ +# t/partition_mgm_lc0_ndb.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# NDB branch + lower_case_table_names = 0 # +# (usually Unix like, apart from Mac OS X) # +# Also requires lower_case_file_system OFF # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase0.inc +--source include/have_case_sensitive_file_system.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements +let $have_bug33158= 1; + +##### Storage engine to be tested +--source include/have_ndb.inc +connection default; +# Use either $can_only_key or new=on option to run test. +let $can_only_key= 1; +# Allow hash/list/range partitioning with ndb +#SET new=on; +let $engine= 'NDBCluster'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_archive-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc1_archive-master.opt new file mode 100644 index 00000000000..62ab6dad1e0 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_archive-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=1 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_archive.test b/mysql-test/suite/parts/t/partition_mgm_lc1_archive.test new file mode 100644 index 00000000000..2bc643db75f --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_archive.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc1_archive.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# Archive branch + lower_case_table_names = 1 (usually Windows) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase1.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_archive.inc +let $engine= 'Archive'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_innodb-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc1_innodb-master.opt new file mode 100644 index 00000000000..62ab6dad1e0 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_innodb-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=1 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_innodb.test b/mysql-test/suite/parts/t/partition_mgm_lc1_innodb.test new file mode 100644 index 00000000000..f14012d2b5b --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_innodb.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc1_innodb.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# InnoDB branch + lower_case_table_names = 1 (usually Windows) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase1.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_memory-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc1_memory-master.opt new file mode 100644 index 00000000000..62ab6dad1e0 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_memory-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=1 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_memory.test b/mysql-test/suite/parts/t/partition_mgm_lc1_memory.test new file mode 100644 index 00000000000..35d933d2a8c --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_memory.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc1_memory.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# Memory branch + lower_case_table_names = 1 (usually Windows) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase1.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +#--source include/have_memory.inc +let $engine= 'Memory'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_myisam-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc1_myisam-master.opt new file mode 100644 index 00000000000..62ab6dad1e0 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_myisam-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=1 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_myisam.test b/mysql-test/suite/parts/t/partition_mgm_lc1_myisam.test new file mode 100644 index 00000000000..78b51da0a6b --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_myisam.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc1_myisam.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# MyISAM branch + lower_case_table_names = 1 (usually Windows) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase1.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +#--source include/have_myisam.inc +let $engine= 'MyISAM'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt new file mode 100644 index 00000000000..62ab6dad1e0 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=1 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test new file mode 100644 index 00000000000..a70b9b5c41c --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test @@ -0,0 +1,44 @@ +################################################################################ +# t/partition_mgm_lc1_ndb.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# NDB branch + lower_case_table_names = 1 (usually Windows) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase1.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements +let $have_bug33158= 1; + +##### Storage engine to be tested +--source include/have_ndb.inc +connection default; +# Use either $can_only_key or new=on option to run test. +let $can_only_key= 1; +# Allow hash/list/range partitioning with ndb +#SET new=on; +let $engine= 'NDBCluster'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_archive-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc2_archive-master.opt new file mode 100644 index 00000000000..f18979f5a6a --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_archive-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=2 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_archive.test b/mysql-test/suite/parts/t/partition_mgm_lc2_archive.test new file mode 100644 index 00000000000..d0e2591804d --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_archive.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc2_archive.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# Archive branch + lower_case_table_names = 2 (usually Mac OS X) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase2.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_archive.inc +let $engine= 'Archive'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_innodb-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc2_innodb-master.opt new file mode 100644 index 00000000000..f18979f5a6a --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_innodb-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=2 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_innodb.test b/mysql-test/suite/parts/t/partition_mgm_lc2_innodb.test new file mode 100644 index 00000000000..edcce4f9358 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_innodb.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc2_innodb.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# InnoDB branch + lower_case_table_names = 2 (usually Mac OS X) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase2.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_memory-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc2_memory-master.opt new file mode 100644 index 00000000000..f18979f5a6a --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_memory-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=2 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_memory.test b/mysql-test/suite/parts/t/partition_mgm_lc2_memory.test new file mode 100644 index 00000000000..5bed32b958a --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_memory.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc2_memory.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# Memory branch + lower_case_table_names = 2 (usually Mac OS X) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase2.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +#--source include/have_memory.inc +let $engine= 'Memory'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_myisam-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc2_myisam-master.opt new file mode 100644 index 00000000000..f18979f5a6a --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_myisam-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=2 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_myisam.test b/mysql-test/suite/parts/t/partition_mgm_lc2_myisam.test new file mode 100644 index 00000000000..83d35050019 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_myisam.test @@ -0,0 +1,38 @@ +################################################################################ +# t/partition_mgm_lc2_myisam.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# MyISAM branch + lower_case_table_names = 2 (usually Mac OS X) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase2.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +#--source include/have_myisam.inc +let $engine= 'MyISAM'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt new file mode 100644 index 00000000000..f18979f5a6a --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt @@ -0,0 +1 @@ +--lower_case_table_names=2 diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test new file mode 100644 index 00000000000..67fdfdde70b --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test @@ -0,0 +1,43 @@ +################################################################################ +# t/partition_mgm_lc2_ndb.test # +# # +# Purpose: # +# Test of partitioning management functions (incl upper/lower case names): # +# NDB branch + lower_case_table_names = 2 (usually Mac OS X) # +# # +#------------------------------------------------------------------------------# +# Original Author: mattiasj # +# Original Date: 2008-06-27 # +################################################################################ + +# The server must support partitioning. +--source include/have_partition.inc + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements +--source include/have_lowercase2.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_ndb.inc +connection default; +# Use either $can_only_key or new=on option to run test. +let $can_only_key= 1; +# Allow hash/list/range partitioning with ndb +#SET new=on; +let $engine= 'NDBCluster'; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mgm.inc diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index 51385b4b178..d3c9ec5145e 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -6,6 +6,7 @@ --source include/have_innodb.inc --source include/have_lowercase0.inc +--source include/have_case_insensitive_file_system.inc --source include/not_windows.inc --disable_warnings diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 3a78e6601f0..dbfdf0290d8 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -593,6 +593,12 @@ int ha_partition::drop_partitions(const char *path) int error= 0; DBUG_ENTER("ha_partition::drop_partitions"); + /* + Assert that it works without HA_FILE_BASED and lower_case_table_name = 2. + We use m_file[0] as long as all partitions have the same storage engine. + */ + DBUG_ASSERT(!strcmp(path, get_canonical_filename(m_file[0], path, + part_name_buff))); do { partition_element *part_elem= part_it++; @@ -682,6 +688,13 @@ int ha_partition::rename_partitions(const char *path) partition_element *part_elem, *sub_elem; DBUG_ENTER("ha_partition::rename_partitions"); + /* + Assert that it works without HA_FILE_BASED and lower_case_table_name = 2. + We use m_file[0] as long as all partitions have the same storage engine. + */ + DBUG_ASSERT(!strcmp(path, get_canonical_filename(m_file[0], path, + norm_name_buff))); + if (temp_partitions) { /* @@ -1276,6 +1289,12 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info, THD *thd= current_thd; DBUG_ENTER("ha_partition::change_partitions"); + /* + Assert that it works without HA_FILE_BASED and lower_case_table_name = 2. + We use m_file[0] as long as all partitions have the same storage engine. + */ + DBUG_ASSERT(!strcmp(path, get_canonical_filename(m_file[0], path, + part_name_buff))); m_reorged_parts= 0; if (!m_part_info->is_sub_partitioned()) no_subparts= 1; @@ -1708,8 +1727,10 @@ uint ha_partition::del_ren_cre_table(const char *from, { int save_error= 0; int error; - char from_buff[FN_REFLEN], to_buff[FN_REFLEN]; + char from_buff[FN_REFLEN], to_buff[FN_REFLEN], from_lc_buff[FN_REFLEN], + to_lc_buff[FN_REFLEN]; char *name_buffer_ptr; + const char *from_path, *to_path; uint i; handler **file, **abort_file; DBUG_ENTER("del_ren_cre_table()"); @@ -1717,17 +1738,29 @@ uint ha_partition::del_ren_cre_table(const char *from, if (get_from_handler_file(from, current_thd->mem_root)) DBUG_RETURN(TRUE); DBUG_ASSERT(m_file_buffer); + DBUG_PRINT("enter", ("from: (%s) to: (%s)", from, to)); name_buffer_ptr= m_name_buffer_ptr; file= m_file; + /* + Since ha_partition has HA_FILE_BASED, it must alter underlying table names + if they do not have HA_FILE_BASED and lower_case_table_names == 2. + See Bug#37402, for Mac OS X. + The appended #P#[#SP#] will remain in current case. + Using the first partitions handler, since mixing handlers is not allowed. + */ + from_path= get_canonical_filename(*file, from, from_lc_buff); + if (to != NULL) + to_path= get_canonical_filename(*file, to, to_lc_buff); i= 0; do { - create_partition_name(from_buff, from, name_buffer_ptr, NORMAL_PART_NAME, - FALSE); + create_partition_name(from_buff, from_path, name_buffer_ptr, + NORMAL_PART_NAME, FALSE); + if (to != NULL) { // Rename branch - create_partition_name(to_buff, to, name_buffer_ptr, NORMAL_PART_NAME, - FALSE); + create_partition_name(to_buff, to_path, name_buffer_ptr, + NORMAL_PART_NAME, FALSE); error= (*file)->ha_rename_table(from_buff, to_buff); } else if (table_arg == NULL) // delete branch @@ -1749,7 +1782,7 @@ create_error: name_buffer_ptr= m_name_buffer_ptr; for (abort_file= file, file= m_file; file < abort_file; file++) { - create_partition_name(from_buff, from, name_buffer_ptr, NORMAL_PART_NAME, + create_partition_name(from_buff, from_path, name_buffer_ptr, NORMAL_PART_NAME, FALSE); VOID((*file)->ha_delete_table((const char*) from_buff)); name_buffer_ptr= strend(name_buffer_ptr) + 1; diff --git a/sql/handler.cc b/sql/handler.cc index ebe5ea5d4fa..532ea7fa5ac 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1814,8 +1814,8 @@ bool ha_flush_logs(handlerton *db_type) return FALSE; } -static const char *check_lowercase_names(handler *file, const char *path, - char *tmp_path) +const char *get_canonical_filename(handler *file, const char *path, + char *tmp_path) { if (lower_case_table_names != 2 || (file->ha_table_flags() & HA_FILE_BASED)) return path; @@ -1886,7 +1886,7 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path, ! (file=get_new_handler((TABLE_SHARE*)0, thd->mem_root, table_type))) DBUG_RETURN(ENOENT); - path= check_lowercase_names(file, path, tmp_path); + path= get_canonical_filename(file, path, tmp_path); if ((error= file->ha_delete_table(path)) && generate_warning) { /* @@ -3482,7 +3482,7 @@ int ha_create_table(THD *thd, const char *path, if (update_create_info) update_create_info_from_table(create_info, &table); - name= check_lowercase_names(table.file, share.path.str, name_buff); + name= get_canonical_filename(table.file, share.path.str, name_buff); error= table.file->ha_create(name, &table, create_info); VOID(closefrm(&table, 0)); @@ -3554,7 +3554,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) update_create_info_from_table(&create_info, &table); create_info.table_options|= HA_OPTION_CREATE_FROM_ENGINE; - check_lowercase_names(table.file, path, path); + get_canonical_filename(table.file, path, path); error=table.file->ha_create(path, &table, &create_info); VOID(closefrm(&table, 1)); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0060e7873e1..b9747f32b5a 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -2222,6 +2222,8 @@ uint tablename_to_filename(const char *from, char *to, uint to_length); #ifdef MYSQL_SERVER uint build_table_filename(char *buff, size_t bufflen, const char *db, const char *table, const char *ext, uint flags); +const char *get_canonical_filename(handler *file, const char *path, + char *tmp_path); #define MYSQL50_TABLE_NAME_PREFIX "#mysql50#" #define MYSQL50_TABLE_NAME_PREFIX_LENGTH 9 From 52f510ef22d1ebb518467bdb0d29f3cb7a3e77b1 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Fri, 11 Jul 2008 04:51:58 +0500 Subject: [PATCH 085/352] warning elimination --- sql/item_strfunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index c12a1acc980..d1e3f45bba1 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3333,7 +3333,7 @@ String *Item_func_uuid::val_str(String *str) /* -1 so we won't make tv= uuid_time for nanoseq >= (tv - uuid_time) */ - long delta= min(nanoseq, (long) (tv - uuid_time -1)); + ulong delta= min(nanoseq, (ulong) (tv - uuid_time -1)); tv-= delta; nanoseq-= delta; } From 211164ff8ca4b9b00a1da80be3e36e55a09d22b8 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Mon, 14 Jul 2008 14:06:49 +0500 Subject: [PATCH 086/352] Bug #37761: IN handles NULL differently for table-subquery and value-list The server returns unexpected results if a right side of the NOT IN clause consists of NULL value and some constants of the same type, for example: SELECT * FROM t WHERE NOT t.id IN (NULL, 1, 2) may return 3, 4, 5 etc if a table contains these values. The Item_func_in::val_int method has been modified: unnecessary resets of an Item_func_case::has_null field value has been moved outside of an argument comparison loop. (Also unnecessary re-initialization of the null_value field has been moved). --- mysql-test/r/func_in.result | 6 ++++++ mysql-test/t/func_in.test | 9 +++++++++ sql/item_cmpfunc.cc | 6 +++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 6e1f9bd8188..e761fb851fb 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -569,4 +569,10 @@ insert into t1 values (),(),(),(),(),(),(),(),(),(); select a from t1 where a not in (a,a,a) group by a; a drop table t1; +create table t1 (id int); +select * from t1 where NOT id in (select null union all select 1); +id +select * from t1 where NOT id in (null, 1); +id +drop table t1; End of 5.1 tests diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index d8b0c89532e..d0d4dea0713 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -417,4 +417,13 @@ insert into t1 values (),(),(),(),(),(),(),(),(),(); select a from t1 where a not in (a,a,a) group by a; drop table t1; +# +# Bug #37761: IN handles NULL differently for table-subquery and value-list +# + +create table t1 (id int); +select * from t1 where NOT id in (select null union all select 1); +select * from t1 where NOT id in (null, 1); +drop table t1; + --echo End of 5.1 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index f267ad39984..2db77eb7c56 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3758,6 +3758,9 @@ longlong Item_func_in::val_int() return (longlong) (!null_value && tmp != negated); } + if ((null_value= args[0]->null_value)) + return 0; + have_null= 0; for (uint i= 1 ; i < arg_count ; i++) { Item_result cmp_type= item_cmp_type(left_result_type, args[i]->result_type()); @@ -3766,9 +3769,6 @@ longlong Item_func_in::val_int() if (!(value_added_map & (1 << (uint)cmp_type))) { in_item->store_value(args[0]); - if ((null_value=args[0]->null_value)) - return 0; - have_null= 0; value_added_map|= 1 << (uint)cmp_type; } if (!in_item->cmp(args[i]) && !args[i]->null_value) From e41daab5c4c9f886bd7f6a1f7d4818666ed74856 Mon Sep 17 00:00:00 2001 From: mysqldev Date: Mon, 14 Jul 2008 16:46:35 +0200 Subject: [PATCH 087/352] Set version number to 5.1.27 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index af23b6035eb..4441362020a 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.26-rc) +AM_INIT_AUTOMAKE(mysql, 5.1.27) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 0816ee6d34f7568a5e9994fa6e89bb1d2efaaeea Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 14 Jul 2008 15:41:30 -0600 Subject: [PATCH 088/352] Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on build) The crash was caused by freeing the internal parser stack during the parser execution. This occured only for complex stored procedures, after reallocating the parser stack using my_yyoverflow(), with the following C call stack: - MYSQLparse() - any rule calling sp_head::restore_lex() - lex_end() - x_free(lex->yacc_yyss), xfree(lex->yacc_yyvs) The root cause is the implementation of stored procedures, which breaks the assumption from 4.1 that there is only one LEX structure per parser call. The solution is to separate the LEX structure into: - attributes that represent a statement (the current LEX structure), - attributes that relate to the syntax parser itself (Yacc_state), so that parsing multiple statements in stored programs can create multiple LEX structures while not changing the unique Yacc_state. Now, Yacc_state and the existing Lex_input_stream are aggregated into Parser_state, a structure that represent the complete state of the (Lexical + Syntax) parser. --- mysql-test/r/parser_stack.result | 306 +++++++++++++++++++++++ mysql-test/t/parser_stack.test | 402 +++++++++++++++++++++++++++++++ sql/sp.cc | 5 +- sql/sp_head.cc | 2 +- sql/sql_class.cc | 3 +- sql/sql_class.h | 12 +- sql/sql_lex.cc | 20 +- sql/sql_lex.h | 54 ++++- sql/sql_parse.cc | 48 ++-- sql/sql_prepare.cc | 7 +- sql/sql_trigger.cc | 6 +- sql/sql_view.cc | 5 +- sql/sql_yacc.yy | 62 ++--- 13 files changed, 848 insertions(+), 84 deletions(-) create mode 100644 mysql-test/r/parser_stack.result create mode 100644 mysql-test/t/parser_stack.test diff --git a/mysql-test/r/parser_stack.result b/mysql-test/r/parser_stack.result new file mode 100644 index 00000000000..a0040fc6ae6 --- /dev/null +++ b/mysql-test/r/parser_stack.result @@ -0,0 +1,306 @@ +use test; +SELECT +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +1 +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +; +1 +1 +prepare stmt from +" +SELECT +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +1 +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +" +; +execute stmt; +1 +1 +drop view if exists view_overflow; +CREATE VIEW view_overflow AS +SELECT +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +1 +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +; +SELECT * from view_overflow; +1 +1 +drop view view_overflow; +drop procedure if exists proc_overflow; +CREATE PROCEDURE proc_overflow() +BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +select 1; +select 2; +select 3; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END $$ +call proc_overflow(); +1 +1 +2 +2 +3 +3 +drop procedure proc_overflow; +drop function if exists func_overflow; +create function func_overflow() returns int +BEGIN +DECLARE x int default 0; +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +SET x=x+1; +SET x=x+2; +SET x=x+3; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +return x; +END $$ +select func_overflow(); +func_overflow() +6 +drop function func_overflow; +drop table if exists table_overflow; +create table table_overflow(a int, b int); +create trigger trigger_overflow before insert on table_overflow +for each row +BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN +SET NEW.b := NEW.a; +SET NEW.b := NEW.b + 1; +SET NEW.b := NEW.b + 2; +SET NEW.b := NEW.b + 3; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END; END; END; END; END; END; END; END; END; END; END; END; +END $$ +insert into table_overflow set a=10; +insert into table_overflow set a=20; +select * from table_overflow; +a b +10 16 +20 26 +drop table table_overflow; +drop procedure if exists proc_35577; +CREATE PROCEDURE proc_35577() +BEGIN +DECLARE z_done INT DEFAULT 0; +DECLARE t_done VARCHAR(5000); +outer_loop: LOOP +IF t_done=1 THEN +LEAVE outer_loop; +END IF; +inner_block:BEGIN +DECLARE z_done INT DEFAULT 0; +SET z_done = 0; +inner_loop: LOOP +IF z_done=1 THEN +LEAVE inner_loop; +END IF; +IF (t_done = 'a') THEN +IF (t_done <> 0) THEN +IF ( t_done > 0) THEN +IF (t_done = 'a') THEN +SET t_done = 'a'; +ELSEIF (t_done = 'a') THEN +SET t_done = 'a'; +ELSEIF(t_done = 'a') THEN +SET t_done = 'a'; +ELSEIF(t_done = 'a') THEN +SET t_done = 'a'; +ELSEIF(t_done = 'a') THEN +SET t_done = 'a'; +ELSEIF(t_done = 'a') THEN +SET t_done = 'a'; +ELSEIF(t_done = 'a') THEN +SET t_done = 'a'; +ELSEIF(t_done = 'a') THEN +SET t_done = 'a'; +END IF; +END IF; +END IF; +END IF; +END LOOP inner_loop; +END inner_block; +END LOOP outer_loop; +END $$ +drop procedure proc_35577; +drop procedure if exists p_37269; +create procedure p_37269() +begin +declare done int default 0; +declare varb int default 0; +declare vara int default 0; +repeat +select now(); +until done end repeat; +while varb do +select now(); +begin +select now(); +repeat +select now(); +until done end repeat; +if vara then +select now(); +repeat +select now(); +loop +select now(); +end loop; +repeat +select now(); +label1: while varb do +select now(); +end while label1; +if vara then +select now(); +repeat +select now(); +until done end repeat; +begin +select now(); +while varb do +select now(); +label1: while varb do +select now(); +end while label1; +if vara then +select now(); +while varb do +select now(); +loop +select now(); +end loop; +repeat +select now(); +loop +select now(); +while varb do +select now(); +end while; +repeat +select now(); +label1: loop +select now(); +if vara then +select now(); +end if; +end loop label1; +until done end repeat; +end loop; +until done end repeat; +end while; +end if; +end while; +end; +end if; +until done end repeat; +until done end repeat; +end if; +end; +end while; +end $$ +drop procedure p_37269; +drop procedure if exists p_37228; +create procedure p_37228 () +BEGIN +DECLARE v INT DEFAULT 123; +IF (v > 1) THEN SET v = 1; +ELSEIF (v < 10) THEN SET v = 10; +ELSEIF (v < 11) THEN SET v = 11; +ELSEIF (v < 12) THEN SET v = 12; +ELSEIF (v < 13) THEN SET v = 13; +ELSEIF (v < 14) THEN SET v = 14; +ELSEIF (v < 15) THEN SET v = 15; +ELSEIF (v < 16) THEN SET v = 16; +ELSEIF (v < 17) THEN SET v = 17; +ELSEIF (v < 18) THEN SET v = 18; +ELSEIF (v < 19) THEN SET v = 19; +ELSEIF (v < 20) THEN SET v = 20; +ELSEIF (v < 21) THEN SET v = 21; +ELSEIF (v < 22) THEN SET v = 22; +ELSEIF (v < 23) THEN SET v = 23; +ELSEIF (v < 24) THEN SET v = 24; +ELSEIF (v < 25) THEN SET v = 25; +ELSEIF (v < 26) THEN SET v = 26; +ELSEIF (v < 27) THEN SET v = 27; +ELSEIF (v < 28) THEN SET v = 28; +ELSEIF (v < 29) THEN SET v = 29; +ELSEIF (v < 30) THEN SET v = 30; +ELSEIF (v < 31) THEN SET v = 31; +ELSEIF (v < 32) THEN SET v = 32; +ELSEIF (v < 33) THEN SET v = 33; +ELSEIF (v < 34) THEN SET v = 34; +ELSEIF (v < 35) THEN SET v = 35; +ELSEIF (v < 36) THEN SET v = 36; +ELSEIF (v < 37) THEN SET v = 37; +ELSEIF (v < 38) THEN SET v = 38; +ELSEIF (v < 39) THEN SET v = 39; +END IF; +END $$ +drop procedure p_37228; diff --git a/mysql-test/t/parser_stack.test b/mysql-test/t/parser_stack.test new file mode 100644 index 00000000000..3330ef41833 --- /dev/null +++ b/mysql-test/t/parser_stack.test @@ -0,0 +1,402 @@ +# Copyright (C) 2008 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# +# These tests are designed to cause an internal parser stack overflow, +# and trigger my_yyoverflow(). +# + +use test; + +SELECT +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +1 +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +; + +prepare stmt from +" +SELECT +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +1 +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +" +; + +execute stmt; + +--disable_warnings +drop view if exists view_overflow; +--enable_warnings + +CREATE VIEW view_overflow AS +SELECT +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +1 +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +; + +SELECT * from view_overflow; + +drop view view_overflow; + +--disable_warnings +drop procedure if exists proc_overflow; +--enable_warnings + +delimiter $$; + +CREATE PROCEDURE proc_overflow() +BEGIN + + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + + select 1; + select 2; + select 3; + + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + +END $$ + +delimiter ;$$ + +call proc_overflow(); + +drop procedure proc_overflow; + +--disable_warnings +drop function if exists func_overflow; +--enable_warnings + +delimiter $$; + +create function func_overflow() returns int +BEGIN + DECLARE x int default 0; + + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + + SET x=x+1; + SET x=x+2; + SET x=x+3; + + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + + return x; +END $$ + +delimiter ;$$ + +select func_overflow(); + +drop function func_overflow; + +--disable_warnings +drop table if exists table_overflow; +--enable_warnings + +create table table_overflow(a int, b int); + +delimiter $$; + +create trigger trigger_overflow before insert on table_overflow +for each row +BEGIN + + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN + + SET NEW.b := NEW.a; + SET NEW.b := NEW.b + 1; + SET NEW.b := NEW.b + 2; + SET NEW.b := NEW.b + 3; + + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + END; END; END; END; END; END; END; END; END; END; END; END; + +END $$ + +delimiter ;$$ + +insert into table_overflow set a=10; +insert into table_overflow set a=20; +select * from table_overflow; + +drop table table_overflow; + +--disable_warnings +drop procedure if exists proc_35577; +--enable_warnings + +delimiter $$; + +CREATE PROCEDURE proc_35577() +BEGIN + DECLARE z_done INT DEFAULT 0; + DECLARE t_done VARCHAR(5000); + outer_loop: LOOP + IF t_done=1 THEN + LEAVE outer_loop; + END IF; + + inner_block:BEGIN + DECLARE z_done INT DEFAULT 0; + SET z_done = 0; + inner_loop: LOOP + IF z_done=1 THEN + LEAVE inner_loop; + END IF; + IF (t_done = 'a') THEN + IF (t_done <> 0) THEN + IF ( t_done > 0) THEN + IF (t_done = 'a') THEN + SET t_done = 'a'; + ELSEIF (t_done = 'a') THEN + SET t_done = 'a'; + ELSEIF(t_done = 'a') THEN + SET t_done = 'a'; + ELSEIF(t_done = 'a') THEN + SET t_done = 'a'; + ELSEIF(t_done = 'a') THEN + SET t_done = 'a'; + ELSEIF(t_done = 'a') THEN + SET t_done = 'a'; + ELSEIF(t_done = 'a') THEN + SET t_done = 'a'; + ELSEIF(t_done = 'a') THEN + SET t_done = 'a'; + END IF; + END IF; + END IF; + END IF; + END LOOP inner_loop; + END inner_block; + END LOOP outer_loop; +END $$ + +delimiter ;$$ + +drop procedure proc_35577; + +# +# Bug#37269 (parser crash when creating stored procedure) +# + +--disable_warnings +drop procedure if exists p_37269; +--enable_warnings + +delimiter $$; + +create procedure p_37269() +begin + declare done int default 0; + declare varb int default 0; + declare vara int default 0; + + repeat + select now(); + until done end repeat; + while varb do + select now(); + begin + select now(); + repeat + select now(); + until done end repeat; + if vara then + select now(); + repeat + select now(); + loop + select now(); + end loop; + repeat + select now(); + label1: while varb do + select now(); + end while label1; + if vara then + select now(); + repeat + select now(); + until done end repeat; + begin + select now(); + while varb do + select now(); + label1: while varb do + select now(); + end while label1; + if vara then + select now(); + while varb do + select now(); + loop + select now(); + end loop; + repeat + select now(); + loop + select now(); + while varb do + select now(); + end while; + repeat + select now(); + label1: loop + select now(); + if vara then + select now(); + end if; + end loop label1; + until done end repeat; + end loop; + until done end repeat; + end while; + end if; + end while; + end; + end if; + until done end repeat; + until done end repeat; + end if; + end; + end while; +end $$ + +delimiter ;$$ + +drop procedure p_37269; + +# +# Bug#37228 (Sever crashes when creating stored procedure with more than +# 10 IF/ELSEIF) +# + +--disable_warnings +drop procedure if exists p_37228; +--enable_warnings + +delimiter $$; + +create procedure p_37228 () +BEGIN + DECLARE v INT DEFAULT 123; + + IF (v > 1) THEN SET v = 1; + ELSEIF (v < 10) THEN SET v = 10; + ELSEIF (v < 11) THEN SET v = 11; + ELSEIF (v < 12) THEN SET v = 12; + ELSEIF (v < 13) THEN SET v = 13; + ELSEIF (v < 14) THEN SET v = 14; + ELSEIF (v < 15) THEN SET v = 15; + ELSEIF (v < 16) THEN SET v = 16; + ELSEIF (v < 17) THEN SET v = 17; + ELSEIF (v < 18) THEN SET v = 18; + ELSEIF (v < 19) THEN SET v = 19; + ELSEIF (v < 20) THEN SET v = 20; + ELSEIF (v < 21) THEN SET v = 21; + ELSEIF (v < 22) THEN SET v = 22; + ELSEIF (v < 23) THEN SET v = 23; + ELSEIF (v < 24) THEN SET v = 24; + ELSEIF (v < 25) THEN SET v = 25; + ELSEIF (v < 26) THEN SET v = 26; + ELSEIF (v < 27) THEN SET v = 27; + ELSEIF (v < 28) THEN SET v = 28; + ELSEIF (v < 29) THEN SET v = 29; + ELSEIF (v < 30) THEN SET v = 30; + ELSEIF (v < 31) THEN SET v = 31; + ELSEIF (v < 32) THEN SET v = 32; + ELSEIF (v < 33) THEN SET v = 33; + ELSEIF (v < 34) THEN SET v = 34; + ELSEIF (v < 35) THEN SET v = 35; + ELSEIF (v < 36) THEN SET v = 36; + ELSEIF (v < 37) THEN SET v = 37; + ELSEIF (v < 38) THEN SET v = 38; + ELSEIF (v < 39) THEN SET v = 39; + END IF; +END $$ + +delimiter ;$$ + +drop procedure p_37228; + + diff --git a/sql/sp.cc b/sql/sp.cc index 2392cabb220..d2a12f2190f 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -443,11 +443,12 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, goto end; { - Lex_input_stream lip(thd, defstr.c_ptr(), defstr.length()); - thd->m_lip= &lip; + Parser_state parser_state(thd, defstr.c_ptr(), defstr.length()); + thd->m_parser_state= &parser_state; lex_start(thd); thd->spcont= NULL; ret= MYSQLparse(thd); + thd->m_parser_state= NULL; if (ret == 0) { diff --git a/sql/sp_head.cc b/sql/sp_head.cc index aea81e301ef..2d920598c46 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -591,7 +591,7 @@ sp_head::init_strings(THD *thd, LEX *lex) const char *endp; /* Used to trim the end */ /* During parsing, we must use thd->mem_root */ MEM_ROOT *root= thd->mem_root; - Lex_input_stream *lip=thd->m_lip; + Lex_input_stream *lip= & thd->m_parser_state->m_lip; if (m_param_begin && m_param_end) { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f541c8b3677..6fd11e340be 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -177,7 +177,8 @@ THD::THD() rand_used(0), time_zone_used(0), last_insert_id_used(0), last_insert_id_used_bin_log(0), insert_id_used(0), clear_next_insert_id(0), in_lock_tables(0), bootstrap(0), - derived_tables_processing(FALSE), spcont(NULL), m_lip(NULL) + derived_tables_processing(FALSE), spcont(NULL), + m_parser_state(NULL) { ulong tmp; diff --git a/sql/sql_class.h b/sql/sql_class.h index 4ca8947de30..77ef868a5c6 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -28,7 +28,7 @@ class Slave_log_event; class Format_description_log_event; class sp_rcontext; class sp_cache; -class Lex_input_stream; +class Parser_state; enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME }; @@ -1575,13 +1575,11 @@ public: } binlog_evt_union; /** - Character input stream consumed by the lexical analyser, - used during parsing. - Note that since the parser is not re-entrant, we keep only one input - stream here. This member is valid only when executing code during parsing, - and may point to invalid memory after that. + Internal parser state. + Note that since the parser is not re-entrant, we keep only one parser + state here. This member is valid only when executing code during parsing. */ - Lex_input_stream *m_lip; + Parser_state *m_parser_state; THD(); ~THD(); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a1bfc3edc6c..0cf7c11b447 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -192,7 +192,6 @@ void lex_start(THD *thd) lex->select_lex.order_list.empty(); lex->select_lex.udf_list.empty(); lex->current_select= &lex->select_lex; - lex->yacc_yyss=lex->yacc_yyvs=0; lex->sql_command= lex->orig_sql_command= SQLCOM_END; lex->duplicates= DUP_ERROR; lex->ignore= 0; @@ -210,11 +209,16 @@ void lex_start(THD *thd) void lex_end(LEX *lex) { - DBUG_ENTER("lex_end"); - DBUG_PRINT("enter", ("lex: 0x%lx", (long) lex)); - x_free(lex->yacc_yyss); - x_free(lex->yacc_yyvs); - DBUG_VOID_RETURN; + /* Empty in 5.0, non empty in 5.1 */ +} + +Yacc_state::~Yacc_state() +{ + if (yacc_yyss) + { + x_free(yacc_yyss); + x_free(yacc_yyvs); + } } @@ -531,7 +535,7 @@ int MYSQLlex(void *arg, void *yythd) uint length; enum my_lex_states state; THD *thd= (THD *)yythd; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= & thd->m_parser_state->m_lip; LEX *lex= thd->lex; YYSTYPE *yylval=(YYSTYPE*) arg; CHARSET_INFO *cs= thd->charset(); @@ -1781,7 +1785,7 @@ void Query_tables_list::destroy_query_tables_list() */ st_lex::st_lex() - :result(0), yacc_yyss(0), yacc_yyvs(0), + :result(0), sql_command(SQLCOM_END) { reset_query_tables_list(TRUE); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index cde4c3a97b3..df0db2e209d 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1004,7 +1004,6 @@ typedef struct st_lex : public Query_tables_list LEX_STRING comment, ident; LEX_USER *grant_user; XID *xid; - gptr yacc_yyss,yacc_yyvs; THD *thd; CHARSET_INFO *charset, *underscore_charset; bool text_string_is_7bit; @@ -1290,6 +1289,59 @@ typedef struct st_lex : public Query_tables_list } } LEX; + +/** + The internal state of the syntax parser. + This object is only available during parsing, + and is private to the syntax parser implementation (sql_yacc.yy). +*/ +class Yacc_state +{ +public: + Yacc_state() + : yacc_yyss(NULL), yacc_yyvs(NULL) + {} + + ~Yacc_state(); + + /** + Bison internal state stack, yyss, when dynamically allocated using + my_yyoverflow(). + */ + gptr yacc_yyss; + + /** + Bison internal semantic value stack, yyvs, when dynamically allocated using + my_yyoverflow(). + */ + gptr yacc_yyvs; + + /* + TODO: move more attributes from the LEX structure here. + */ +}; + +/** + Internal state of the parser. + The complete state consist of: + - state data used during lexical parsing, + - state data used during syntactic parsing. +*/ +class Parser_state +{ +public: + Parser_state(THD *thd, const char* buff, unsigned int length) + : m_lip(thd, buff, length), m_yacc() + {} + + ~Parser_state() + {} + + Lex_input_stream m_lip; + Yacc_state m_yacc; +}; + + struct st_lex_local: public st_lex { static void *operator new(size_t size) throw() diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 62a5a79a833..58b942f21d2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5875,29 +5875,35 @@ bool check_stack_overrun(THD *thd, long margin, bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize) { - LEX *lex= current_thd->lex; + Yacc_state *state= & current_thd->m_parser_state->m_yacc; ulong old_info=0; + DBUG_ASSERT(state); if ((uint) *yystacksize >= MY_YACC_MAX) return 1; - if (!lex->yacc_yyvs) + if (!state->yacc_yyvs) old_info= *yystacksize; *yystacksize= set_zone((*yystacksize)*2,MY_YACC_INIT,MY_YACC_MAX); - if (!(lex->yacc_yyvs= (char*) - my_realloc((gptr) lex->yacc_yyvs, + if (!(state->yacc_yyvs= (char*) + my_realloc(state->yacc_yyvs, *yystacksize*sizeof(**yyvs), MYF(MY_ALLOW_ZERO_PTR | MY_FREE_ON_ERROR))) || - !(lex->yacc_yyss= (char*) - my_realloc((gptr) lex->yacc_yyss, + !(state->yacc_yyss= (char*) + my_realloc(state->yacc_yyss, *yystacksize*sizeof(**yyss), MYF(MY_ALLOW_ZERO_PTR | MY_FREE_ON_ERROR)))) return 1; if (old_info) - { // Copy old info from stack - memcpy(lex->yacc_yyss, (gptr) *yyss, old_info*sizeof(**yyss)); - memcpy(lex->yacc_yyvs, (gptr) *yyvs, old_info*sizeof(**yyvs)); + { + /* + Only copy the old stack on the first call to my_yyoverflow(), + when replacing a static stack (YYINITDEPTH) by a dynamic stack. + For subsequent calls, my_realloc already did preserve the old stack. + */ + memcpy(state->yacc_yyss, *yyss, old_info*sizeof(**yyss)); + memcpy(state->yacc_yyvs, *yyvs, old_info*sizeof(**yyvs)); } - *yyss=(short*) lex->yacc_yyss; - *yyvs=(YYSTYPE*) lex->yacc_yyvs; + *yyss= (short*) state->yacc_yyss; + *yyvs= (YYSTYPE*) state->yacc_yyvs; return 0; } @@ -6136,11 +6142,12 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, sp_cache_flush_obsolete(&thd->sp_proc_cache); sp_cache_flush_obsolete(&thd->sp_func_cache); - Lex_input_stream lip(thd, inBuf, length); - thd->m_lip= &lip; + Parser_state parser_state(thd, inBuf, length); + thd->m_parser_state= &parser_state; int err= MYSQLparse(thd); - *found_semicolon= lip.found_semicolon; + *found_semicolon= parser_state.m_lip.found_semicolon; + thd->m_parser_state= NULL; if (!err && ! thd->is_fatal_error) { @@ -6165,8 +6172,9 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, PROCESSLIST. Note that we don't need LOCK_thread_count to modify query_length. */ - if (lip.found_semicolon && - (thd->query_length= (ulong)(lip.found_semicolon - thd->query))) + if (parser_state.m_lip.found_semicolon && + (thd->query_length= (ulong)(parser_state.m_lip.found_semicolon + - thd->query))) thd->query_length--; /* Actually execute the query */ if (*found_semicolon) @@ -6225,11 +6233,13 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) bool error= 0; DBUG_ENTER("mysql_test_parse_for_slave"); - Lex_input_stream lip(thd, inBuf, length); - thd->m_lip= &lip; + Parser_state parser_state(thd, inBuf, length); + thd->m_parser_state= &parser_state; + lex_start(thd); mysql_reset_thd_for_next_command(thd); int err= MYSQLparse((void*) thd); + thd->m_parser_state= NULL; if (!err && ! thd->is_fatal_error && all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first)) @@ -7295,7 +7305,7 @@ bool check_simple_select() if (lex->current_select != &lex->select_lex) { char command[80]; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= & thd->m_parser_state->m_lip; strmake(command, lip->yylval->symbol.str, min(lip->yylval->symbol.length, sizeof(command)-1)); my_error(ER_CANT_USE_OPTION_HERE, MYF(0), command); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index e7855946179..9e144f5ae9b 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2849,12 +2849,13 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) old_stmt_arena= thd->stmt_arena; thd->stmt_arena= this; - Lex_input_stream lip(thd, thd->query, thd->query_length); - lip.stmt_prepare_mode= TRUE; - thd->m_lip= &lip; + Parser_state parser_state(thd, thd->query, thd->query_length); + parser_state.m_lip.stmt_prepare_mode= TRUE; + thd->m_parser_state= &parser_state; lex_start(thd); lex->safe_to_cache_query= FALSE; int err= MYSQLparse((void *)thd); + thd->m_parser_state= NULL; lex->set_trg_event_type_for_tables(); error= err || thd->is_fatal_error || diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 1737bb0d9f8..bead50e1da8 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -968,11 +968,13 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, thd->variables.sql_mode= (ulong)*trg_sql_mode; - Lex_input_stream lip(thd, trg_create_str->str, trg_create_str->length); - thd->m_lip= &lip; + Parser_state parser_state(thd, trg_create_str->str, + trg_create_str->length); + thd->m_parser_state= &parser_state; lex_start(thd); thd->spcont= NULL; int err= MYSQLparse((void *)thd); + thd->m_parser_state= NULL; if (err || thd->is_fatal_error) { diff --git a/sql/sql_view.cc b/sql/sql_view.cc index de92d6dc3b9..3b5fd6a085b 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1081,8 +1081,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, char old_db_buf[NAME_LEN+1]; LEX_STRING old_db= { old_db_buf, sizeof(old_db_buf) }; bool dbchanged; - Lex_input_stream lip(thd, table->query.str, table->query.length); - thd->m_lip= &lip; + Parser_state parser_state(thd, table->query.str, table->query.length); /* Use view db name as thread default database, in order to ensure @@ -1091,6 +1090,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, if ((result= sp_use_new_db(thd, table->view_db, &old_db, 1, &dbchanged))) goto end; + thd->m_parser_state= &parser_state; lex_start(thd); view_select= &lex->select_lex; view_select->select_number= ++thd->select_number; @@ -1125,6 +1125,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, CHARSET_INFO *save_cs= thd->variables.character_set_client; thd->variables.character_set_client= system_charset_info; res= MYSQLparse((void *)thd); + thd->m_parser_state= NULL; if ((old_lex->sql_command == SQLCOM_SHOW_FIELDS) || (old_lex->sql_command == SQLCOM_SHOW_CREATE)) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 090585392a0..39851ac66f8 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -23,6 +23,7 @@ #define YYPARSE_PARAM yythd #define YYLEX_PARAM yythd #define YYTHD ((THD *)yythd) +#define YYLIP (& YYTHD->m_parser_state->m_lip) #define MYSQL_YACC #define YYINITDEPTH 100 @@ -86,7 +87,7 @@ const LEX_STRING null_lex_str={0,0}; void my_parse_error(const char *s) { THD *thd= current_thd; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= & thd->m_parser_state->m_lip; const char *yytext= lip->tok_start; /* Push an error into the error stack */ @@ -1213,11 +1214,11 @@ query: MYSQL_YYABORT; } thd->lex->sql_command= SQLCOM_EMPTY_QUERY; - thd->m_lip->found_semicolon= NULL; + YYLIP->found_semicolon= NULL; } | verb_clause { - Lex_input_stream *lip = YYTHD->m_lip; + Lex_input_stream *lip = YYLIP; if ((YYTHD->client_capabilities & CLIENT_MULTI_QUERIES) && ! lip->stmt_prepare_mode && @@ -1243,7 +1244,7 @@ query: | verb_clause END_OF_INPUT { /* Single query, not terminated. */ - YYTHD->m_lip->found_semicolon= NULL; + YYLIP->found_semicolon= NULL; } ; @@ -2155,7 +2156,7 @@ sp_proc_stmt: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; if (lex->sphead->reset_lex(thd)) MYSQL_YYABORT; @@ -2165,7 +2166,7 @@ sp_proc_stmt: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; sp_head *sp= lex->sphead; sp->m_flags|= sp_get_flags_for_command(lex); @@ -4503,16 +4504,12 @@ select_item: remember_name: { - THD *thd= YYTHD; - Lex_input_stream *lip= thd->m_lip; - $$= (char*) lip->tok_start; + $$= (char*) YYLIP->tok_start; }; remember_end: { - THD *thd= YYTHD; - Lex_input_stream *lip= thd->m_lip; - $$=(char*) lip->tok_end; + $$=(char*) YYLIP->tok_end; }; select_item2: @@ -6452,7 +6449,7 @@ procedure_item: remember_name expr { THD *thd= YYTHD; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; if (add_proc_to_list(thd, $2)) MYSQL_YYABORT; @@ -7524,7 +7521,7 @@ load: LOAD DATA_SYM { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; if (lex->sphead) { @@ -7566,10 +7563,7 @@ load_data: } opt_duplicate INTO { - THD *thd= YYTHD; - LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; - lex->fname_end= lip->ptr; + Lex->fname_end= YYLIP->ptr; } TABLE_SYM table_ident { @@ -7787,7 +7781,7 @@ param_marker: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; Item_param *item; if (! lex->parsing_options.allows_variable) { @@ -7820,7 +7814,7 @@ literal: | NULL_SYM { $$ = new Item_null(); - YYTHD->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT; + YYLIP->next_state= MY_LEX_OPERATOR_OR_IDENT; } | FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); } | TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); } @@ -7924,7 +7918,7 @@ simple_ident: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; sp_variable_t *spv; sp_pcontext *spc = lex->spcont; if (spc && (spv = spc->find_variable(&$1))) @@ -8537,7 +8531,7 @@ option_type_value: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; if (lex->sphead) { @@ -8568,7 +8562,7 @@ option_type_value: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; if (lex->sphead) { @@ -9878,7 +9872,7 @@ trigger_tail: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; sp_head *sp; if (lex->sphead) @@ -9971,7 +9965,7 @@ sf_tail: { /* $5 */ THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; sp_head *sp; lex->stmt_definition_begin= $1; @@ -9996,11 +9990,7 @@ sf_tail: sp_fdparam_list /* $6 */ ')' /* $7 */ { /* $8 */ - THD *thd= YYTHD; - LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; - - lex->sphead->m_param_end= lip->tok_start; + Lex->sphead->m_param_end= YYLIP->tok_start; } RETURNS_SYM /* $9 */ { /* $10 */ @@ -10026,7 +10016,7 @@ sf_tail: { /* $14 */ THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; lex->sphead->m_chistics= &lex->sp_chistics; lex->sphead->m_body_begin= lip->tok_start; @@ -10078,18 +10068,14 @@ sp_tail: } '(' { - THD *thd= YYTHD; - LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; - - lex->sphead->m_param_begin= lip->tok_start+1; + Lex->sphead->m_param_begin= YYLIP->tok_start+1; } sp_pdparam_list ')' { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; lex->sphead->m_param_end= lip->tok_start; bzero((char *)&lex->sp_chistics, sizeof(st_sp_chistics)); @@ -10098,7 +10084,7 @@ sp_tail: { THD *thd= YYTHD; LEX *lex= thd->lex; - Lex_input_stream *lip= thd->m_lip; + Lex_input_stream *lip= YYLIP; lex->sphead->m_chistics= &lex->sp_chistics; lex->sphead->m_body_begin= lip->tok_start; From 4979d6b7533ca5908a197f8886d0d8da13f2b2c3 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Tue, 15 Jul 2008 16:52:23 +0530 Subject: [PATCH 089/352] WL#4380 Add the abi_check rule to the main build. --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index 7e98cc5c504..6ea03a6d55e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,6 +58,8 @@ dist-hook: --datadir=$(distdir)/win/data \ --srcdir=$(top_srcdir) +all-local: abi_check + tags: support-files/build-tags From 76083ed3cfb889d0e8cae816f6cdf67a49bcd4b2 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Tue, 15 Jul 2008 13:42:21 +0200 Subject: [PATCH 090/352] Bug#23921: random failure of user_limits.test mysqltest disconnect/connect-combo could be so quick that connect would hit the server before it had processed the disconnect. Since that resulted in one more concurrent connection than we meant to have, global or per-user max-user-connections could be exceeded. This could lead to "random" failures in tests that set those limits. --- client/mysqltest.c | 181 ++++++++++++++++++++++++---------- mysql-test/r/mysqltest.result | 1 + mysql-test/t/disabled.def | 1 - mysql-test/t/mysqltest.test | 2 + 4 files changed, 130 insertions(+), 55 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index bd7a84e2d6a..1ff902481b8 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -163,6 +163,8 @@ static ulonglong timer_now(void); static ulonglong progress_start= 0; +static ulong connection_retry_sleep= 100000; /* Microseconds */ + /* Precompiled re's */ static my_regex_t ps_re; /* the query can be run using PS protocol */ static my_regex_t sp_re; /* the query can be run as a SP */ @@ -482,6 +484,9 @@ void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val); void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val); void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING* ds_input); +static int match_expected_error(struct st_command *command, + unsigned int err_errno, + const char *err_sqlstate); void handle_error(struct st_command*, unsigned int err_errno, const char *err_error, const char *err_sqlstate, DYNAMIC_STRING *ds); @@ -835,29 +840,25 @@ void check_command_args(struct st_command *command, DBUG_VOID_RETURN; } - void handle_command_error(struct st_command *command, uint error) { DBUG_ENTER("handle_command_error"); DBUG_PRINT("enter", ("error: %d", error)); if (error != 0) { - uint i; + int i; if (command->abort_on_error) die("command \"%.*s\" failed with error %d", command->first_word_len, command->query, error); - for (i= 0; i < command->expected_errors.count; i++) + + i= match_expected_error(command, error, NULL); + + if (i >= 0) { - DBUG_PRINT("info", ("expected error: %d", - command->expected_errors.err[i].code.errnum)); - if ((command->expected_errors.err[i].type == ERR_ERRNO) && - (command->expected_errors.err[i].code.errnum == error)) - { - DBUG_PRINT("info", ("command \"%.*s\" failed with expected error: %d", - command->first_word_len, command->query, error)); - DBUG_VOID_RETURN; - } + DBUG_PRINT("info", ("command \"%.*s\" failed with expected error: %d", + command->first_word_len, command->query, error)); + DBUG_VOID_RETURN; } die("command \"%.*s\" failed with wrong error: %d", command->first_word_len, command->query, error); @@ -2452,8 +2453,8 @@ void do_exec(struct st_command *command) error= pclose(res_file); if (error > 0) { - uint status= WEXITSTATUS(error), i; - my_bool ok= 0; + uint status= WEXITSTATUS(error); + int i; if (command->abort_on_error) { @@ -2465,19 +2466,13 @@ void do_exec(struct st_command *command) DBUG_PRINT("info", ("error: %d, status: %d", error, status)); - for (i= 0; i < command->expected_errors.count; i++) - { - DBUG_PRINT("info", ("expected error: %d", - command->expected_errors.err[i].code.errnum)); - if ((command->expected_errors.err[i].type == ERR_ERRNO) && - (command->expected_errors.err[i].code.errnum == status)) - { - ok= 1; - DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d", - command->first_argument, status)); - } - } - if (!ok) + + i= match_expected_error(command, status, NULL); + + if (i >= 0) + DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d", + command->first_argument, status)); + else { dynstr_free(&ds_cmd); die("command \"%s\" failed with wrong error: %d", @@ -4157,7 +4152,6 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host, int port, const char *sock) { int failed_attempts= 0; - static ulong connection_retry_sleep= 100000; /* Microseconds */ DBUG_ENTER("safe_connect"); while(!mysql_real_connect(mysql, host,user, pass, db, port, sock, @@ -4224,6 +4218,7 @@ int connect_n_handle_errors(struct st_command *command, const char* db, int port, const char* sock) { DYNAMIC_STRING *ds; + int failed_attempts= 0; ds= &ds_res; @@ -4252,9 +4247,41 @@ int connect_n_handle_errors(struct st_command *command, dynstr_append_mem(ds, delimiter, delimiter_length); dynstr_append_mem(ds, "\n", 1); } - if (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0, + while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0, CLIENT_MULTI_STATEMENTS)) { + /* + If we have used up all our connections check whether this + is expected (by --error). If so, handle the error right away. + Otherwise, give it some extra time to rule out race-conditions. + If extra-time doesn't help, we have an unexpected error and + must abort -- just proceeding to handle_error() when second + and third chances are used up will handle that for us. + + There are various user-limits of which only max_user_connections + and max_connections_per_hour apply at connect time. For the + the second to create a race in our logic, we'd need a limits + test that runs without a FLUSH for longer than an hour, so we'll + stay clear of trying to work out which exact user-limit was + exceeded. + */ + + if (((mysql_errno(con) == ER_TOO_MANY_USER_CONNECTIONS) || + (mysql_errno(con) == ER_USER_LIMIT_REACHED)) && + (failed_attempts++ < opt_max_connect_retries)) + { + int i; + + i= match_expected_error(command, mysql_errno(con), mysql_sqlstate(con)); + + if (i >= 0) + goto do_handle_error; /* expected error, handle */ + + my_sleep(connection_retry_sleep); /* unexpected error, wait */ + continue; /* and give it 1 more chance */ + } + +do_handle_error: var_set_errno(mysql_errno(con)); handle_error(command, mysql_errno(con), mysql_error(con), mysql_sqlstate(con), ds); @@ -6015,6 +6042,56 @@ end: } +/* + Check whether given error is in list of expected errors + + SYNOPSIS + match_expected_error() + + PARAMETERS + command the current command (and its expect-list) + err_errno error number of the error that actually occurred + err_sqlstate SQL-state that was thrown, or NULL for impossible + (file-ops, diff, etc.) + + RETURNS + -1 for not in list, index in list of expected errors otherwise + + NOTE + If caller needs to know whether the list was empty, they should + check command->expected_errors.count. +*/ + +static int match_expected_error(struct st_command *command, + unsigned int err_errno, + const char *err_sqlstate) +{ + uint i; + + for (i= 0 ; (uint) i < command->expected_errors.count ; i++) + { + if ((command->expected_errors.err[i].type == ERR_ERRNO) && + (command->expected_errors.err[i].code.errnum == err_errno)) + return i; + + if (command->expected_errors.err[i].type == ERR_SQLSTATE) + { + /* + NULL is quite likely, but not in conjunction with a SQL-state expect! + */ + if (unlikely(err_sqlstate == NULL)) + die("expecting a SQL-state (%s) from query '%s' which cannot produce one...", + command->expected_errors.err[i].code.sqlstate, command->query); + + if (strncmp(command->expected_errors.err[i].code.sqlstate, + err_sqlstate, SQLSTATE_LENGTH) == 0) + return i; + } + } + return -1; +} + + /* Handle errors which occurred during execution @@ -6035,7 +6112,7 @@ void handle_error(struct st_command *command, unsigned int err_errno, const char *err_error, const char *err_sqlstate, DYNAMIC_STRING *ds) { - uint i; + int i; DBUG_ENTER("handle_error"); @@ -6061,34 +6138,30 @@ void handle_error(struct st_command *command, DBUG_PRINT("info", ("expected_errors.count: %d", command->expected_errors.count)); - for (i= 0 ; (uint) i < command->expected_errors.count ; i++) + + i= match_expected_error(command, err_errno, err_sqlstate); + + if (i >= 0) { - if (((command->expected_errors.err[i].type == ERR_ERRNO) && - (command->expected_errors.err[i].code.errnum == err_errno)) || - ((command->expected_errors.err[i].type == ERR_SQLSTATE) && - (strncmp(command->expected_errors.err[i].code.sqlstate, - err_sqlstate, SQLSTATE_LENGTH) == 0))) + if (!disable_result_log) { - if (!disable_result_log) + if (command->expected_errors.count == 1) { - if (command->expected_errors.count == 1) - { - /* Only log error if there is one possible error */ - dynstr_append_mem(ds, "ERROR ", 6); - replace_dynstr_append(ds, err_sqlstate); - dynstr_append_mem(ds, ": ", 2); - replace_dynstr_append(ds, err_error); - dynstr_append_mem(ds,"\n",1); - } - /* Don't log error if we may not get an error */ - else if (command->expected_errors.err[0].type == ERR_SQLSTATE || - (command->expected_errors.err[0].type == ERR_ERRNO && - command->expected_errors.err[0].code.errnum != 0)) - dynstr_append(ds,"Got one of the listed errors\n"); + /* Only log error if there is one possible error */ + dynstr_append_mem(ds, "ERROR ", 6); + replace_dynstr_append(ds, err_sqlstate); + dynstr_append_mem(ds, ": ", 2); + replace_dynstr_append(ds, err_error); + dynstr_append_mem(ds,"\n",1); } - /* OK */ - DBUG_VOID_RETURN; + /* Don't log error if we may not get an error */ + else if (command->expected_errors.err[0].type == ERR_SQLSTATE || + (command->expected_errors.err[0].type == ERR_ERRNO && + command->expected_errors.err[0].code.errnum != 0)) + dynstr_append(ds,"Got one of the listed errors\n"); } + /* OK */ + DBUG_VOID_RETURN; } DBUG_PRINT("info",("i: %d expected_errors: %d", i, @@ -6103,7 +6176,7 @@ void handle_error(struct st_command *command, dynstr_append_mem(ds, "\n", 1); } - if (i) + if (command->expected_errors.count > 0) { if (command->expected_errors.err[0].type == ERR_ERRNO) die("query '%s' failed with wrong errno %d: '%s', instead of %d...", diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index adf99185d89..516bab07cf0 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -14,6 +14,7 @@ select otto from (select 1 as otto) as t1; otto 1 mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22... +mysqltest: At line 1: expecting a SQL-state (00000) from query 'remove_file /misc/mysql/forest/23921/51-23921/mysql-test/var/tmp/test_nonexistent.tmp' which cannot produce one... select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22: 'Unknown column 'friedrich' in 'field list'', instead of 00000... diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 5271a8577e0..5c37e8333a7 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -11,7 +11,6 @@ ############################################################################## federated_transactions : Bug#29523 Transactions do not work csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables -user_limits : Bug#23921 random failure of user_limits.test thread_cache_size_func : Bug#36733 main.thread_cache_size_func fails randomly binlog_cache_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms bulk_insert_buffer_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index b41f033d2af..d85259e2a49 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -91,6 +91,8 @@ select otto from (select 1 as otto) as t1; --error 1 --exec echo "error S42S22; select otto from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "error S00000; remove_file $MYSQLTEST_VARDIR/tmp/test_nonexistent.tmp;" | $MYSQL_TEST 2>&1 # ---------------------------------------------------------------------------- From 2f207e4a34b2ee851888304387faca13b5578d32 Mon Sep 17 00:00:00 2001 From: Gleb Shchepa Date: Tue, 15 Jul 2008 17:12:08 +0500 Subject: [PATCH 091/352] after-push patch: partial rollback of bug #37761 fix. Note: item->null_value is not updated before a call to item->store(), item->is_null() is not too (in common case). --- sql/item_cmpfunc.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 2db77eb7c56..28e55eef5bd 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3758,8 +3758,6 @@ longlong Item_func_in::val_int() return (longlong) (!null_value && tmp != negated); } - if ((null_value= args[0]->null_value)) - return 0; have_null= 0; for (uint i= 1 ; i < arg_count ; i++) { @@ -3769,6 +3767,8 @@ longlong Item_func_in::val_int() if (!(value_added_map & (1 << (uint)cmp_type))) { in_item->store_value(args[0]); + if ((null_value= args[0]->null_value)) + return 0; value_added_map|= 1 << (uint)cmp_type; } if (!in_item->cmp(args[i]) && !args[i]->null_value) From 2951f00be4c2e332686ca713f77dab39615ea083 Mon Sep 17 00:00:00 2001 From: Sergey Petrunia Date: Tue, 15 Jul 2008 18:13:21 +0400 Subject: [PATCH 092/352] BUG#35478: sort_union() returns bad data when sort_buffer_size is hit - In QUICK_INDEX_MERGE_SELECT::read_keys_and_merge: when we got table->sort from Unique, tell init_read_record() not to use rr_from_cache() because a) rowids are already sorted and b) it might be that the the data is used by filesort(), which will need record rowids (which rr_from_cache() cannot provide). - Fully de-initialize the table->sort read in QUICK_INDEX_MERGE_SELECT::get_next(). This fixes BUG#35477. (bk trigger: file as fix for BUG#35478). --- sql/filesort.cc | 66 +++++++++++++++++++++++++++++++++++++---------- sql/mysql_priv.h | 4 +-- sql/opt_range.cc | 15 +++++++---- sql/records.cc | 43 +++++++++++++++++++++++++++--- sql/sql_acl.cc | 7 ++--- sql/sql_delete.cc | 4 +-- sql/sql_help.cc | 8 +++--- sql/sql_select.cc | 2 +- sql/sql_table.cc | 2 +- sql/sql_udf.cc | 2 +- sql/sql_update.cc | 4 +-- 11 files changed, 120 insertions(+), 37 deletions(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index 70fc6937b59..f56e5b3a771 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -402,6 +402,56 @@ static byte *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count, DBUG_RETURN(tmp); } +#ifndef DBUG_OFF +/* + Print a text, SQL-like record representation into dbug trace. + + Note: this function is a work in progress: at the moment + - column read bitmap is ignored (can print garbage for unused columns) + - there is no quoting +*/ +static void dbug_print_record(TABLE *table, bool print_rowid) +{ + char buff[1024]; + Field **pfield; + String tmp(buff,sizeof(buff),&my_charset_bin); + DBUG_LOCK_FILE; + + fprintf(DBUG_FILE, "record ("); + for (pfield= table->field; *pfield ; pfield++) + fprintf(DBUG_FILE, "%s%s", (*pfield)->field_name, (pfield[1])? ", ":""); + fprintf(DBUG_FILE, ") = "); + + fprintf(DBUG_FILE, "("); + for (pfield= table->field; *pfield ; pfield++) + { + Field *field= *pfield; + + if (field->is_null()) + fwrite("NULL", sizeof(char), 4, DBUG_FILE); + + if (field->type() == MYSQL_TYPE_BIT) + (void) field->val_int_as_str(&tmp, 1); + else + field->val_str(&tmp); + + fwrite(tmp.ptr(),sizeof(char),tmp.length(),DBUG_FILE); + if (pfield[1]) + fwrite(", ", sizeof(char), 2, DBUG_FILE); + } + fprintf(DBUG_FILE, ")"); + if (print_rowid) + { + fprintf(DBUG_FILE, " rowid "); + for (uint i=0; i < table->file->ref_length; i++) + { + fprintf(DBUG_FILE, "%x", (uchar)table->file->ref[i]); + } + } + fprintf(DBUG_FILE, "\n"); + DBUG_UNLOCK_FILE; +} +#endif /* Search after sort_keys and write them into tempfile. @@ -475,25 +525,23 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, current_thd->variables.read_buff_size); } - READ_RECORD read_record_info; if (quick_select) { if (select->quick->reset()) DBUG_RETURN(HA_POS_ERROR); - init_read_record(&read_record_info, current_thd, select->quick->head, - select, 1, 1); } for (;;) { if (quick_select) { - if ((error= read_record_info.read_record(&read_record_info))) + if ((error= select->quick->get_next())) { error= HA_ERR_END_OF_FILE; break; } file->position(sort_form->record[0]); + DBUG_EXECUTE_IF("debug_filesort", dbug_print_record(sort_form, TRUE);); } else /* Not quick-select */ { @@ -550,15 +598,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, if (thd->net.report_error) break; } - if (quick_select) - { - /* - index_merge quick select uses table->sort when retrieving rows, so free - resoures it has allocated. - */ - end_read_record(&read_record_info); - } - else + if (!quick_select) { (void) file->extra(HA_EXTRA_NO_CACHE); /* End cacheing of records */ if (!next_pos) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 607c06f55d2..029977c89b9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1557,8 +1557,8 @@ ulonglong get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg, int test_if_number(char *str,int *res,bool allow_wildcards); void change_byte(byte *,uint,char,char); void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form, - SQL_SELECT *select, - int use_record_cache, bool print_errors); + SQL_SELECT *select, int use_record_cache, + bool print_errors, bool disable_rr_cache); void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, bool print_error, uint idx); void end_read_record(READ_RECORD *info); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 17a4701b515..95cda371673 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -6494,7 +6494,7 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge() QUICK_RANGE_SELECT* cur_quick; int result; Unique *unique; - DBUG_ENTER("QUICK_INDEX_MERGE_SELECT::prepare_unique"); + DBUG_ENTER("QUICK_INDEX_MERGE_SELECT::read_keys_and_merge"); /* We're going to just read rowids. */ if (head->file->extra(HA_EXTRA_KEYREAD)) @@ -6565,13 +6565,17 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge() } - /* ok, all row ids are in Unique */ + /* + Ok all rowids are in the Unique now. The next call will initialize + head->sort structure so it can be used to iterate through the rowids + sequence. + */ result= unique->get(head); delete unique; doing_pk_scan= FALSE; - /* start table scan */ - init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1, 1); - /* index_merge currently doesn't support "using index" at all */ + + /* Start the rnd_pos() scan. */ + init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1 , 1, TRUE); head->file->extra(HA_EXTRA_NO_KEYREAD); DBUG_RETURN(result); @@ -6601,6 +6605,7 @@ int QUICK_INDEX_MERGE_SELECT::get_next() { result= HA_ERR_END_OF_FILE; end_read_record(&read_record); + free_io_cache(head); /* All rows from Unique have been retrieved, do a clustered PK scan */ if (pk_quick_select) { diff --git a/sql/records.cc b/sql/records.cc index f61efc13034..d5c3a421cd9 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -72,11 +72,47 @@ void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table, } -/* init struct for read with info->read_record */ +/* + init struct for read with info->read_record + + SYNOPSIS + init_read_record() + info OUT read structure + thd Thread handle + table Table the data [originally] comes from. + select SQL_SELECT structure. We may select->quick or + select->file as data source + use_record_cache Call file->extra_opt(HA_EXTRA_CACHE,...) + if we're going to do sequential read and some + additional conditions are satisfied. + print_error Copy this to info->print_error + disable_rr_cache Don't use rr_from_cache (used by sort-union + index-merge which produces rowid sequences that + are already ordered) + + DESCRIPTION + This function sets up reading data via one of the methods: + + rr_unpack_from_tempfile Unpack full records from sequential file + rr_unpack_from_buffer ... or from buffer + + rr_from_tempfile Read rowids from tempfile and get full records + with handler->rnd_pos() calls. + rr_from_pointers ... or get rowids from buffer + + rr_from_cache Read a bunch of rowids from file, sort them, + get records in rowid order, return, repeat. + + rr_quick Get data from QUICK_*_SELECT + + rr_sequential Sequentially scan the table using + handler->rnd_next() calls +*/ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, SQL_SELECT *select, - int use_record_cache, bool print_error) + int use_record_cache, bool print_error, + bool disable_rr_cache) { IO_CACHE *tempfile; DBUG_ENTER("init_read_record"); @@ -121,7 +157,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, it doesn't make sense to use cache - we don't read from the table and table->sort.io_cache is read sequentially */ - if (!table->sort.addon_field && + if (!disable_rr_cache && + !table->sort.addon_field && ! (specialflag & SPECIAL_SAFE_MODE) && thd->variables.read_rnd_buff_size && !(table->file->table_flags() & HA_FAST_KEY_READ) && diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7592986ef81..e12fbb9843a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -205,7 +205,8 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) acl_cache->clear(1); // Clear locked hostname cache init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0); - init_read_record(&read_record_info,thd,table= tables[0].table,NULL,1,0); + init_read_record(&read_record_info,thd,table= tables[0].table,NULL,1,0, + FALSE); VOID(my_init_dynamic_array(&acl_hosts,sizeof(ACL_HOST),20,50)); while (!(read_record_info.read_record(&read_record_info))) { @@ -253,7 +254,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) end_read_record(&read_record_info); freeze_size(&acl_hosts); - init_read_record(&read_record_info,thd,table=tables[1].table,NULL,1,0); + init_read_record(&read_record_info,thd,table=tables[1].table,NULL,1,0,FALSE); VOID(my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100)); password_length= table->field[2]->field_length / table->field[2]->charset()->mbmaxlen; @@ -426,7 +427,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) end_read_record(&read_record_info); freeze_size(&acl_users); - init_read_record(&read_record_info,thd,table=tables[2].table,NULL,1,0); + init_read_record(&read_record_info,thd,table=tables[2].table,NULL,1,0,FALSE); VOID(my_init_dynamic_array(&acl_dbs,sizeof(ACL_DB),50,100)); while (!(read_record_info.read_record(&read_record_info))) { diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 213da1d49e8..38f89683065 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -214,7 +214,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, DBUG_RETURN(TRUE); } if (usable_index==MAX_KEY) - init_read_record(&info,thd,table,select,1,1); + init_read_record(&info, thd, table, select, 1, 1, FALSE); else init_read_record_idx(&info, thd, table, 1, usable_index); @@ -772,7 +772,7 @@ int multi_delete::do_deletes() } READ_RECORD info; - init_read_record(&info,thd,table,NULL,0,1); + init_read_record(&info, thd, table, NULL, 0, 1, FALSE); /* Ignore any rows not found in reference tables as they may already have been deleted by foreign key handling diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 69a257a9d37..6036a687274 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -181,7 +181,7 @@ int search_topics(THD *thd, TABLE *topics, struct st_find_field *find_fields, int count= 0; READ_RECORD read_record_info; - init_read_record(&read_record_info, thd, topics, select,1,0); + init_read_record(&read_record_info, thd, topics, select, 1, 0, FALSE); while (!read_record_info.read_record(&read_record_info)) { if (!select->cond->val_int()) // Doesn't match like @@ -221,7 +221,7 @@ int search_keyword(THD *thd, TABLE *keywords, struct st_find_field *find_fields, int count= 0; READ_RECORD read_record_info; - init_read_record(&read_record_info, thd, keywords, select,1,0); + init_read_record(&read_record_info, thd, keywords, select, 1, 0, FALSE); while (!read_record_info.read_record(&read_record_info) && count<2) { if (!select->cond->val_int()) // Dosn't match like @@ -346,7 +346,7 @@ int search_categories(THD *thd, TABLE *categories, DBUG_ENTER("search_categories"); - init_read_record(&read_record_info, thd, categories, select,1,0); + init_read_record(&read_record_info, thd, categories, select,1,0,FALSE); while (!read_record_info.read_record(&read_record_info)) { if (select && !select->cond->val_int()) @@ -380,7 +380,7 @@ void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname, DBUG_ENTER("get_all_items_for_category"); READ_RECORD read_record_info; - init_read_record(&read_record_info, thd, items, select,1,0); + init_read_record(&read_record_info, thd, items, select,1,0,FALSE); while (!read_record_info.read_record(&read_record_info)) { if (!select->cond->val_int()) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d1e5837329b..60ba7591726 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11309,7 +11309,7 @@ join_init_read_record(JOIN_TAB *tab) if (tab->select && tab->select->quick && tab->select->quick->reset()) return 1; init_read_record(&tab->read_record, tab->join->thd, tab->table, - tab->select,1,1); + tab->select,1,1, FALSE); return (*tab->read_record.read_record)(&tab->read_record); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f1de63892d5..1724513eb8f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4177,7 +4177,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, current query id */ from->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); - init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1,1); + init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1, 1, FALSE); if (ignore) to->file->extra(HA_EXTRA_IGNORE_DUP_KEY); thd->row_count= 0; diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 34ca18d5c39..849d152d93b 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -176,7 +176,7 @@ void udf_init() } table= tables.table; - init_read_record(&read_record_info, new_thd, table, NULL,1,0); + init_read_record(&read_record_info, new_thd, table, NULL,1,0,FALSE); while (!(error = read_record_info.read_record(&read_record_info))) { DBUG_PRINT("info",("init udf record")); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 6830564111b..7d47659fbcc 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -358,7 +358,7 @@ int mysql_update(THD *thd, Full index scan must be started with init_read_record_idx */ if (used_index == MAX_KEY || (select && select->quick)) - init_read_record(&info,thd,table,select,0,1); + init_read_record(&info, thd, table, select, 0, 1, FALSE); else init_read_record_idx(&info, thd, table, 1, used_index); @@ -422,7 +422,7 @@ int mysql_update(THD *thd, if (select && select->quick && select->quick->reset()) goto err; - init_read_record(&info,thd,table,select,0,1); + init_read_record(&info, thd, table, select, 0, 1, FALSE); updated= found= 0; thd->count_cuted_fields= CHECK_FIELD_WARN; /* calc cuted fields */ From 7077d5aa3c2f836ebf978e4ecb6f653c76ce8627 Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Tue, 15 Jul 2008 18:43:25 +0200 Subject: [PATCH 093/352] test case fix --- mysql-test/mysql-test-run.pl | 5 +++-- mysql-test/t/system_mysql_db_fix50030.test | 7 +++++++ mysql-test/t/system_mysql_db_fix50117.test | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index eb59fd94f0f..75ee33e97c5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -251,7 +251,7 @@ our $opt_sleep; our $opt_testcase_timeout; our $opt_suite_timeout; my $default_testcase_timeout= 15; # 15 min max -my $default_suite_timeout= 180; # 3 hours max +my $default_suite_timeout= 300; # 5 hours max our $opt_start_and_exit; our $opt_start_dirty; @@ -1684,7 +1684,8 @@ sub executable_setup () { # Look for mysql_fix_privilege_tables.sql script $file_mysql_fix_privilege_tables= mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql", - "$glob_basedir/share/mysql_fix_privilege_tables.sql"); + "$glob_basedir/share/mysql_fix_privilege_tables.sql", + "$glob_basedir/share/mysql/mysql_fix_privilege_tables.sql"); if ( ! $opt_skip_ndbcluster and executable_setup_ndb()) { diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test index b4e0ed65242..80365cfdff4 100644 --- a/mysql-test/t/system_mysql_db_fix50030.test +++ b/mysql-test/t/system_mysql_db_fix50030.test @@ -1,6 +1,13 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +{ + skip Test needs MYSQL_FIX_PRIVILEGE_TABLES; +} + # # This is the test for mysql_fix_privilege_tables # It checks that a system tables from mysql 5.0.30 diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test index ea379757f26..1eed4d671ef 100644 --- a/mysql-test/t/system_mysql_db_fix50117.test +++ b/mysql-test/t/system_mysql_db_fix50117.test @@ -1,6 +1,13 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +{ + skip Test needs MYSQL_FIX_PRIVILEGE_TABLES; +} + # # This is the test for mysql_fix_privilege_tables # It checks that a system tables from mysql 5.1.17 From 59ab9a0872ab5e91cc85da55ee610a6d6f6bcf0c Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 16 Jul 2008 12:31:50 +0300 Subject: [PATCH 094/352] Bug#37830 : ORDER BY ASC/DESC - no difference Range scan in descending order for c <= <= c type of ranges was ignoring the DESC flag. However some engines like InnoDB have the primary key parts as a suffix for every secondary key. When such primary key suffix is used for ordering ignoring the DESC is not valid. But we generally would like to do this because it's faster. Fixed by performing only reverse scan if the primary key is used. Removed some dead code in the process. --- mysql-test/r/innodb_mysql.result | 15 ++++++++ mysql-test/t/innodb_mysql.test | 18 +++++++++ sql/opt_range.cc | 66 ++++++-------------------------- sql/opt_range.h | 4 +- sql/sql_select.cc | 59 +++++++++++++++++----------- 5 files changed, 83 insertions(+), 79 deletions(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index b487cfd9a4b..47fa331c9ab 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1246,4 +1246,19 @@ set global innodb_autoextend_increment=@my_innodb_autoextend_increment; set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; +CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) +ENGINE=InnoDB; +INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); +INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; +EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range t1_b t1_b 5 NULL 4 Using where +SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; +a b c +8 1 1 +7 1 1 +6 1 1 +5 1 1 +4 1 1 +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 59ee7c274bb..e15d1aee08a 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -996,4 +996,22 @@ set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; +# +# Bug #37830: ORDER BY ASC/DESC - no difference +# + +CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) + ENGINE=InnoDB; + +INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); +INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; + +# should be range access +EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; + +# should produce '8 7 6 5 4' for a +SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; + +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 17a4701b515..adc5f1eb9c7 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7094,7 +7094,8 @@ bool QUICK_RANGE_SELECT::row_in_ranges() QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint used_key_parts_arg) - : QUICK_RANGE_SELECT(*q), rev_it(rev_ranges) + : QUICK_RANGE_SELECT(*q), rev_it(rev_ranges), + used_key_parts (used_key_parts_arg) { QUICK_RANGE *r; @@ -7136,10 +7137,11 @@ int QUICK_SELECT_DESC::get_next() int result; if (last_range) { // Already read through key - result = ((last_range->flag & EQ_RANGE) - ? file->index_next_same(record, (byte*) last_range->min_key, - last_range->min_length) : - file->index_prev(record)); + result = ((last_range->flag & EQ_RANGE && + used_key_parts <= head->key_info[index].key_parts) ? + file->index_next_same(record, (byte*) last_range->min_key, + last_range->min_length) : + file->index_prev(record)); if (!result) { if (cmp_prev(*rev_it.ref()) == 0) @@ -7163,7 +7165,9 @@ int QUICK_SELECT_DESC::get_next() continue; } - if (last_range->flag & EQ_RANGE) + if (last_range->flag & EQ_RANGE && + used_key_parts <= head->key_info[index].key_parts) + { result= file->index_read(record, (byte*) last_range->max_key, last_range->max_length, HA_READ_KEY_EXACT); @@ -7171,6 +7175,8 @@ int QUICK_SELECT_DESC::get_next() else { DBUG_ASSERT(last_range->flag & NEAR_MAX || + (last_range->flag & EQ_RANGE && + used_key_parts > head->key_info[index].key_parts) || range_reads_after_key(last_range)); result=file->index_read(record, (byte*) last_range->max_key, last_range->max_length, @@ -7268,54 +7274,6 @@ bool QUICK_SELECT_DESC::range_reads_after_key(QUICK_RANGE *range_arg) } -/* TRUE if we are reading over a key that may have a NULL value */ - -#ifdef NOT_USED -bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg, - uint used_key_parts) -{ - uint offset, end; - KEY_PART *key_part = key_parts, - *key_part_end= key_part+used_key_parts; - - for (offset= 0, end = min(range_arg->min_length, range_arg->max_length) ; - offset < end && key_part != key_part_end ; - offset+= key_part++->store_length) - { - if (!memcmp((char*) range_arg->min_key+offset, - (char*) range_arg->max_key+offset, - key_part->store_length)) - continue; - - if (key_part->null_bit && range_arg->min_key[offset]) - return 1; // min_key is null and max_key isn't - // Range doesn't cover NULL. This is ok if there is no more null parts - break; - } - /* - If the next min_range is > NULL, then we can use this, even if - it's a NULL key - Example: SELECT * FROM t1 WHERE a = 2 AND b >0 ORDER BY a DESC,b DESC; - - */ - if (key_part != key_part_end && key_part->null_bit) - { - if (offset >= range_arg->min_length || range_arg->min_key[offset]) - return 1; // Could be null - key_part++; - } - /* - If any of the key parts used in the ORDER BY could be NULL, we can't - use the key to sort the data. - */ - for (; key_part != key_part_end ; key_part++) - if (key_part->null_bit) - return 1; // Covers null part - return 0; -} -#endif - - void QUICK_RANGE_SELECT::add_info_string(String *str) { KEY *key_info= head->key_info + index; diff --git a/sql/opt_range.h b/sql/opt_range.h index 3a737323eb7..8856223b371 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -667,12 +667,10 @@ public: int get_type() { return QS_TYPE_RANGE_DESC; } private: bool range_reads_after_key(QUICK_RANGE *range); -#ifdef NOT_USED - bool test_if_null_range(QUICK_RANGE *range, uint used_key_parts); -#endif int reset(void) { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); } List rev_ranges; List_iterator rev_it; + uint used_key_parts; }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d1e5837329b..d3396de7afe 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -12088,26 +12088,25 @@ part_of_refkey(TABLE *table,Field *field) } -/***************************************************************************** - Test if one can use the key to resolve ORDER BY +/** + Test if a key can be used to resolve ORDER BY - SYNOPSIS - test_if_order_by_key() - order Sort order - table Table to sort - idx Index to check - used_key_parts Return value for used key parts. + used_key_parts is set to correct key parts used if return value != 0 + (On other cases, used_key_part may be changed). + Note that the value may actually be greater than the number of index + key parts. This can happen for storage engines that have the primary + key parts as a suffix for every secondary key. + @param order Sort order + @param table Table to sort + @param idx Index to check + @param[out] used_key_parts Return value for used key parts. - NOTES - used_key_parts is set to correct key parts used if return value != 0 - (On other cases, used_key_part may be changed) - - RETURN - 1 key is ok. - 0 Key can't be used - -1 Reverse key can be used -*****************************************************************************/ + @return indication if the key can be used for sorting + @retval 1 key can be used for reading data in order. + @retval 0 Key can't be used + @retval -1 Reverse read on the key can be used +*/ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, uint *used_key_parts) @@ -12172,11 +12171,27 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, reverse=flag; // Remember if reverse key_part++; } - *used_key_parts= on_primary_key ? table->key_info[idx].key_parts : - (uint) (key_part - table->key_info[idx].key_part); - if (reverse == -1 && !(table->file->index_flags(idx, *used_key_parts-1, 1) & - HA_READ_PREV)) - reverse= 0; // Index can't be used + if (on_primary_key) + { + uint used_key_parts_secondary= table->key_info[idx].key_parts; + uint used_key_parts_pk= + (uint) (key_part - table->key_info[table->s->primary_key].key_part); + *used_key_parts= used_key_parts_pk + used_key_parts_secondary; + + if (reverse == -1 && + (!(table->file->index_flags(idx, used_key_parts_secondary - 1, 1) & + HA_READ_PREV) || + !(table->file->index_flags(table->s->primary_key, + used_key_parts_pk - 1, 1) & HA_READ_PREV))) + reverse= 0; // Index can't be used + } + else + { + *used_key_parts= (uint) (key_part - table->key_info[idx].key_part); + if (reverse == -1 && + !(table->file->index_flags(idx, *used_key_parts-1, 1) & HA_READ_PREV)) + reverse= 0; // Index can't be used + } DBUG_RETURN(reverse); } From b8579849f32f149cfc7885d06a1272bd832b6389 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 16 Jul 2008 16:29:22 -0600 Subject: [PATCH 095/352] Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning Reverting the previous patch --- mysql-test/r/query_cache.result | 8 ++++---- sql/set_var.cc | 7 ++++++- sql/share/errmsg.txt | 14 +++++++------- sql/sql_cache.cc | 29 ----------------------------- sql/sql_cache.h | 2 -- 5 files changed, 17 insertions(+), 43 deletions(-) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index c40e75fc29b..fa80a44c177 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -564,7 +564,7 @@ select * from t1; a set GLOBAL query_cache_size=1024; Warnings: -Warning 1282 Query cache failed to set size 1024 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 1024; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -572,7 +572,7 @@ select * from t1; a set GLOBAL query_cache_size=10240; Warnings: -Warning 1282 Query cache failed to set size 10240 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 10240; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -580,7 +580,7 @@ select * from t1; a set GLOBAL query_cache_size=20480; Warnings: -Warning 1282 Query cache failed to set size 20480 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 20480; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -588,7 +588,7 @@ select * from t1; a set GLOBAL query_cache_size=40960; Warnings: -Warning 1282 Query cache failed to set size 40960 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 40960; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 diff --git a/sql/set_var.cc b/sql/set_var.cc index fd9beff35b7..84766e511ca 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1342,7 +1342,12 @@ static void fix_net_retry_count(THD *thd __attribute__((unused)), static void fix_query_cache_size(THD *thd, enum_var_type type) { #ifdef HAVE_QUERY_CACHE - query_cache_size= query_cache.resize(query_cache_size); + ulong requested= query_cache_size; + query_cache.resize(query_cache_size); + if (requested != query_cache_size) + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), + requested, query_cache_size); #endif } diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 0cb6672732c..7d345d633c6 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -4992,13 +4992,13 @@ ER_WRONG_NAME_FOR_CATALOG 42000 spa "Nombre de catalog incorrecto '%-.100s'" swe "Felaktigt katalog namn '%-.100s'" ER_WARN_QC_RESIZE - eng "Query cache failed to set size %lu (minimal value: %lu); new query cache size is %lu" - ger "Änderung der Query-Cache-Größe auf %lu (Minimale Zahl: %lu) fehlgeschlagen; neue Query-Cache-Größe ist %lu" - por "Falha em Query cache para configurar tamanho %lu (Número mínimo: %lu), novo tamanho de query cache é %lu" - rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu (minimal value: %lu), ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" - spa "Query cache fallada para configurar tamaño %lu (Número mínimo: %lu), nuevo tamaño de query cache es %lu" - swe "Storleken av "Query cache" kunde inte sättas till %lu (minsta värde: %lu); ny storlek är %lu" - ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu (minimal value: %lu), ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" + eng "Query cache failed to set size %lu; new query cache size is %lu" + ger "Änderung der Query-Cache-Größe auf %lu fehlgeschlagen; neue Query-Cache-Größe ist %lu" + por "Falha em Query cache para configurar tamanho %lu, novo tamanho de query cache é %lu" + rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu, ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" + spa "Query cache fallada para configurar tamaño %lu, nuevo tamaño de query cache es %lu" + swe "Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu" + ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu, ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" ER_BAD_FT_COLUMN eng "Column '%-.64s' cannot be part of FULLTEXT index" ger "Feld '%-.64s' kann nicht Teil eines FULLTEXT-Index sein" diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index cce5123aef3..f8906a17c12 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -816,16 +816,6 @@ ulong Query_cache::resize(ulong query_cache_size_arg) free_cache(); query_cache_size= query_cache_size_arg; ::query_cache_size= init_cache(); - - if (::query_cache_size != query_cache_size_arg) - { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), - query_cache_size_arg, - get_minimal_size_limit(), - ::query_cache_size); - } - STRUCT_UNLOCK(&structure_guard_mutex); DBUG_RETURN(::query_cache_size); } @@ -1624,25 +1614,6 @@ void Query_cache::init() } -/** - Return the lowest possible query cache size. -*/ - -ulong Query_cache::get_minimal_size_limit() -{ - ulong approx_additional_data_size= (sizeof(Query_cache) + - sizeof(gptr)*(def_query_hash_size+ - def_table_hash_size)); - - ulong data_size= (min_allocation_unit << QUERY_CACHE_MEM_BIN_STEP_PWR2 << - QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) + - ALIGN_SIZE(1) - 1 + - (1 << QUERY_CACHE_MEM_BIN_STEP_PWR2) - 1 + - (1 << QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) - 1; - - return(data_size + approx_additional_data_size); -} - ulong Query_cache::init_cache() { uint mem_bin_count, num, step; diff --git a/sql/sql_cache.h b/sql/sql_cache.h index c5d89780af3..34fc3a5c8d5 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -245,8 +245,6 @@ private: void free_query_internal(Query_cache_block *point); - ulong get_minimal_size_limit(); - protected: /* The following mutex is locked when searching or changing global From 72209ac093f4b24767fd31e56e80126a88c376fa Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Wed, 16 Jul 2008 16:58:45 -0600 Subject: [PATCH 096/352] Bug #38180 options are read from ~/my.cnf instead of ~/.my.cnf Pull out some of unpack_dirname() into normalize_dirname(); this new function does not expand "~" to the home directory. Use this function in unpack_dirname(), and use it during init_default_directories() to remove duplicate entries without losing track of which directory is a user's home dir. --- include/my_sys.h | 1 + mysys/default.c | 3 +- mysys/mf_pack.c | 79 +++++++++++++++++++++++++++++++++--------------- 3 files changed, 57 insertions(+), 26 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index d656326e968..db01223602d 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -681,6 +681,7 @@ extern my_string fn_format(my_string to,const char *name,const char *dir, const char *form, uint flag); extern size_s strlength(const char *str); extern void pack_dirname(my_string to,const char *from); +extern uint normalize_dirname(char * to, const char *from); extern uint unpack_dirname(my_string to,const char *from); extern uint cleanup_dirname(my_string to,const char *from); extern uint system_filename(my_string to,const char *from); diff --git a/mysys/default.c b/mysys/default.c index b7eb963e395..b709b33e2f8 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -965,8 +965,7 @@ static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) char *p; my_bool err __attribute__((unused)); - /* Normalize directory name */ - len= unpack_dirname(buf, dir); + len= normalize_dirname(buf, dir); if (!(p= strmake_root(alloc, buf, len))) return 1; /* Failure */ /* Should never fail if DEFAULT_DIRS_SIZE is correct size */ diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index 9e8b6516f63..915c11ec51d 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -266,22 +266,64 @@ void symdirget(char *dir) #endif /* USE_SYMDIR */ -/* - Fixes a directroy name so that can be used by open() +/** + Convert a directory name to a format which can be compared as strings - SYNOPSIS - unpack_dirname() - to result-buffer, FN_REFLEN characters. may be == from - from 'Packed' directory name (may contain ~) + @param to result buffer, FN_REFLEN chars in length; may be == from + @param from 'packed' directory name, in whatever format + @returns size of the normalized name - IMPLEMENTATION - Make that last char of to is '/' if from not empty and - from doesn't end in FN_DEVCHAR - Uses cleanup_dirname and changes ~/.. to home_dir/.. + @details + - Ensures that last char is FN_LIBCHAR, unless it is FN_DEVCHAR + - Uses cleanup_dirname - Changes a UNIX filename to system filename (replaces / with \ on windows) + It does *not* expand ~/ (although, see cleanup_dirname). Nor does it do + any case folding. All case-insensitive normalization should be done by + the caller. +*/ - RETURN +uint normalize_dirname(char *to, const char *from) +{ + uint length; + char buff[FN_REFLEN]; + DBUG_ENTER("normalize_dirname"); + + /* + Despite the name, this actually converts the name to the system's + format (TODO: rip out the non-working VMS stuff and name this + properly). + */ + (void) intern_filename(buff, from); + length= (uint) strlen(buff); /* Fix that '/' is last */ + if (length && +#ifdef FN_DEVCHAR + buff[length - 1] != FN_DEVCHAR && +#endif + buff[length - 1] != FN_LIBCHAR && buff[length - 1] != '/') + { + buff[length]= FN_LIBCHAR; + buff[length + 1]= '\0'; + } + + length=cleanup_dirname(to, buff); + + DBUG_RETURN(length); +} + + +/** + Fixes a directory name so that can be used by open() + + @param to Result buffer, FN_REFLEN characters. May be == from + @param from 'Packed' directory name (may contain ~) + + @details + - Uses normalize_dirname() + - Expands ~/... to home_dir/... + - Resolves MySQL's fake "foo.sym" symbolic directory names (if USE_SYMDIR) + - Changes a UNIX filename to system filename (replaces / with \ on windows) + + @returns Length of new directory name (= length of to) */ @@ -291,19 +333,8 @@ uint unpack_dirname(my_string to, const char *from) char buff[FN_REFLEN+1+4],*suffix,*tilde_expansion; DBUG_ENTER("unpack_dirname"); - (void) intern_filename(buff,from); /* Change to intern name */ - length= (uint) strlen(buff); /* Fix that '/' is last */ - if (length && -#ifdef FN_DEVCHAR - buff[length-1] != FN_DEVCHAR && -#endif - buff[length-1] != FN_LIBCHAR && buff[length-1] != '/') - { - buff[length]=FN_LIBCHAR; - buff[length+1]= '\0'; - } + length= normalize_dirname(buff, from); - length=cleanup_dirname(buff,buff); if (buff[0] == FN_HOMELIB) { suffix=buff+1; tilde_expansion=expand_tilde(&suffix); From ee56895067baf67a5f5dc659ea554f55f9351de1 Mon Sep 17 00:00:00 2001 From: "kent.boortz@sun.com" <> Date: Thu, 17 Jul 2008 01:33:45 +0200 Subject: [PATCH 097/352] Set version to 5.0.66a --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 247a17da940..a1dc9d36d82 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.66) +AM_INIT_AUTOMAKE(mysql, 5.0.66a) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From f4c138cc5ef7dc4f148e556920dee5fcc84f8b41 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Thu, 17 Jul 2008 10:43:02 +0200 Subject: [PATCH 098/352] Null merge. From c3c4c6b54cd2b22f222325f9969672f0b49411b9 Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Thu, 17 Jul 2008 11:03:17 +0200 Subject: [PATCH 099/352] Fix for bug#38164. Removed test of values larger than max int for 32 bits. --- .../include/query_prealloc_size_basic.inc | 118 ++++++++++-------- .../r/query_prealloc_size_basic_32.result | 32 ++--- .../r/query_prealloc_size_basic_64.result | 30 ++--- 3 files changed, 81 insertions(+), 99 deletions(-) diff --git a/mysql-test/include/query_prealloc_size_basic.inc b/mysql-test/include/query_prealloc_size_basic.inc index 1793d1874af..ac005b696fa 100644 --- a/mysql-test/include/query_prealloc_size_basic.inc +++ b/mysql-test/include/query_prealloc_size_basic.inc @@ -1,32 +1,35 @@ -############## mysql-test\t\query_prealloc_size_basic.test ############### -# # -# Variable Name: query_prealloc_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 8192 # -# Range: 8192-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable query_prealloc_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### +################# mysql-test\t\query_prealloc_size_basic.test ################## +# # +# Variable Name: query_prealloc_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 8192 # +# Range: 8192-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +# Description: Test Cases of Dynamic System Variable query_prealloc_size # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: # +# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # +# # +# Last Modification: # +# 2008-07-14 hhunger removed values for 64 bit platforms. # +# # +################################################################################ --source include/load_sysvars.inc ######################################################################## -# START OF query_prealloc_size TESTS # +# START OF query_prealloc_size TESTS # ######################################################################## @@ -42,7 +45,7 @@ SELECT @start_session_value; --echo '#--------------------FN_DYNVARS_005_01-------------------------#' ######################################################################## -# Display the DEFAULT value of myisam_block_size # +# Display the DEFAULT value of myisam_block_size # ######################################################################## SET @@global.query_prealloc_size = 100; @@ -56,7 +59,7 @@ SELECT @@session.query_prealloc_size ; --echo '#--------------------FN_DYNVARS_005_02-------------------------#' ######################################################################## -# Check the DEFAULT value of query_prealloc_size # +# Check the DEFAULT value of query_prealloc_size # ######################################################################## SET @@global.query_prealloc_size = DEFAULT; @@ -67,30 +70,32 @@ SELECT @@session.query_prealloc_size = 8192; --echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################################## -# Change the value of query_prealloc_size to a valid value for GLOBAL Scope # -################################################################################## +################################################################################ +# Change the value of query_prealloc_size to a valid value for GLOBAL Scope # +################################################################################ SET @@global.query_prealloc_size = 8192; SELECT @@global.query_prealloc_size ; -SET @@global.query_prealloc_size = 4294967295; -SELECT @@global.query_prealloc_size ; +# Due to problems with 64 bit machines having less than 6 GB main memory. +#SET @@global.query_prealloc_size = 4294967295; +#SELECT @@global.query_prealloc_size ; SET @@global.query_prealloc_size = 655354; SELECT @@global.query_prealloc_size ; --echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################################### -# Change the value of query_prealloc_size to a valid value for SESSION Scope # -################################################################################### - +################################################################################## +# Change the value of query_prealloc_size to a valid value for SESSION Scope # +################################################################################## + SET @@session.query_prealloc_size = 8192; SELECT @@session.query_prealloc_size ; -SET @@session.query_prealloc_size = 4294967295; -SELECT @@session.query_prealloc_size ; +# Due to problems with 64 bit machines having less than 6 GB main memory. +#SET @@session.query_prealloc_size = 4294967295; +#SELECT @@session.query_prealloc_size ; SET @@session.query_prealloc_size = 655345; SELECT @@session.query_prealloc_size ; @@ -100,7 +105,7 @@ SELECT @@session.query_prealloc_size ; --echo '#------------------FN_DYNVARS_005_05-----------------------#' #################################################################### -# Change the value of query_prealloc_size to an invalid value # +# Change the value of query_prealloc_size to an invalid value # #################################################################### SET @@global.query_prealloc_size = 0; @@ -109,8 +114,9 @@ SELECT @@global.query_prealloc_size ; SET @@global.query_prealloc_size = -1024; SELECT @@global.query_prealloc_size ; -SET @@global.query_prealloc_size = 429496729533; -SELECT @@global.query_prealloc_size ; +# Due to problems with 64 bit machines having less than 6 GB main memory. +#SET @@global.query_prealloc_size = 429496729533; +#SELECT @@global.query_prealloc_size ; --Error ER_PARSE_ERROR @@ -161,8 +167,8 @@ SELECT @@session.query_prealloc_size ; #################################################################### -SELECT @@global.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +SELECT @@global.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='query_prealloc_size '; --echo '#------------------FN_DYNVARS_005_07-----------------------#' @@ -170,8 +176,8 @@ WHERE VARIABLE_NAME='query_prealloc_size '; # Check if the value in SESSION Table matches value in variable # #################################################################### -SELECT @@session.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES +SELECT @@session.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='query_prealloc_size '; @@ -188,18 +194,19 @@ SELECT @@global.query_prealloc_size ; --echo '#---------------------FN_DYNVARS_001_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### +################################################################################ +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################ SET @@global.query_prealloc_size = 10; SELECT @@query_prealloc_size = @@global.query_prealloc_size ; --echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## +############################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to # +# to the same session variable # +############################################################################## SET @@query_prealloc_size = 100; SELECT @@query_prealloc_size = @@local.query_prealloc_size ; @@ -207,9 +214,9 @@ SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ; --echo '#---------------------FN_DYNVARS_001_11----------------------#' -################################################################################### -# Check if query_prealloc_size can be accessed with and without @@ sign # -################################################################################### +################################################################################ +# Check if query_prealloc_size can be accessed with and without @@ sign # +################################################################################ SET query_prealloc_size = 1; SELECT @@query_prealloc_size ; @@ -235,5 +242,6 @@ SELECT @@session.query_prealloc_size ; ############################################################# -# END OF query_prealloc_size TESTS # +# END OF query_prealloc_size TESTS # ############################################################# + diff --git a/mysql-test/r/query_prealloc_size_basic_32.result b/mysql-test/r/query_prealloc_size_basic_32.result index 176e4fb810a..fe8aba990a7 100644 --- a/mysql-test/r/query_prealloc_size_basic_32.result +++ b/mysql-test/r/query_prealloc_size_basic_32.result @@ -35,10 +35,6 @@ SET @@global.query_prealloc_size = 8192; SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size 8192 -SET @@global.query_prealloc_size = 4294967295; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -4294966272 SET @@global.query_prealloc_size = 655354; SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size @@ -48,10 +44,6 @@ SET @@session.query_prealloc_size = 8192; SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size 8192 -SET @@session.query_prealloc_size = 4294967295; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -4294966272 SET @@session.query_prealloc_size = 655345; SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size @@ -69,37 +61,31 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '0' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size 8192 -SET @@global.query_prealloc_size = 429496729533; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '429496729533' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -4294966272 SET @@global.query_prealloc_size = 65530.34.; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -4294966272 +8192 SET @@global.query_prealloc_size = test; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -4294966272 +8192 SET @@global.query_prealloc_size = "test"; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -4294966272 +8192 SET @@global.query_prealloc_size = 'test'; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -4294966272 +8192 SET @@global.query_prealloc_size = ON; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -4294966272 +8192 SET @@session.query_prealloc_size = 0; Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '0' @@ -128,14 +114,14 @@ SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size 8192 '#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +SELECT @@global.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='query_prealloc_size '; @@global.query_prealloc_size = VARIABLE_VALUE 1 '#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES +SELECT @@session.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='query_prealloc_size '; @@session.query_prealloc_size = VARIABLE_VALUE 1 diff --git a/mysql-test/r/query_prealloc_size_basic_64.result b/mysql-test/r/query_prealloc_size_basic_64.result index 1c4f5885676..fe8aba990a7 100644 --- a/mysql-test/r/query_prealloc_size_basic_64.result +++ b/mysql-test/r/query_prealloc_size_basic_64.result @@ -35,10 +35,6 @@ SET @@global.query_prealloc_size = 8192; SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size 8192 -SET @@global.query_prealloc_size = 4294967295; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -4294966272 SET @@global.query_prealloc_size = 655354; SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size @@ -48,10 +44,6 @@ SET @@session.query_prealloc_size = 8192; SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size 8192 -SET @@session.query_prealloc_size = 4294967295; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -4294966272 SET @@session.query_prealloc_size = 655345; SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size @@ -69,35 +61,31 @@ Warning 1292 Truncated incorrect query_prealloc_size value: '0' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size 8192 -SET @@global.query_prealloc_size = 429496729533; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -429496728576 SET @@global.query_prealloc_size = 65530.34.; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -429496728576 +8192 SET @@global.query_prealloc_size = test; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -429496728576 +8192 SET @@global.query_prealloc_size = "test"; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -429496728576 +8192 SET @@global.query_prealloc_size = 'test'; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -429496728576 +8192 SET @@global.query_prealloc_size = ON; ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' SELECT @@global.query_prealloc_size ; @@global.query_prealloc_size -429496728576 +8192 SET @@session.query_prealloc_size = 0; Warnings: Warning 1292 Truncated incorrect query_prealloc_size value: '0' @@ -126,14 +114,14 @@ SELECT @@session.query_prealloc_size ; @@session.query_prealloc_size 8192 '#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +SELECT @@global.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='query_prealloc_size '; @@global.query_prealloc_size = VARIABLE_VALUE 1 '#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES +SELECT @@session.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='query_prealloc_size '; @@session.query_prealloc_size = VARIABLE_VALUE 1 From e84c8815fa22f9f1542fc5e7f76e130a53fcdb1f Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Thu, 17 Jul 2008 11:31:22 +0200 Subject: [PATCH 100/352] Reverting patch for bug30087 --- mysql-test/r/query_cache.result | 8 ++++---- sql/set_var.cc | 14 ++++++++++++- sql/share/errmsg.txt | 14 ++++++------- sql/sql_cache.cc | 35 +++++---------------------------- sql/sql_cache.h | 2 -- 5 files changed, 29 insertions(+), 44 deletions(-) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index d44a9cd95b1..34c86d6c8c6 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -566,7 +566,7 @@ select * from t1; a set GLOBAL query_cache_size=1024; Warnings: -Warning 1282 Query cache failed to set size 1024 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 1024; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -574,7 +574,7 @@ select * from t1; a set GLOBAL query_cache_size=10240; Warnings: -Warning 1282 Query cache failed to set size 10240 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 10240; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -582,7 +582,7 @@ select * from t1; a set GLOBAL query_cache_size=20480; Warnings: -Warning 1282 Query cache failed to set size 20480 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 20480; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -590,7 +590,7 @@ select * from t1; a set GLOBAL query_cache_size=40960; Warnings: -Warning 1282 Query cache failed to set size 40960 (minimal value: 41297); new query cache size is 0 +Warning 1282 Query cache failed to set size 40960; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 diff --git a/sql/set_var.cc b/sql/set_var.cc index 134a8564145..7d9d88f0281 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1046,7 +1046,19 @@ static void fix_net_retry_count(THD *thd __attribute__((unused)), static void fix_query_cache_size(THD *thd, enum_var_type type) { #ifdef HAVE_QUERY_CACHE - query_cache_size= query_cache.resize(query_cache_size); + ulong new_cache_size= query_cache.resize(query_cache_size); + + /* + Note: query_cache_size is a global variable reflecting the + requested cache size. See also query_cache_size_arg + */ + + if (query_cache_size != new_cache_size) + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), + query_cache_size, new_cache_size); + + query_cache_size= new_cache_size; #endif } diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 04fa1c57cd1..426290714eb 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -4995,13 +4995,13 @@ ER_WRONG_NAME_FOR_CATALOG 42000 spa "Nombre de catalog incorrecto '%-.100s'" swe "Felaktigt katalog namn '%-.100s'" ER_WARN_QC_RESIZE - eng "Query cache failed to set size %lu (minimal value: %lu); new query cache size is %lu" - ger "Änderung der Query-Cache-Größe auf %lu (Minimale Zahl: %lu) fehlgeschlagen; neue Query-Cache-Größe ist %lu" - por "Falha em Query cache para configurar tamanho %lu (Número mínimo: %lu), novo tamanho de query cache é %lu" - rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu (minimal value: %lu), ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" - spa "Query cache fallada para configurar tamaño %lu (Número mínimo: %lu), nuevo tamaño de query cache es %lu" - swe "Storleken av "Query cache" kunde inte sättas till %lu (minsta värde: %lu); ny storlek är %lu" - ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu (minimal value: %lu), ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" + eng "Query cache failed to set size %lu; new query cache size is %lu" + ger "Änderung der Query-Cache-Größe auf %lu fehlgeschlagen; neue Query-Cache-Größe ist %lu" + por "Falha em Query cache para configurar tamanho %lu, novo tamanho de query cache é %lu" + rus "ëÅÛ ÚÁÐÒÏÓÏ× ÎÅ ÍÏÖÅÔ ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ %lu, ÎÏ×ÙÊ ÒÁÚÍÅÒ ËÅÛÁ ÚÐÒÏÓÏ× - %lu" + spa "Query cache fallada para configurar tamaño %lu, nuevo tamaño de query cache es %lu" + swe "Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu" + ukr "ëÅÛ ÚÁÐÉÔ¦× ÎÅÓÐÒÏÍÏÖÅÎ ×ÓÔÁÎÏ×ÉÔÉ ÒÏÚÍ¦Ò %lu, ÎÏ×ÉÊ ÒÏÚÍ¦Ò ËÅÛÁ ÚÁÐÉÔ¦× - %lu" ER_BAD_FT_COLUMN eng "Column '%-.192s' cannot be part of FULLTEXT index" ger "Feld '%-.192s' kann nicht Teil eines FULLTEXT-Index sein" diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 38c429a56a4..375ffc882b4 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -942,25 +942,18 @@ ulong Query_cache::resize(ulong query_cache_size_arg) } while (block != queries_blocks); } free_cache(); - query_cache_size= query_cache_size_arg; - ::query_cache_size= init_cache(); - if (::query_cache_size != query_cache_size_arg) - { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_QC_RESIZE, ER(ER_WARN_QC_RESIZE), - query_cache_size_arg, - get_minimal_size_limit(), - ::query_cache_size); - } + query_cache_size= query_cache_size_arg; + new_query_cache_size= init_cache(); STRUCT_LOCK(&structure_guard_mutex); m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS; pthread_cond_signal(&COND_cache_status_changed); - + if (new_query_cache_size) + DBUG_EXECUTE("check_querycache",check_integrity(1);); STRUCT_UNLOCK(&structure_guard_mutex); - DBUG_RETURN(::query_cache_size); + DBUG_RETURN(new_query_cache_size); } @@ -1823,24 +1816,6 @@ void Query_cache::init() DBUG_VOID_RETURN; } -/** - Return the lowest possible query cache size. -*/ - -ulong Query_cache::get_minimal_size_limit() -{ - ulong approx_additional_data_size= (sizeof(Query_cache) + - sizeof(void*)*(def_query_hash_size+ - def_table_hash_size)); - - ulong data_size= (min_allocation_unit << QUERY_CACHE_MEM_BIN_STEP_PWR2 << - QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) + - ALIGN_SIZE(1) - 1 + - (1 << QUERY_CACHE_MEM_BIN_STEP_PWR2) - 1 + - (1 << QUERY_CACHE_MEM_BIN_FIRST_STEP_PWR2) - 1; - - return(data_size + approx_additional_data_size); -} ulong Query_cache::init_cache() { diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 6af1998a73e..f2c33eff614 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -282,8 +282,6 @@ private: void free_query_internal(Query_cache_block *point); void invalidate_table_internal(THD *thd, uchar *key, uint32 key_length); - ulong get_minimal_size_limit(); - protected: /* The following mutex is locked when searching or changing global From 5dfdccab242bb7234b6b852018ca0457b9e9f46b Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 17 Jul 2008 17:33:41 +0300 Subject: [PATCH 101/352] Folow-up on Bug#37069: fix a valgrind warning Don't initalize federated if it's disabled by a command line option. --- sql/ha_federated.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 2ccfeba74cb..9ce5d44534e 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -405,6 +405,9 @@ static byte *federated_get_key(FEDERATED_SHARE *share, uint *length, bool federated_db_init() { DBUG_ENTER("federated_db_init"); + /* the federated engine can be disabled by a command line option */ + if (have_federated_db == SHOW_OPTION_DISABLED) + DBUG_RETURN(TRUE); if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST)) goto error; if (hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0, From e77957eecb5c24d60b2633e6624cd894016f11fc Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Thu, 17 Jul 2008 18:26:59 +0200 Subject: [PATCH 102/352] BUG#38170: rpl_variables failed on pushbuild: could not sync with master Problem: the test set @@global.init_slave to garbage at a time which was not guaranteed to be after the time when the slave's SQL thread used it. That would cause the slave's SQL thread to stop in rare cases. Fix: The test does not care about the value of @@global.init_slave, except that it should be different on master and slave. Hence, we set @@global.init_slave to something that is valid SQL. --- mysql-test/suite/rpl/r/rpl_variables.result | 26 ++++++++++----------- mysql-test/suite/rpl/t/rpl_variables.test | 22 ++++++++--------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result index 73354666b7a..902340f0219 100644 --- a/mysql-test/suite/rpl/r/rpl_variables.result +++ b/mysql-test/suite/rpl/r/rpl_variables.result @@ -45,7 +45,7 @@ RESET SLAVE; RESET MASTER; START SLAVE; [on slave] -SET @@global.init_slave = 'ant'; +SET @@global.init_slave = 'SELECT 1'; [on master] CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY, truth BOOLEAN, @@ -66,9 +66,9 @@ SET @@global.sync_binlog = 2000000; INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); SET @@global.slave_exec_mode = 'IDEMPOTENT'; INSERT INTO tstmt(text) VALUES (@@global.slave_exec_mode); @@ -140,9 +140,9 @@ INSERT INTO tproc(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO tproc(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tproc(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tproc(text) VALUES (@@global.init_slave); # enumeration SET @@global.slave_exec_mode = 'IDEMPOTENT'; @@ -226,9 +226,9 @@ INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); # enumeration SET @@global.slave_exec_mode = 'IDEMPOTENT'; @@ -316,9 +316,9 @@ INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); SET @@global.sync_binlog = 3000000; INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); # enumeration SET @@global.slave_exec_mode = 'IDEMPOTENT'; @@ -395,9 +395,9 @@ PREPARE p5 FROM 'SET @@global.sync_binlog = 2000000'; PREPARE p6 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000'; PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; -PREPARE p9 FROM 'SET @@global.init_slave = \'bison\''; +PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\''; PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; -PREPARE p11 FROM 'SET @@global.init_slave = \'cat\''; +PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\''; PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; PREPARE p13 FROM 'SET @@global.slave_exec_mode = \'IDEMPOTENT\''; PREPARE p14 FROM 'INSERT INTO tprep(text) VALUES (@@global.slave_exec_mode)'; @@ -522,8 +522,8 @@ id truth num text 2 0 NULL NULL 3 NULL 2000000 NULL 4 NULL 3000000 NULL -5 NULL NULL bison -6 NULL NULL cat +5 NULL NULL SELECT 2 +6 NULL NULL SELECT 3 7 NULL NULL IDEMPOTENT 8 NULL NULL STRICT 9 1 NULL NULL diff --git a/mysql-test/suite/rpl/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test index 3669e14c5df..6c3b3ab6d8a 100644 --- a/mysql-test/suite/rpl/t/rpl_variables.test +++ b/mysql-test/suite/rpl/t/rpl_variables.test @@ -117,7 +117,7 @@ source include/reset_master_and_slave.inc; # above, but can't because it affects how the slave works. --echo [on slave] connection slave; -SET @@global.init_slave = 'ant'; +SET @@global.init_slave = 'SELECT 1'; --echo [on master] @@ -154,9 +154,9 @@ SET @@global.sync_binlog = 3000000; INSERT INTO tstmt(num) VALUES (@@global.sync_binlog); # string -SET @@global.init_slave = 'bison'; +SET @@global.init_slave = 'SELECT 2'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); -SET @@global.init_slave = 'cat'; +SET @@global.init_slave = 'SELECT 3'; INSERT INTO tstmt(text) VALUES (@@global.init_slave); # enumeration @@ -258,9 +258,9 @@ BEGIN INSERT INTO tproc(num) VALUES (@@global.sync_binlog); # string - SET @@global.init_slave = 'bison'; + SET @@global.init_slave = 'SELECT 2'; INSERT INTO tproc(text) VALUES (@@global.init_slave); - SET @@global.init_slave = 'cat'; + SET @@global.init_slave = 'SELECT 3'; INSERT INTO tproc(text) VALUES (@@global.init_slave); # enumeration @@ -367,9 +367,9 @@ BEGIN INSERT INTO tfunc(num) VALUES (@@global.sync_binlog); # string - SET @@global.init_slave = 'bison'; + SET @@global.init_slave = 'SELECT 2'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); - SET @@global.init_slave = 'cat'; + SET @@global.init_slave = 'SELECT 3'; INSERT INTO tfunc(text) VALUES (@@global.init_slave); # enumeration @@ -478,9 +478,9 @@ BEGIN INSERT INTO ttrig(num) VALUES (@@global.sync_binlog); # string - SET @@global.init_slave = 'bison'; + SET @@global.init_slave = 'SELECT 2'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); - SET @@global.init_slave = 'cat'; + SET @@global.init_slave = 'SELECT 3'; INSERT INTO ttrig(text) VALUES (@@global.init_slave); # enumeration @@ -581,9 +581,9 @@ PREPARE p7 FROM 'SET @@global.sync_binlog = 3000000'; PREPARE p8 FROM 'INSERT INTO tprep(num) VALUES (@@global.sync_binlog)'; # string -PREPARE p9 FROM 'SET @@global.init_slave = \'bison\''; +PREPARE p9 FROM 'SET @@global.init_slave = \'SELECT 2\''; PREPARE p10 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; -PREPARE p11 FROM 'SET @@global.init_slave = \'cat\''; +PREPARE p11 FROM 'SET @@global.init_slave = \'SELECT 3\''; PREPARE p12 FROM 'INSERT INTO tprep(text) VALUES (@@global.init_slave)'; # enumeration From 57ba2374f8afec48d70700677d440da8a2f02792 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 17 Jul 2008 15:20:01 -0300 Subject: [PATCH 103/352] Bug#33812: mysql client incorrectly parsing DELIMITER Revert fix for this bug as it introduced a regression reported in Bug#38158. --- client/mysql.cc | 31 +++++++++++++++++++++++++++++++ mysql-test/r/mysql.result | 2 -- mysql-test/t/mysql_delimiter.sql | 6 ------ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 20ad769e9b4..2ef987492b7 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2101,6 +2101,37 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } + else if (!*ml_comment && !*in_string && + (end_of_line - pos) >= 10 && + !my_strnncoll(charset_info, (uchar*) pos, 10, + (const uchar*) "delimiter ", 10)) + { + // Flush previously accepted characters + if (out != line) + { + buffer.append(line, (uint32) (out - line)); + out= line; + } + + // Flush possible comments in the buffer + if (!buffer.is_empty()) + { + if (com_go(&buffer, 0) > 0) // < 0 is not fatal + DBUG_RETURN(1); + buffer.length(0); + } + + /* + Delimiter wants the get rest of the given line as argument to + allow one to change ';' to ';;' and back + */ + buffer.append(pos); + if (com_delimiter(&buffer, pos) > 0) + DBUG_RETURN(1); + + buffer.length(0); + break; + } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 6fe35d5c9f9..a4d96c1c243 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,8 +38,6 @@ t2 t3 Tables_in_test t1 -delimiter -1 _ Test delimiter : from command line a diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index 8caa7cebc2f..db679c3b06b 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -59,9 +59,3 @@ source t/mysql_delimiter_19799.sql use test// show tables// delimiter ; # Reset delimiter - -# -# Bug #33812: mysql client incorrectly parsing DELIMITER -# -select a as delimiter from t1 -delimiter ; # Reset delimiter From 58cb8cbeb4313182bd985a36ea32e153841b5208 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 18 Jul 2008 11:20:55 +0300 Subject: [PATCH 104/352] Bug #34647 rpl_temporary discovers more than one dump thread and fails to select Many dump threads can exist due to a way the new version of mtr governs suites. For this immediate problem the test is refined not to use I_S but rather to reconnect explicitly with preserving logics of a an old target bug fixes verification. --- mysql-test/suite/rpl/r/rpl_temporary.result | 4 ++-- mysql-test/suite/rpl/t/rpl_temporary.test | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result index 7e7d0cebe1d..03d2ca660dc 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary.result +++ b/mysql-test/suite/rpl/r/rpl_temporary.result @@ -76,9 +76,9 @@ drop table t1,t2; create temporary table t3 (f int); create temporary table t4 (f int); create table t5 (f int); -select id from information_schema.processlist where command='Binlog Dump' into @id; -kill @id; +stop slave; insert into t5 select * from t4; +start slave; select * from t5 /* must be 1 after reconnection */; f drop temporary table t4; diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test index 44f901bdae7..51b38ed4837 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary.test +++ b/mysql-test/suite/rpl/t/rpl_temporary.test @@ -138,20 +138,21 @@ sync_slave_with_master; # # Bug#17284 erroneous temp table cleanup on slave +# The test targets at verifying that reconnected slave +# retained the former session's temporary tables # - connection master; create temporary table t4 (f int); create table t5 (f int); sync_slave_with_master; +# connection slave +stop slave; # to prepare for reconnecting w/o waiting for timeout connection master; -# find dumper's $id -select id from information_schema.processlist where command='Binlog Dump' into @id; -kill @id; # to stimulate reconnection by slave w/o timeout insert into t5 select * from t4; save_master_pos; connection slave; +start slave; sync_with_master; select * from t5 /* must be 1 after reconnection */; From e390f843d54caf4a2cf063fa373a6936d30963da Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Jul 2008 14:07:16 +0500 Subject: [PATCH 105/352] Bug#27934 test client_xml misssing initialization Problem: missing initialization, if the previous test fails leaving table t1, client_xml fails as well. Fix: adding initialization. --- mysql-test/r/client_xml.result | 1 + mysql-test/t/client_xml.test | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index ed5e8f2c1b8..b7bca426e65 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -1,3 +1,4 @@ +drop table if exists t1; create table t1 ( `a&b` int, `a Date: Fri, 18 Jul 2008 13:24:59 +0300 Subject: [PATCH 106/352] Bug 38158: mysql client regression, can't read dump files - Revert the fix for bug 33812 - fixed a win32 warning --- client/mysql.cc | 31 +++++++++++++++++++++++++++++++ mysql-test/r/mysql.result | 2 -- mysql-test/t/mysql_delimiter.sql | 6 ------ mysys/default.c | 2 +- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index c8d5522628d..9b14f9fb3ef 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2081,6 +2081,37 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } + else if (!*ml_comment && !*in_string && + (end_of_line - pos) >= 10 && + !my_strnncoll(charset_info, (uchar*) pos, 10, + (const uchar*) "delimiter ", 10)) + { + // Flush previously accepted characters + if (out != line) + { + buffer.append(line, (uint32) (out - line)); + out= line; + } + + // Flush possible comments in the buffer + if (!buffer.is_empty()) + { + if (com_go(&buffer, 0) > 0) // < 0 is not fatal + DBUG_RETURN(1); + buffer.length(0); + } + + /* + Delimiter wants the get rest of the given line as argument to + allow one to change ';' to ';;' and back + */ + buffer.append(pos); + if (com_delimiter(&buffer, pos) > 0) + DBUG_RETURN(1); + + buffer.length(0); + break; + } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index bc50c686ac6..eded1a3fc3b 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,8 +38,6 @@ t2 t3 Tables_in_test t1 -delimiter -1 _ Test delimiter : from command line a diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index 917401275a2..533ac2ce093 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -60,12 +60,6 @@ use test// show tables// delimiter ; # Reset delimiter -# -# Bug #33812: mysql client incorrectly parsing DELIMITER -# -select a as delimiter from t1 -delimiter ; # Reset delimiter - # # Bug #36244: MySQL CLI doesn't recognize standalone -- as comment # before DELIMITER statement diff --git a/mysys/default.c b/mysys/default.c index bf32261129b..b7eb963e395 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -1017,7 +1017,7 @@ static const char *my_get_module_parent(char *buf, size_t size) { char *last= NULL; char *end; - if (!GetModuleFileName(NULL, buf, size)) + if (!GetModuleFileName(NULL, buf, (DWORD) size)) return NULL; end= strend(buf); From e5d1324d80a569fecf34088d07a76d058148fc76 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Fri, 18 Jul 2008 13:34:19 +0200 Subject: [PATCH 107/352] BUG#38178: rpl_loaddata_map fails sporadically in pushbuild Problem: master binlog has 'create table t1'. Master binlog was removed before slave could replicate it. In test's cleanup code, master did 'drop table t1', which caused slave sql thread to stop with an error since slave sql thread did not know about t1. Fix: t1 is just an auxiliary construction, only needed on master. Hence, we turn off binlogging before t1 is created, drop t1 as soon as we don't need it anymore, and then turn on binlogging again. --- mysql-test/include/show_binlog_events.inc | 4 +- .../suite/rpl/r/rpl_loaddata_map.result | 21 +++++---- mysql-test/suite/rpl/t/rpl_loaddata_map.test | 47 +++++++++++++------ 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc index a80dc75df7d..68f913a16a3 100644 --- a/mysql-test/include/show_binlog_events.inc +++ b/mysql-test/include/show_binlog_events.inc @@ -4,7 +4,7 @@ if (!$binlog_start) { let $binlog_start=106; } ---replace_result $binlog_start +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start --replace_column 2 # 4 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ --eval show binlog events from $binlog_start diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-test/suite/rpl/r/rpl_loaddata_map.result index 7078389c987..901f3352b44 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result @@ -4,6 +4,8 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +==== Create a big file ==== +==== Load our big file into a table ==== create table t2 (id int not null primary key auto_increment); select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; @@session.read_buffer_size - @@session.max_allowed_packet > 0 @@ -12,15 +14,18 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2; select count(*) from t2 /* 5 000 */; count(*) 5000 -show binlog events in 'master-bin.000002' from ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Query # # use `test`; create table t2 (id int not null primary key auto_increment) -master-bin.000002 # Begin_load_query # # ;file_id=#;block_len=# -master-bin.000002 # Append_block # # ;file_id=#;block_len=# -master-bin.000002 # Append_block # # ;file_id=#;block_len=# -master-bin.000002 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=# +master-bin.000001 # Query # # use `test`; create table t2 (id int not null primary key auto_increment) +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# +master-bin.000001 # Append_block # # ;file_id=#;block_len=# +master-bin.000001 # Append_block # # ;file_id=#;block_len=# +master-bin.000001 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=# +==== Verify results on slave ==== +[on slave] select count(*) from t2 /* 5 000 */; count(*) 5000 -drop table t1, t2; -end of the tests +==== Clean up ==== +[on master] +drop table t2; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map.test b/mysql-test/suite/rpl/t/rpl_loaddata_map.test index 6a8378c8fdc..ddee9e7e989 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_map.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_map.test @@ -1,7 +1,16 @@ +# ==== Purpose ==== # # check replication of load data with the server parameters subjected to # read_buffer_size > max_allowed_packet # +# ==== Implementation ==== +# +# Insert many rows into t1, write t1 to file. +# Load the file into t2. +# See that t2 came out as expected on slave. +# +# ==== Related Bugs ==== +# # BUG#30435 loading large LOAD DATA INFILE breaks slave with # read_buffer_size set on master # BUG#33413 show binlog events fails if binlog has event size of close @@ -9,10 +18,17 @@ source include/have_binlog_format_mixed_or_statement.inc; source include/master-slave.inc; -source include/have_innodb.inc; -source include/have_binlog_format_mixed_or_statement.inc; + + +--echo ==== Create a big file ==== + +# We turn off binlogging to avoid too much noise in the binlog. t1 is +# just an auxiliary construction anyways, it is not needed on the +# slave. --disable_query_log +SET @@sql_log_bin= 0; + let $rows= 5000; create table t1 (id int not null primary key auto_increment); @@ -22,10 +38,13 @@ while($rows) dec $rows; } eval select * into outfile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' from t1; -flush logs; + +DROP TABLE t1; +SET @@sql_log_bin= 1; --enable_query_log -connection master; + +--echo ==== Load our big file into a table ==== create table t2 (id int not null primary key auto_increment); select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; @@ -34,21 +53,21 @@ select @@session.read_buffer_size - @@session.max_allowed_packet > 0 ; eval load data infile '$MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2; select count(*) from t2 /* 5 000 */; -# the binglog will show fragmented Append_block events ---let $binlog_start=106 ---replace_column 2 # 4 # 5 # ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start ---eval show binlog events in 'master-bin.000002' from $binlog_start +# the binlog will show fragmented Append_block events +source include/show_binlog_events.inc; +--echo ==== Verify results on slave ==== + +--echo [on slave] sync_slave_with_master; -#connection slave; select count(*) from t2 /* 5 000 */; + +--echo ==== Clean up ==== + +--echo [on master] connection master; -drop table t1, t2; +drop table t2; sync_slave_with_master; remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt; - ---echo end of the tests From a5d1e6101ef3823d770289f3fb7b22d0c1729c87 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 18 Jul 2008 14:53:16 +0300 Subject: [PATCH 108/352] Bug #36818 rpl_server_id1 fails expecting slave has stopped the reason for the failure is that io thread passes through a sequence of state changes before it eventually got stuck at the expect running state as NO. It's unreasonble to wait for the running status while the whole idea of the test is to get to the IO thread error. Fixed with changing the waiting condition. --- mysql-test/suite/rpl/r/rpl_server_id1.result | 41 +------------------- mysql-test/suite/rpl/t/disabled.def | 2 +- mysql-test/suite/rpl/t/rpl_server_id1.test | 16 ++++---- 3 files changed, 10 insertions(+), 49 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result index 6a5c86d84bd..724f0071e07 100644 --- a/mysql-test/suite/rpl/r/rpl_server_id1.result +++ b/mysql-test/suite/rpl/r/rpl_server_id1.result @@ -9,42 +9,5 @@ stop slave; change master to master_port=SLAVE_PORT; start slave; *** must be having the replicate-same-server-id IO thread error *** -show slave status; -Slave_IO_State -Master_Host 127.0.0.1 -Master_User root -Master_Port SLAVE_PORT -Connect_Retry 1 -Master_Log_File -Read_Master_Log_Pos 4 -Relay_Log_File slave-relay-bin.000001 -Relay_Log_Pos 4 -Relay_Master_Log_File -Slave_IO_Running No -Slave_SQL_Running # -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table # -Last_Errno # -Last_Error # -Skip_Counter 0 -Exec_Master_Log_Pos 0 -Relay_Log_Space 106 -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master NULL -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 1593 -Last_IO_Error Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it). -Last_SQL_Errno # -Last_SQL_Error # +Slave_IO_Errno= 1593 +Slave_IO_Error= Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it). diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index a356d45c2cc..094919c81b5 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,4 +12,4 @@ rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_innodb_bug28430 : Failure on Solaris Bug #36793 -rpl_server_id1 : Bug #36818 rpl_server_id1 fails expecting slave has stopped (azundris) + diff --git a/mysql-test/suite/rpl/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test index 5838fe98de4..a0467d93543 100644 --- a/mysql-test/suite/rpl/t/rpl_server_id1.test +++ b/mysql-test/suite/rpl/t/rpl_server_id1.test @@ -10,17 +10,15 @@ reset master; # replicate ourselves stop slave; -source include/wait_for_slave_to_stop.inc; --replace_result $SLAVE_MYPORT SLAVE_PORT eval change master to master_port=$SLAVE_MYPORT; start slave; +let $slave_param= Last_IO_Errno; +let $slave_param_value= 1593; +source include/wait_for_slave_param.inc; --echo *** must be having the replicate-same-server-id IO thread error *** - -source include/wait_for_slave_io_to_stop.inc; - ---replace_result $SLAVE_MYPORT SLAVE_PORT ---replace_column 12 # 16 # 19 # 20 # 18 # 37 # 38 # -query_vertical show slave status; - -# End of 4.1 tests +let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1); +let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1); +echo Slave_IO_Errno= $last_io_errno; +echo Slave_IO_Error= $last_io_error; From 38376746e3f2bd5775aced5a952ad6a912ebd4ec Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Fri, 18 Jul 2008 15:07:14 +0200 Subject: [PATCH 109/352] BUG#38077: rpl_incident At line 22: query 'SELECT * ...' Table 'test.t1' doesn't exist This is not a fix to the bug. It only adds debug info, so that we can analyze the bug better next time it happens. Please revert the patch after the bug is fixed. --- mysql-test/suite/rpl/t/rpl_incident.test | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test index 507cd0e0798..e99b88899bf 100644 --- a/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-test/suite/rpl/t/rpl_incident.test @@ -19,6 +19,37 @@ connection slave; # The 4 should not be inserted into the table, since the incident log # event should have stop the slave. --echo **** On Slave **** +#### BEGIN DEBUG INFO ADDED BY SVEN 2008-07-18 -- SEE BUG#38077 #### +let $tables= query_get_value(SHOW TABLES, Tables_in_test, 1); +if (`SELECT '$tables' != 't1'`) +{ + --echo **** TEST CASE BUG! PRINTING DEBUG INFO! **** + --echo **** Dear developer, if you see this in the output of a test + --echo **** case run, please add all the information below as a + --echo **** comment to BUG#38077. If it's a pushbuild failure, please + --echo **** include a link to the push page. + --echo **** Thank you! /Sven + SHOW BINLOG EVENTS; + --echo **** master binlog **** + --error 0,1 + --exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001 + --echo **** slave binlog **** + --error 0,1 + --exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/slave-bin.000001 + --echo **** slave status **** + query_vertical SHOW SLAVE STATUS; + --echo **** slave's master status **** + SHOW MASTER STATUS; + --echo **** slave binlog events **** + --echo [on master] + connection master; + --echo **** master status **** + SHOW MASTER STATUS; + --echo **** master binlog events **** + SHOW BINLOG EVENTS; + exit; +} +#### END DEBUG INFO #### SELECT * FROM t1; --replace_result $MASTER_MYPORT MASTER_PORT From bcbd5bc373355719b4ac47cc566c5afd64dd07c4 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Fri, 18 Jul 2008 19:21:54 +0530 Subject: [PATCH 110/352] WL#4380 1) Modified abi_check rule to not write into the distribution directory. 2) Added the .pp files to EXTRA_DIST so that it will be included in the distribution --- Makefile.am | 13 ++++++++----- include/Makefile.am | 2 ++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6ea03a6d55e..35d9212d669 100644 --- a/Makefile.am +++ b/Makefile.am @@ -273,10 +273,10 @@ TEST_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ # be replaced as the new .pp files. # # e.g. If include/mysql/plugin.h has an ABI change then this rule would -# leave a include/mysql/plugin.out file. +# leave a /abi_check.out file. # # A developer with a justified API change will then do a -# mv include/mysql/plugin.out include/mysql/plugin.pp +# mv /abi_check.out include/mysql/plugin.pp # to replace the old canons with the new ones. # @@ -293,11 +293,14 @@ do_abi_check: -I$(top_srcdir)/include \ -I$(top_srcdir)/include/mysql \ -I$(top_srcdir)/sql \ + -I$(top_builddir)/include \ + -I$(top_builddir)/include/mysql \ + -I$(top_builddir)/sql \ $$file 2>/dev/null | \ @SED@ -e '/^# /d' \ - -e '/^[ ]*$$/d' > $$file.out; \ - @DIFF@ $$file.pp $$file.out; \ - @RM@ $$file.out; \ + -e '/^[ ]*$$/d' > $(top_builddir)/abi_check.out; \ + @DIFF@ $$file.pp $(top_builddir)/abi_check.out; \ + @RM@ $(top_builddir)/abi_check.out; \ done # Don't update the files from bitkeeper diff --git a/include/Makefile.am b/include/Makefile.am index c6ee5163c7a..9438f0d0f25 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -38,6 +38,8 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \ atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \ atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h +EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp + # Remove built files and the symlinked directories CLEANFILES = $(BUILT_SOURCES) readline openssl From 50e23ee8ee803ec23c8d9b419b088ac7c07826a5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 21 Jul 2008 12:01:22 +0200 Subject: [PATCH 111/352] Bug#34409 LOCK_plugin contention via ha_release_temporary_latches/plugin_foreach use thread-local data structures in ha_release_temporary_latches() --- sql/handler.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index ebe5ea5d4fa..fe4944ed836 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1618,23 +1618,23 @@ bool mysql_xa_recover(THD *thd) @return always 0 */ -static my_bool release_temporary_latches(THD *thd, plugin_ref plugin, - void *unused) -{ - handlerton *hton= plugin_data(plugin, handlerton *); - - if (hton->state == SHOW_OPTION_YES && hton->release_temporary_latches) - hton->release_temporary_latches(hton, thd); - - return FALSE; -} - int ha_release_temporary_latches(THD *thd) { - plugin_foreach(thd, release_temporary_latches, MYSQL_STORAGE_ENGINE_PLUGIN, - NULL); + Ha_trx_info *info; + /* + Note that below we assume that only transactional storage engines + may need release_temporary_latches(). If this will ever become false, + we could iterate on thd->open_tables instead (and remove duplicates + as if (!seen[hton->slot]) { seen[hton->slot]=1; ... }). + */ + for (info= thd->transaction.stmt.ha_list; info; info= info->next()) + { + handlerton *hton= info->ht(); + if (hton && hton->release_temporary_latches) + hton->release_temporary_latches(hton, thd); + } return 0; } From 71930db28f94654dd95b2c3c143ed34367d41176 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Thu, 24 Jul 2008 14:28:21 +0200 Subject: [PATCH 112/352] Bug#37027 expire_logs_days and missing binlogs cause a crash ! If the server failed to expired log files during start up it could crash. --- sql/log.cc | 142 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 97 insertions(+), 45 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 9e112e46c65..5a1cfe46686 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1193,6 +1193,7 @@ int MYSQL_LOG::purge_logs(const char *to_log, int error; bool exit_loop= 0; LOG_INFO log_info; + THD *thd= current_thd; DBUG_ENTER("purge_logs"); DBUG_PRINT("info",("to_log= %s",to_log)); @@ -1218,10 +1219,13 @@ int MYSQL_LOG::purge_logs(const char *to_log, /* It's not fatal if we can't stat a log file that does not exist; If we could not stat, we won't delete. - */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); + */ + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } sql_print_information("Failed to execute my_stat on file '%s'", log_info.log_file_name); my_errno= 0; @@ -1231,13 +1235,24 @@ int MYSQL_LOG::purge_logs(const char *to_log, /* Other than ENOENT are fatal */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_BINLOG_PURGE_FATAL_ERR, - "a problem with getting info on being purged %s; " - "consider examining correspondence " - "of your binlog index file " - "to the actual binlog files", - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_BINLOG_PURGE_FATAL_ERR, + "a problem with getting info on being purged %s; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } + else + { + sql_print_information("Failed to delete log file '%s'; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } error= LOG_INFO_FATAL; goto err; } @@ -1254,22 +1269,36 @@ int MYSQL_LOG::purge_logs(const char *to_log, { if (my_errno == ENOENT) { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } sql_print_information("Failed to delete file '%s'", log_info.log_file_name); my_errno= 0; } else { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_BINLOG_PURGE_FATAL_ERR, - "a problem with deleting %s; " - "consider examining correspondence " - "of your binlog index file " - "to the actual binlog files", - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_BINLOG_PURGE_FATAL_ERR, + "a problem with deleting %s; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } + else + { + sql_print_information("Failed to delete file '%s'; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } error= LOG_INFO_FATAL; goto err; } @@ -1316,7 +1345,8 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time) int error; LOG_INFO log_info; MY_STAT stat_area; - + THD *thd= current_thd; + DBUG_ENTER("purge_logs_before_date"); pthread_mutex_lock(&LOCK_index); @@ -1338,12 +1368,15 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time) { /* It's not fatal if we can't stat a log file that does not exist. - */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); - sql_print_information("Failed to execute my_stat on file '%s'", - log_info.log_file_name); + */ + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } + sql_print_information("Failed to execute my_stat on file '%s'", + log_info.log_file_name); my_errno= 0; } else @@ -1351,13 +1384,21 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time) /* Other than ENOENT are fatal */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_BINLOG_PURGE_FATAL_ERR, - "a problem with getting info on being purged %s; " - "consider examining correspondence " - "of your binlog index file " - "to the actual binlog files", - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_BINLOG_PURGE_FATAL_ERR, + "a problem with getting info on being purged %s; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } + else + { + sql_print_information("Failed to delete log file '%s'", + log_info.log_file_name); + } error= LOG_INFO_FATAL; goto err; } @@ -1371,22 +1412,33 @@ int MYSQL_LOG::purge_logs_before_date(time_t purge_time) if (my_errno == ENOENT) { /* It's not fatal even if we can't delete a log file */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } sql_print_information("Failed to delete file '%s'", log_info.log_file_name); my_errno= 0; } else { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_BINLOG_PURGE_FATAL_ERR, - "a problem with deleting %s; " - "consider examining correspondence " - "of your binlog index file " - "to the actual binlog files", - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_BINLOG_PURGE_FATAL_ERR, + "a problem with deleting %s; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } + else + { + sql_print_information("Failed to delete log file '%s'", + log_info.log_file_name); + } error= LOG_INFO_FATAL; goto err; } From 459480f81df63a2279475b9387deb5f89e378c03 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Mon, 21 Jul 2008 16:09:08 +0530 Subject: [PATCH 113/352] WL#4380 Modified the abi_check command to ignore space differences between the .pp and the .out files. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 35d9212d669..82f7d2ab20f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -299,7 +299,7 @@ do_abi_check: $$file 2>/dev/null | \ @SED@ -e '/^# /d' \ -e '/^[ ]*$$/d' > $(top_builddir)/abi_check.out; \ - @DIFF@ $$file.pp $(top_builddir)/abi_check.out; \ + @DIFF@ -b $$file.pp $(top_builddir)/abi_check.out; \ @RM@ $(top_builddir)/abi_check.out; \ done From f5668bc865f663be9113abdc3e72c425712de016 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Mon, 21 Jul 2008 16:41:17 +0200 Subject: [PATCH 114/352] Corrected merge misstake. --- sql/log.cc | 111 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 75 insertions(+), 36 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 0466fe3c948..a56be801d2b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3070,7 +3070,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, int ret = 0; bool exit_loop= 0; LOG_INFO log_info; - THD *thd =current_thd; + THD *thd= current_thd; DBUG_ENTER("purge_logs"); DBUG_PRINT("info",("to_log= %s",to_log)); @@ -3097,9 +3097,12 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, It's not fatal if we can't stat a log file that does not exist; If we could not stat, we won't delete. */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } sql_print_information("Failed to execute my_stat on file '%s'", log_info.log_file_name); my_errno= 0; @@ -3109,13 +3112,24 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, /* Other than ENOENT are fatal */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_BINLOG_PURGE_FATAL_ERR, - "a problem with getting info on being purged %s; " - "consider examining correspondence " - "of your binlog index file " - "to the actual binlog files", - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_BINLOG_PURGE_FATAL_ERR, + "a problem with getting info on being purged %s; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } + else + { + sql_print_information("Failed to delete log file '%s'; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } error= LOG_INFO_FATAL; goto err; } @@ -3132,9 +3146,12 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, { if (my_errno == ENOENT) { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } sql_print_information("Failed to delete file '%s'", log_info.log_file_name); my_errno= 0; @@ -3217,7 +3234,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) int error; LOG_INFO log_info; MY_STAT stat_area; - + THD *thd= current_thd; DBUG_ENTER("purge_logs_before_date"); pthread_mutex_lock(&LOCK_index); @@ -3239,10 +3256,13 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) { /* It's not fatal if we can't stat a log file that does not exist. - */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); + */ + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } sql_print_information("Failed to execute my_stat on file '%s'", log_info.log_file_name); my_errno= 0; @@ -3252,13 +3272,21 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) /* Other than ENOENT are fatal */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_BINLOG_PURGE_FATAL_ERR, - "a problem with getting info on being purged %s; " - "consider examining correspondence " - "of your binlog index file " - "to the actual binlog files", - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_BINLOG_PURGE_FATAL_ERR, + "a problem with getting info on being purged %s; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } + else + { + sql_print_information("Failed to delete log file '%s'", + log_info.log_file_name); + } error= LOG_INFO_FATAL; goto err; } @@ -3272,22 +3300,33 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) if (my_errno == ENOENT) { /* It's not fatal even if we can't delete a log file */ - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), + log_info.log_file_name); + } sql_print_information("Failed to delete file '%s'", log_info.log_file_name); my_errno= 0; } else { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_BINLOG_PURGE_FATAL_ERR, - "a problem with deleting %s; " - "consider examining correspondence " - "of your binlog index file " - "to the actual binlog files", - log_info.log_file_name); + if (thd) + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_BINLOG_PURGE_FATAL_ERR, + "a problem with deleting %s; " + "consider examining correspondence " + "of your binlog index file " + "to the actual binlog files", + log_info.log_file_name); + } + else + { + sql_print_information("Failed to delete log file '%s'", + log_info.log_file_name); + } error= LOG_INFO_FATAL; goto err; } From 5ca789693b207c283a8e2f3ed7f8c9888b0689b8 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Mon, 21 Jul 2008 21:05:06 +0200 Subject: [PATCH 115/352] BUG#38269: pushbuild gives valgrind error in ha_statistic_increment for rpl_temporary This does not fix the bug. It only disables the failing test. --- mysql-test/suite/rpl/t/disabled.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 094919c81b5..43a379dbe03 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,4 +12,4 @@ rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_innodb_bug28430 : Failure on Solaris Bug #36793 - +rpl_temporary : BUG#38269 2008-07-21 Sven valgrind error in pushbuild From 906f061c7608b884906add300aade70b8750ba57 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Tue, 22 Jul 2008 13:04:32 +0200 Subject: [PATCH 116/352] Disabled two test cases in 5.1 because of random failures. --- mysql-test/t/disabled.def | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 5c37e8333a7..c058992d795 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -94,3 +94,6 @@ tmp_table_size_basic_64 : Bug #36522: Some tests of system variabl transaction_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms transaction_prealloc_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms wait_timeout_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms +log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows +slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions + From cadcb867bc51dcbfa1df46759d6ece2580fa1e64 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Tue, 22 Jul 2008 18:05:22 +0530 Subject: [PATCH 117/352] WL#4380 1) When gcc -E is run in the Mac OS it introduces a line of output that results in showing up as a difference between the .pp and .out files. Removed this OS specific preprocessor text inserted by the preprocessor in the MAC OS. Added a sed regular expression to remove MAC OS specific pre-processor text. 2) Added the -w option to diff to remove the differences in output being caused in solaris. --- Makefile.am | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 82f7d2ab20f..222785ea3b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -257,9 +257,14 @@ TEST_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ # results in messages in stderr saying that these headers # were not found. Redirect the stderr output to /dev/null # to prevent seeing these messages. -# 2) sed the output to remove blank lines and lines that begin -# with # (The header information is retained to enable easy -# analysis of abi diffs at a later stage). +# 2) sed the output to +# 2.1) remove blank lines and lines that begin with "# " +# (The header information is retained to enable easy +# analysis of abi diffs at a later stage). +# 2.2) When gcc -E is run in the Mac OS it introduces a line of output +# that results in showing up as a difference between the .pp and +# .out files. Remove this OS specific preprocessor text inserted by +# the preprocessor in the MAC OS. # 3) diff the generated file and the canons (.pp files already in # the repository). # 4) delete the .out file that is generated. @@ -298,8 +303,10 @@ do_abi_check: -I$(top_builddir)/sql \ $$file 2>/dev/null | \ @SED@ -e '/^# /d' \ - -e '/^[ ]*$$/d' > $(top_builddir)/abi_check.out; \ - @DIFF@ -b $$file.pp $(top_builddir)/abi_check.out; \ + -e '/^[ ]*$$/d' \ + -e '/^#pragma GCC set_debug_pwd/d' > \ + $(top_builddir)/abi_check.out; \ + @DIFF@ -wB $$file.pp $(top_builddir)/abi_check.out; \ @RM@ $(top_builddir)/abi_check.out; \ done From bb6e6e3bb920b8978454ebf4a83554237fc6b1e9 Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Tue, 22 Jul 2008 15:58:21 +0200 Subject: [PATCH 118/352] Fix for bug#37708:The allocation of very large buffer must not be done in the pushbuild. --- mysql-test/t/binlog_cache_size_basic_64.test | 9 --------- mysql-test/t/bulk_insert_buffer_size_basic_64.test | 9 --------- mysql-test/t/delayed_insert_limit_basic_64.test | 9 --------- mysql-test/t/delayed_queue_size_basic_64.test | 9 --------- mysql-test/t/innodb_concurrency_tickets_basic_64.test | 9 --------- mysql-test/t/innodb_max_purge_lag_basic_64.test | 9 --------- mysql-test/t/innodb_sync_spin_loops_basic_64.test | 9 --------- mysql-test/t/join_buffer_size_basic_64.test | 9 --------- mysql-test/t/key_buffer_size_basic_64.test | 9 --------- mysql-test/t/key_cache_age_threshold_basic_64.test | 9 --------- mysql-test/t/key_cache_block_size_basic_64.test | 9 --------- mysql-test/t/key_cache_division_limit_basic_64.test | 9 --------- mysql-test/t/log_warnings_basic_64.test | 9 --------- mysql-test/t/max_binlog_cache_size_basic_64.test | 9 --------- mysql-test/t/max_connect_errors_basic_64.test | 9 --------- mysql-test/t/max_heap_table_size_basic_64.test | 9 --------- mysql-test/t/max_seeks_for_key_basic_64.test | 9 --------- mysql-test/t/max_tmp_tables_basic_64.test | 9 --------- mysql-test/t/max_write_lock_count_basic_64.test | 9 --------- mysql-test/t/min_examined_row_limit_basic_64.test | 9 --------- mysql-test/t/multi_range_count_basic_64.test | 9 --------- mysql-test/t/myisam_max_sort_file_size_basic_64.test | 9 --------- mysql-test/t/myisam_repair_threads_basic_64.test | 9 --------- mysql-test/t/myisam_sort_buffer_size_basic_64.test | 9 --------- mysql-test/t/net_retry_count_basic_64.test | 9 --------- mysql-test/t/query_alloc_block_size_basic_64.test | 9 --------- mysql-test/t/query_cache_limit_basic_64.test | 9 --------- mysql-test/t/query_cache_min_res_unit_basic_64.test | 9 --------- mysql-test/t/query_cache_size_basic_64.test | 9 --------- mysql-test/t/query_prealloc_size_basic_64.test | 9 --------- mysql-test/t/range_alloc_block_size_basic_64.test | 9 --------- mysql-test/t/rpl_recovery_rank_basic_64.test | 9 --------- mysql-test/t/server_id_basic_64.test | 9 --------- mysql-test/t/slave_transaction_retries_basic_64.test | 9 --------- mysql-test/t/sort_buffer_size_basic_64.test | 9 --------- mysql-test/t/sync_binlog_basic_64.test | 9 --------- mysql-test/t/timestamp_basic_64.test | 9 --------- mysql-test/t/tmp_table_size_basic_64.test | 9 --------- mysql-test/t/transaction_alloc_block_size_basic_64.test | 9 --------- mysql-test/t/transaction_prealloc_size_basic_64.test | 9 --------- mysql-test/t/wait_timeout_basic_64.test | 9 --------- 41 files changed, 369 deletions(-) delete mode 100644 mysql-test/t/binlog_cache_size_basic_64.test delete mode 100644 mysql-test/t/bulk_insert_buffer_size_basic_64.test delete mode 100644 mysql-test/t/delayed_insert_limit_basic_64.test delete mode 100644 mysql-test/t/delayed_queue_size_basic_64.test delete mode 100644 mysql-test/t/innodb_concurrency_tickets_basic_64.test delete mode 100644 mysql-test/t/innodb_max_purge_lag_basic_64.test delete mode 100644 mysql-test/t/innodb_sync_spin_loops_basic_64.test delete mode 100644 mysql-test/t/join_buffer_size_basic_64.test delete mode 100644 mysql-test/t/key_buffer_size_basic_64.test delete mode 100644 mysql-test/t/key_cache_age_threshold_basic_64.test delete mode 100644 mysql-test/t/key_cache_block_size_basic_64.test delete mode 100644 mysql-test/t/key_cache_division_limit_basic_64.test delete mode 100644 mysql-test/t/log_warnings_basic_64.test delete mode 100644 mysql-test/t/max_binlog_cache_size_basic_64.test delete mode 100644 mysql-test/t/max_connect_errors_basic_64.test delete mode 100644 mysql-test/t/max_heap_table_size_basic_64.test delete mode 100644 mysql-test/t/max_seeks_for_key_basic_64.test delete mode 100644 mysql-test/t/max_tmp_tables_basic_64.test delete mode 100644 mysql-test/t/max_write_lock_count_basic_64.test delete mode 100644 mysql-test/t/min_examined_row_limit_basic_64.test delete mode 100644 mysql-test/t/multi_range_count_basic_64.test delete mode 100644 mysql-test/t/myisam_max_sort_file_size_basic_64.test delete mode 100644 mysql-test/t/myisam_repair_threads_basic_64.test delete mode 100644 mysql-test/t/myisam_sort_buffer_size_basic_64.test delete mode 100644 mysql-test/t/net_retry_count_basic_64.test delete mode 100644 mysql-test/t/query_alloc_block_size_basic_64.test delete mode 100644 mysql-test/t/query_cache_limit_basic_64.test delete mode 100644 mysql-test/t/query_cache_min_res_unit_basic_64.test delete mode 100644 mysql-test/t/query_cache_size_basic_64.test delete mode 100644 mysql-test/t/query_prealloc_size_basic_64.test delete mode 100644 mysql-test/t/range_alloc_block_size_basic_64.test delete mode 100644 mysql-test/t/rpl_recovery_rank_basic_64.test delete mode 100644 mysql-test/t/server_id_basic_64.test delete mode 100644 mysql-test/t/slave_transaction_retries_basic_64.test delete mode 100644 mysql-test/t/sort_buffer_size_basic_64.test delete mode 100644 mysql-test/t/sync_binlog_basic_64.test delete mode 100644 mysql-test/t/timestamp_basic_64.test delete mode 100644 mysql-test/t/tmp_table_size_basic_64.test delete mode 100644 mysql-test/t/transaction_alloc_block_size_basic_64.test delete mode 100644 mysql-test/t/transaction_prealloc_size_basic_64.test delete mode 100644 mysql-test/t/wait_timeout_basic_64.test diff --git a/mysql-test/t/binlog_cache_size_basic_64.test b/mysql-test/t/binlog_cache_size_basic_64.test deleted file mode 100644 index f4fdf8c2129..00000000000 --- a/mysql-test/t/binlog_cache_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/binlog_cache_size_basic.inc - diff --git a/mysql-test/t/bulk_insert_buffer_size_basic_64.test b/mysql-test/t/bulk_insert_buffer_size_basic_64.test deleted file mode 100644 index 6363cfc12d1..00000000000 --- a/mysql-test/t/bulk_insert_buffer_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/bulk_insert_buffer_size_basic.inc - diff --git a/mysql-test/t/delayed_insert_limit_basic_64.test b/mysql-test/t/delayed_insert_limit_basic_64.test deleted file mode 100644 index c1d628bbb34..00000000000 --- a/mysql-test/t/delayed_insert_limit_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/delayed_insert_limit_basic.inc - diff --git a/mysql-test/t/delayed_queue_size_basic_64.test b/mysql-test/t/delayed_queue_size_basic_64.test deleted file mode 100644 index a9a929ae07b..00000000000 --- a/mysql-test/t/delayed_queue_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/delayed_queue_size_basic.inc - diff --git a/mysql-test/t/innodb_concurrency_tickets_basic_64.test b/mysql-test/t/innodb_concurrency_tickets_basic_64.test deleted file mode 100644 index bec46df3d9a..00000000000 --- a/mysql-test/t/innodb_concurrency_tickets_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/innodb_concurrency_tickets_basic.inc - diff --git a/mysql-test/t/innodb_max_purge_lag_basic_64.test b/mysql-test/t/innodb_max_purge_lag_basic_64.test deleted file mode 100644 index 5980e8ed12e..00000000000 --- a/mysql-test/t/innodb_max_purge_lag_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/innodb_max_purge_lag_basic.inc - diff --git a/mysql-test/t/innodb_sync_spin_loops_basic_64.test b/mysql-test/t/innodb_sync_spin_loops_basic_64.test deleted file mode 100644 index f854bf475d6..00000000000 --- a/mysql-test/t/innodb_sync_spin_loops_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/innodb_sync_spin_loops_basic.inc - diff --git a/mysql-test/t/join_buffer_size_basic_64.test b/mysql-test/t/join_buffer_size_basic_64.test deleted file mode 100644 index 6de911be04c..00000000000 --- a/mysql-test/t/join_buffer_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/join_buffer_size_basic.inc - diff --git a/mysql-test/t/key_buffer_size_basic_64.test b/mysql-test/t/key_buffer_size_basic_64.test deleted file mode 100644 index ed8409fa70c..00000000000 --- a/mysql-test/t/key_buffer_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/key_buffer_size_basic.inc - diff --git a/mysql-test/t/key_cache_age_threshold_basic_64.test b/mysql-test/t/key_cache_age_threshold_basic_64.test deleted file mode 100644 index 6524ec89127..00000000000 --- a/mysql-test/t/key_cache_age_threshold_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/key_cache_age_threshold_basic.inc - diff --git a/mysql-test/t/key_cache_block_size_basic_64.test b/mysql-test/t/key_cache_block_size_basic_64.test deleted file mode 100644 index 0b6fb16238e..00000000000 --- a/mysql-test/t/key_cache_block_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/key_cache_block_size_basic.inc - diff --git a/mysql-test/t/key_cache_division_limit_basic_64.test b/mysql-test/t/key_cache_division_limit_basic_64.test deleted file mode 100644 index 3b4e3ccaa99..00000000000 --- a/mysql-test/t/key_cache_division_limit_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/key_cache_division_limit_basic.inc - diff --git a/mysql-test/t/log_warnings_basic_64.test b/mysql-test/t/log_warnings_basic_64.test deleted file mode 100644 index c11381735be..00000000000 --- a/mysql-test/t/log_warnings_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/log_warnings_basic.inc - diff --git a/mysql-test/t/max_binlog_cache_size_basic_64.test b/mysql-test/t/max_binlog_cache_size_basic_64.test deleted file mode 100644 index ba3949ba90c..00000000000 --- a/mysql-test/t/max_binlog_cache_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/max_binlog_cache_size_basic.inc - diff --git a/mysql-test/t/max_connect_errors_basic_64.test b/mysql-test/t/max_connect_errors_basic_64.test deleted file mode 100644 index 6a3d1be6978..00000000000 --- a/mysql-test/t/max_connect_errors_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/max_connect_errors_basic.inc - diff --git a/mysql-test/t/max_heap_table_size_basic_64.test b/mysql-test/t/max_heap_table_size_basic_64.test deleted file mode 100644 index 76f1b658da1..00000000000 --- a/mysql-test/t/max_heap_table_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/max_heap_table_size_basic.inc - diff --git a/mysql-test/t/max_seeks_for_key_basic_64.test b/mysql-test/t/max_seeks_for_key_basic_64.test deleted file mode 100644 index f700aafa044..00000000000 --- a/mysql-test/t/max_seeks_for_key_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/max_seeks_for_key_basic.inc - diff --git a/mysql-test/t/max_tmp_tables_basic_64.test b/mysql-test/t/max_tmp_tables_basic_64.test deleted file mode 100644 index 81aa478b7af..00000000000 --- a/mysql-test/t/max_tmp_tables_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/max_tmp_tables_basic.inc - diff --git a/mysql-test/t/max_write_lock_count_basic_64.test b/mysql-test/t/max_write_lock_count_basic_64.test deleted file mode 100644 index de1d2194c33..00000000000 --- a/mysql-test/t/max_write_lock_count_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/max_write_lock_count_basic.inc - diff --git a/mysql-test/t/min_examined_row_limit_basic_64.test b/mysql-test/t/min_examined_row_limit_basic_64.test deleted file mode 100644 index 93cc4eda99d..00000000000 --- a/mysql-test/t/min_examined_row_limit_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/min_examined_row_limit_basic.inc - diff --git a/mysql-test/t/multi_range_count_basic_64.test b/mysql-test/t/multi_range_count_basic_64.test deleted file mode 100644 index 0dd1ab50e4b..00000000000 --- a/mysql-test/t/multi_range_count_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/multi_range_count_basic.inc - diff --git a/mysql-test/t/myisam_max_sort_file_size_basic_64.test b/mysql-test/t/myisam_max_sort_file_size_basic_64.test deleted file mode 100644 index e3846e2ccdc..00000000000 --- a/mysql-test/t/myisam_max_sort_file_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/myisam_max_sort_file_size_basic.inc - diff --git a/mysql-test/t/myisam_repair_threads_basic_64.test b/mysql-test/t/myisam_repair_threads_basic_64.test deleted file mode 100644 index f1870409c28..00000000000 --- a/mysql-test/t/myisam_repair_threads_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/myisam_repair_threads_basic.inc - diff --git a/mysql-test/t/myisam_sort_buffer_size_basic_64.test b/mysql-test/t/myisam_sort_buffer_size_basic_64.test deleted file mode 100644 index fd1c3c30e7d..00000000000 --- a/mysql-test/t/myisam_sort_buffer_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/myisam_sort_buffer_size_basic.inc - diff --git a/mysql-test/t/net_retry_count_basic_64.test b/mysql-test/t/net_retry_count_basic_64.test deleted file mode 100644 index 08839b673f2..00000000000 --- a/mysql-test/t/net_retry_count_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/net_retry_count_basic.inc - diff --git a/mysql-test/t/query_alloc_block_size_basic_64.test b/mysql-test/t/query_alloc_block_size_basic_64.test deleted file mode 100644 index 70f2f37d36b..00000000000 --- a/mysql-test/t/query_alloc_block_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/query_alloc_block_size_basic.inc - diff --git a/mysql-test/t/query_cache_limit_basic_64.test b/mysql-test/t/query_cache_limit_basic_64.test deleted file mode 100644 index a3ebae0b244..00000000000 --- a/mysql-test/t/query_cache_limit_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/query_cache_limit_basic.inc - diff --git a/mysql-test/t/query_cache_min_res_unit_basic_64.test b/mysql-test/t/query_cache_min_res_unit_basic_64.test deleted file mode 100644 index b35b07d4f1e..00000000000 --- a/mysql-test/t/query_cache_min_res_unit_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/query_cache_min_res_unit_basic.inc - diff --git a/mysql-test/t/query_cache_size_basic_64.test b/mysql-test/t/query_cache_size_basic_64.test deleted file mode 100644 index d53be96a28b..00000000000 --- a/mysql-test/t/query_cache_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/query_cache_size_basic.inc - diff --git a/mysql-test/t/query_prealloc_size_basic_64.test b/mysql-test/t/query_prealloc_size_basic_64.test deleted file mode 100644 index 532336e225e..00000000000 --- a/mysql-test/t/query_prealloc_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/query_prealloc_size_basic.inc - diff --git a/mysql-test/t/range_alloc_block_size_basic_64.test b/mysql-test/t/range_alloc_block_size_basic_64.test deleted file mode 100644 index a9601d770c0..00000000000 --- a/mysql-test/t/range_alloc_block_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/range_alloc_block_size_basic.inc - diff --git a/mysql-test/t/rpl_recovery_rank_basic_64.test b/mysql-test/t/rpl_recovery_rank_basic_64.test deleted file mode 100644 index 6fe04f26442..00000000000 --- a/mysql-test/t/rpl_recovery_rank_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/rpl_recovery_rank_basic.inc - diff --git a/mysql-test/t/server_id_basic_64.test b/mysql-test/t/server_id_basic_64.test deleted file mode 100644 index 67653e0503e..00000000000 --- a/mysql-test/t/server_id_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/server_id_basic.inc - diff --git a/mysql-test/t/slave_transaction_retries_basic_64.test b/mysql-test/t/slave_transaction_retries_basic_64.test deleted file mode 100644 index e07f96edf3f..00000000000 --- a/mysql-test/t/slave_transaction_retries_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/slave_transaction_retries_basic.inc - diff --git a/mysql-test/t/sort_buffer_size_basic_64.test b/mysql-test/t/sort_buffer_size_basic_64.test deleted file mode 100644 index 86081b3820b..00000000000 --- a/mysql-test/t/sort_buffer_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/sort_buffer_size_basic.inc - diff --git a/mysql-test/t/sync_binlog_basic_64.test b/mysql-test/t/sync_binlog_basic_64.test deleted file mode 100644 index 9f605445ded..00000000000 --- a/mysql-test/t/sync_binlog_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/sync_binlog_basic.inc - diff --git a/mysql-test/t/timestamp_basic_64.test b/mysql-test/t/timestamp_basic_64.test deleted file mode 100644 index 4614e470a4c..00000000000 --- a/mysql-test/t/timestamp_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/timestamp_basic.inc - diff --git a/mysql-test/t/tmp_table_size_basic_64.test b/mysql-test/t/tmp_table_size_basic_64.test deleted file mode 100644 index ddd865f6383..00000000000 --- a/mysql-test/t/tmp_table_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/tmp_table_size_basic.inc - diff --git a/mysql-test/t/transaction_alloc_block_size_basic_64.test b/mysql-test/t/transaction_alloc_block_size_basic_64.test deleted file mode 100644 index b6ebe36c35f..00000000000 --- a/mysql-test/t/transaction_alloc_block_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/transaction_alloc_block_size_basic.inc - diff --git a/mysql-test/t/transaction_prealloc_size_basic_64.test b/mysql-test/t/transaction_prealloc_size_basic_64.test deleted file mode 100644 index 5487d06f521..00000000000 --- a/mysql-test/t/transaction_prealloc_size_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/transaction_prealloc_size_basic.inc - diff --git a/mysql-test/t/wait_timeout_basic_64.test b/mysql-test/t/wait_timeout_basic_64.test deleted file mode 100644 index 76dcd6fcc91..00000000000 --- a/mysql-test/t/wait_timeout_basic_64.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 64 bit machines # -################################################################################ - ---source include/have_64bit.inc ---source include/wait_timeout_basic.inc - From ac73d3b48bd132e44e87d3296e9bfb19dc23df5e Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Tue, 22 Jul 2008 18:45:55 +0200 Subject: [PATCH 119/352] Fix for bug#37708:The allocation of very large buffer must not be done in the pushbuild. hhunger. --- mysql-test/t/binlog_cache_size_basic_32.test | 9 --------- mysql-test/t/bulk_insert_buffer_size_basic_32.test | 9 --------- mysql-test/t/delayed_insert_limit_basic_32.test | 9 --------- mysql-test/t/delayed_queue_size_basic_32.test | 9 --------- mysql-test/t/innodb_concurrency_tickets_basic_32.test | 9 --------- mysql-test/t/innodb_max_purge_lag_basic_32.test | 9 --------- mysql-test/t/innodb_sync_spin_loops_basic_32.test | 9 --------- mysql-test/t/join_buffer_size_basic_32.test | 9 --------- mysql-test/t/key_buffer_size_basic_32.test | 9 --------- mysql-test/t/key_cache_age_threshold_basic_32.test | 9 --------- mysql-test/t/key_cache_block_size_basic_32.test | 9 --------- mysql-test/t/key_cache_division_limit_basic_32.test | 9 --------- mysql-test/t/log_warnings_basic_32.test | 9 --------- mysql-test/t/max_binlog_cache_size_basic_32.test | 9 --------- mysql-test/t/max_connect_errors_basic_32.test | 9 --------- mysql-test/t/max_heap_table_size_basic_32.test | 9 --------- mysql-test/t/max_seeks_for_key_basic_32.test | 9 --------- mysql-test/t/max_tmp_tables_basic_32.test | 9 --------- mysql-test/t/max_write_lock_count_basic_32.test | 9 --------- mysql-test/t/min_examined_row_limit_basic_32.test | 9 --------- mysql-test/t/multi_range_count_basic_32.test | 9 --------- mysql-test/t/myisam_max_sort_file_size_basic_32.test | 9 --------- mysql-test/t/myisam_repair_threads_basic_32.test | 9 --------- mysql-test/t/myisam_sort_buffer_size_basic_32.test | 9 --------- mysql-test/t/net_retry_count_basic_32.test | 9 --------- mysql-test/t/query_alloc_block_size_basic_32.test | 9 --------- mysql-test/t/query_cache_limit_basic_32.test | 9 --------- mysql-test/t/query_cache_min_res_unit_basic_32.test | 9 --------- mysql-test/t/query_cache_size_basic_32.test | 9 --------- mysql-test/t/query_prealloc_size_basic_32.test | 9 --------- mysql-test/t/range_alloc_block_size_basic_32.test | 9 --------- mysql-test/t/rpl_recovery_rank_basic_32.test | 9 --------- mysql-test/t/server_id_basic_32.test | 9 --------- mysql-test/t/slave_transaction_retries_basic_32.test | 9 --------- mysql-test/t/sort_buffer_size_basic_32.test | 9 --------- mysql-test/t/sync_binlog_basic_32.test | 9 --------- mysql-test/t/timestamp_basic_32.test | 9 --------- mysql-test/t/tmp_table_size_basic_32.test | 9 --------- mysql-test/t/transaction_alloc_block_size_basic_32.test | 9 --------- mysql-test/t/transaction_prealloc_size_basic_32.test | 9 --------- mysql-test/t/wait_timeout_basic_32.test | 9 --------- 41 files changed, 369 deletions(-) delete mode 100644 mysql-test/t/binlog_cache_size_basic_32.test delete mode 100644 mysql-test/t/bulk_insert_buffer_size_basic_32.test delete mode 100644 mysql-test/t/delayed_insert_limit_basic_32.test delete mode 100644 mysql-test/t/delayed_queue_size_basic_32.test delete mode 100644 mysql-test/t/innodb_concurrency_tickets_basic_32.test delete mode 100644 mysql-test/t/innodb_max_purge_lag_basic_32.test delete mode 100644 mysql-test/t/innodb_sync_spin_loops_basic_32.test delete mode 100644 mysql-test/t/join_buffer_size_basic_32.test delete mode 100644 mysql-test/t/key_buffer_size_basic_32.test delete mode 100644 mysql-test/t/key_cache_age_threshold_basic_32.test delete mode 100644 mysql-test/t/key_cache_block_size_basic_32.test delete mode 100644 mysql-test/t/key_cache_division_limit_basic_32.test delete mode 100644 mysql-test/t/log_warnings_basic_32.test delete mode 100644 mysql-test/t/max_binlog_cache_size_basic_32.test delete mode 100644 mysql-test/t/max_connect_errors_basic_32.test delete mode 100644 mysql-test/t/max_heap_table_size_basic_32.test delete mode 100644 mysql-test/t/max_seeks_for_key_basic_32.test delete mode 100644 mysql-test/t/max_tmp_tables_basic_32.test delete mode 100644 mysql-test/t/max_write_lock_count_basic_32.test delete mode 100644 mysql-test/t/min_examined_row_limit_basic_32.test delete mode 100644 mysql-test/t/multi_range_count_basic_32.test delete mode 100644 mysql-test/t/myisam_max_sort_file_size_basic_32.test delete mode 100644 mysql-test/t/myisam_repair_threads_basic_32.test delete mode 100644 mysql-test/t/myisam_sort_buffer_size_basic_32.test delete mode 100644 mysql-test/t/net_retry_count_basic_32.test delete mode 100644 mysql-test/t/query_alloc_block_size_basic_32.test delete mode 100644 mysql-test/t/query_cache_limit_basic_32.test delete mode 100644 mysql-test/t/query_cache_min_res_unit_basic_32.test delete mode 100644 mysql-test/t/query_cache_size_basic_32.test delete mode 100644 mysql-test/t/query_prealloc_size_basic_32.test delete mode 100644 mysql-test/t/range_alloc_block_size_basic_32.test delete mode 100644 mysql-test/t/rpl_recovery_rank_basic_32.test delete mode 100644 mysql-test/t/server_id_basic_32.test delete mode 100644 mysql-test/t/slave_transaction_retries_basic_32.test delete mode 100644 mysql-test/t/sort_buffer_size_basic_32.test delete mode 100644 mysql-test/t/sync_binlog_basic_32.test delete mode 100644 mysql-test/t/timestamp_basic_32.test delete mode 100644 mysql-test/t/tmp_table_size_basic_32.test delete mode 100644 mysql-test/t/transaction_alloc_block_size_basic_32.test delete mode 100644 mysql-test/t/transaction_prealloc_size_basic_32.test delete mode 100644 mysql-test/t/wait_timeout_basic_32.test diff --git a/mysql-test/t/binlog_cache_size_basic_32.test b/mysql-test/t/binlog_cache_size_basic_32.test deleted file mode 100644 index a809c00f987..00000000000 --- a/mysql-test/t/binlog_cache_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/binlog_cache_size_basic.inc - diff --git a/mysql-test/t/bulk_insert_buffer_size_basic_32.test b/mysql-test/t/bulk_insert_buffer_size_basic_32.test deleted file mode 100644 index 76a418323bc..00000000000 --- a/mysql-test/t/bulk_insert_buffer_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/bulk_insert_buffer_size_basic.inc - diff --git a/mysql-test/t/delayed_insert_limit_basic_32.test b/mysql-test/t/delayed_insert_limit_basic_32.test deleted file mode 100644 index d7a4a81542f..00000000000 --- a/mysql-test/t/delayed_insert_limit_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/delayed_insert_limit_basic.inc - diff --git a/mysql-test/t/delayed_queue_size_basic_32.test b/mysql-test/t/delayed_queue_size_basic_32.test deleted file mode 100644 index 06e0cf48dac..00000000000 --- a/mysql-test/t/delayed_queue_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/delayed_queue_size_basic.inc - diff --git a/mysql-test/t/innodb_concurrency_tickets_basic_32.test b/mysql-test/t/innodb_concurrency_tickets_basic_32.test deleted file mode 100644 index e587d1870bf..00000000000 --- a/mysql-test/t/innodb_concurrency_tickets_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/innodb_concurrency_tickets_basic.inc - diff --git a/mysql-test/t/innodb_max_purge_lag_basic_32.test b/mysql-test/t/innodb_max_purge_lag_basic_32.test deleted file mode 100644 index 4e5b019b151..00000000000 --- a/mysql-test/t/innodb_max_purge_lag_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/innodb_max_purge_lag_basic.inc - diff --git a/mysql-test/t/innodb_sync_spin_loops_basic_32.test b/mysql-test/t/innodb_sync_spin_loops_basic_32.test deleted file mode 100644 index ffb766b3ec8..00000000000 --- a/mysql-test/t/innodb_sync_spin_loops_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/innodb_sync_spin_loops_basic.inc - diff --git a/mysql-test/t/join_buffer_size_basic_32.test b/mysql-test/t/join_buffer_size_basic_32.test deleted file mode 100644 index e904f2de426..00000000000 --- a/mysql-test/t/join_buffer_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/join_buffer_size_basic.inc - diff --git a/mysql-test/t/key_buffer_size_basic_32.test b/mysql-test/t/key_buffer_size_basic_32.test deleted file mode 100644 index 78051382f73..00000000000 --- a/mysql-test/t/key_buffer_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/key_buffer_size_basic.inc - diff --git a/mysql-test/t/key_cache_age_threshold_basic_32.test b/mysql-test/t/key_cache_age_threshold_basic_32.test deleted file mode 100644 index 13e7367f2ed..00000000000 --- a/mysql-test/t/key_cache_age_threshold_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/key_cache_age_threshold_basic.inc - diff --git a/mysql-test/t/key_cache_block_size_basic_32.test b/mysql-test/t/key_cache_block_size_basic_32.test deleted file mode 100644 index 63d71016657..00000000000 --- a/mysql-test/t/key_cache_block_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/key_cache_block_size_basic.inc - diff --git a/mysql-test/t/key_cache_division_limit_basic_32.test b/mysql-test/t/key_cache_division_limit_basic_32.test deleted file mode 100644 index c8ec6cca3a3..00000000000 --- a/mysql-test/t/key_cache_division_limit_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/key_cache_division_limit_basic.inc - diff --git a/mysql-test/t/log_warnings_basic_32.test b/mysql-test/t/log_warnings_basic_32.test deleted file mode 100644 index b6d1d0d6382..00000000000 --- a/mysql-test/t/log_warnings_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/log_warnings_basic.inc - diff --git a/mysql-test/t/max_binlog_cache_size_basic_32.test b/mysql-test/t/max_binlog_cache_size_basic_32.test deleted file mode 100644 index ba9c4d5136a..00000000000 --- a/mysql-test/t/max_binlog_cache_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/max_binlog_cache_size_basic.inc - diff --git a/mysql-test/t/max_connect_errors_basic_32.test b/mysql-test/t/max_connect_errors_basic_32.test deleted file mode 100644 index 9f6e1dad6a8..00000000000 --- a/mysql-test/t/max_connect_errors_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/max_connect_errors_basic.inc - diff --git a/mysql-test/t/max_heap_table_size_basic_32.test b/mysql-test/t/max_heap_table_size_basic_32.test deleted file mode 100644 index 38684f307c2..00000000000 --- a/mysql-test/t/max_heap_table_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/max_heap_table_size_basic.inc - diff --git a/mysql-test/t/max_seeks_for_key_basic_32.test b/mysql-test/t/max_seeks_for_key_basic_32.test deleted file mode 100644 index d7b9ce7f834..00000000000 --- a/mysql-test/t/max_seeks_for_key_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/max_seeks_for_key_basic.inc - diff --git a/mysql-test/t/max_tmp_tables_basic_32.test b/mysql-test/t/max_tmp_tables_basic_32.test deleted file mode 100644 index 98da87421b7..00000000000 --- a/mysql-test/t/max_tmp_tables_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/max_tmp_tables_basic.inc - diff --git a/mysql-test/t/max_write_lock_count_basic_32.test b/mysql-test/t/max_write_lock_count_basic_32.test deleted file mode 100644 index c33ffc53d6c..00000000000 --- a/mysql-test/t/max_write_lock_count_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/max_write_lock_count_basic.inc - diff --git a/mysql-test/t/min_examined_row_limit_basic_32.test b/mysql-test/t/min_examined_row_limit_basic_32.test deleted file mode 100644 index bbc3b6029d8..00000000000 --- a/mysql-test/t/min_examined_row_limit_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/min_examined_row_limit_basic.inc - diff --git a/mysql-test/t/multi_range_count_basic_32.test b/mysql-test/t/multi_range_count_basic_32.test deleted file mode 100644 index a2487ebc154..00000000000 --- a/mysql-test/t/multi_range_count_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/multi_range_count_basic.inc - diff --git a/mysql-test/t/myisam_max_sort_file_size_basic_32.test b/mysql-test/t/myisam_max_sort_file_size_basic_32.test deleted file mode 100644 index 5ff3a35a61f..00000000000 --- a/mysql-test/t/myisam_max_sort_file_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/myisam_max_sort_file_size_basic.inc - diff --git a/mysql-test/t/myisam_repair_threads_basic_32.test b/mysql-test/t/myisam_repair_threads_basic_32.test deleted file mode 100644 index 7f0f0785f09..00000000000 --- a/mysql-test/t/myisam_repair_threads_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/myisam_repair_threads_basic.inc - diff --git a/mysql-test/t/myisam_sort_buffer_size_basic_32.test b/mysql-test/t/myisam_sort_buffer_size_basic_32.test deleted file mode 100644 index d87a2015407..00000000000 --- a/mysql-test/t/myisam_sort_buffer_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/myisam_sort_buffer_size_basic.inc - diff --git a/mysql-test/t/net_retry_count_basic_32.test b/mysql-test/t/net_retry_count_basic_32.test deleted file mode 100644 index 1f7a4f1cb80..00000000000 --- a/mysql-test/t/net_retry_count_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/net_retry_count_basic.inc - diff --git a/mysql-test/t/query_alloc_block_size_basic_32.test b/mysql-test/t/query_alloc_block_size_basic_32.test deleted file mode 100644 index 281698c4179..00000000000 --- a/mysql-test/t/query_alloc_block_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/query_alloc_block_size_basic.inc - diff --git a/mysql-test/t/query_cache_limit_basic_32.test b/mysql-test/t/query_cache_limit_basic_32.test deleted file mode 100644 index cd5f94112a0..00000000000 --- a/mysql-test/t/query_cache_limit_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/query_cache_limit_basic.inc - diff --git a/mysql-test/t/query_cache_min_res_unit_basic_32.test b/mysql-test/t/query_cache_min_res_unit_basic_32.test deleted file mode 100644 index 4f3740ea872..00000000000 --- a/mysql-test/t/query_cache_min_res_unit_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/query_cache_min_res_unit_basic.inc - diff --git a/mysql-test/t/query_cache_size_basic_32.test b/mysql-test/t/query_cache_size_basic_32.test deleted file mode 100644 index 500bdbda5dd..00000000000 --- a/mysql-test/t/query_cache_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/query_cache_size_basic.inc - diff --git a/mysql-test/t/query_prealloc_size_basic_32.test b/mysql-test/t/query_prealloc_size_basic_32.test deleted file mode 100644 index ae919cd8d9e..00000000000 --- a/mysql-test/t/query_prealloc_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/query_prealloc_size_basic.inc - diff --git a/mysql-test/t/range_alloc_block_size_basic_32.test b/mysql-test/t/range_alloc_block_size_basic_32.test deleted file mode 100644 index 247e92cd362..00000000000 --- a/mysql-test/t/range_alloc_block_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/range_alloc_block_size_basic.inc - diff --git a/mysql-test/t/rpl_recovery_rank_basic_32.test b/mysql-test/t/rpl_recovery_rank_basic_32.test deleted file mode 100644 index d35878e153c..00000000000 --- a/mysql-test/t/rpl_recovery_rank_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/rpl_recovery_rank_basic.inc - diff --git a/mysql-test/t/server_id_basic_32.test b/mysql-test/t/server_id_basic_32.test deleted file mode 100644 index b7c4c603803..00000000000 --- a/mysql-test/t/server_id_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/server_id_basic.inc - diff --git a/mysql-test/t/slave_transaction_retries_basic_32.test b/mysql-test/t/slave_transaction_retries_basic_32.test deleted file mode 100644 index c19297ba72f..00000000000 --- a/mysql-test/t/slave_transaction_retries_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/slave_transaction_retries_basic.inc - diff --git a/mysql-test/t/sort_buffer_size_basic_32.test b/mysql-test/t/sort_buffer_size_basic_32.test deleted file mode 100644 index 8c86fe7786a..00000000000 --- a/mysql-test/t/sort_buffer_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/sort_buffer_size_basic.inc - diff --git a/mysql-test/t/sync_binlog_basic_32.test b/mysql-test/t/sync_binlog_basic_32.test deleted file mode 100644 index 3acd76b7e72..00000000000 --- a/mysql-test/t/sync_binlog_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/sync_binlog_basic.inc - diff --git a/mysql-test/t/timestamp_basic_32.test b/mysql-test/t/timestamp_basic_32.test deleted file mode 100644 index 72371c154fc..00000000000 --- a/mysql-test/t/timestamp_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/timestamp_basic.inc - diff --git a/mysql-test/t/tmp_table_size_basic_32.test b/mysql-test/t/tmp_table_size_basic_32.test deleted file mode 100644 index 19d54251c5e..00000000000 --- a/mysql-test/t/tmp_table_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/tmp_table_size_basic.inc - diff --git a/mysql-test/t/transaction_alloc_block_size_basic_32.test b/mysql-test/t/transaction_alloc_block_size_basic_32.test deleted file mode 100644 index a714a4f5a30..00000000000 --- a/mysql-test/t/transaction_alloc_block_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/transaction_alloc_block_size_basic.inc - diff --git a/mysql-test/t/transaction_prealloc_size_basic_32.test b/mysql-test/t/transaction_prealloc_size_basic_32.test deleted file mode 100644 index 868e281d30e..00000000000 --- a/mysql-test/t/transaction_prealloc_size_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/transaction_prealloc_size_basic.inc - diff --git a/mysql-test/t/wait_timeout_basic_32.test b/mysql-test/t/wait_timeout_basic_32.test deleted file mode 100644 index 88d60333138..00000000000 --- a/mysql-test/t/wait_timeout_basic_32.test +++ /dev/null @@ -1,9 +0,0 @@ -################################################################################ -# Created by Horst Hunger 2008-05-07 # -# # -# Wrapper for 32 bit machines # -################################################################################ - ---source include/have_32bit.inc ---source include/wait_timeout_basic.inc - From cb7d9b27d404389d3b71f901c12923e7511de433 Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Tue, 22 Jul 2008 18:48:47 +0200 Subject: [PATCH 120/352] Fix for bug#37708: Result files of removed 32 bit tests. --- .../r/binlog_cache_size_basic_32.result | 102 --------- .../r/bulk_insert_buffer_size_basic_32.result | 154 ------------- .../r/delayed_insert_limit_basic_32.result | 112 ---------- .../r/delayed_queue_size_basic_32.result | 110 ---------- ...innodb_concurrency_tickets_basic_32.result | 100 --------- .../r/innodb_max_purge_lag_basic_32.result | 94 -------- .../r/innodb_sync_spin_loops_basic_32.result | 94 -------- mysql-test/r/join_buffer_size_basic_32.result | 198 ----------------- mysql-test/r/key_buffer_size_basic_32.result | 111 ---------- .../r/key_cache_age_threshold_basic_32.result | 126 ----------- .../r/key_cache_block_size_basic_32.result | 142 ------------ .../key_cache_division_limit_basic_32.result | 139 ------------ mysql-test/r/log_warnings_basic_32.result | 162 -------------- .../r/max_binlog_cache_size_basic_32.result | 145 ------------- .../r/max_connect_errors_basic_32.result | 137 ------------ .../r/max_heap_table_size_basic_32.result | 196 ----------------- .../r/max_seeks_for_key_basic_32.result | 180 ---------------- mysql-test/r/max_tmp_tables_basic_32.result | 197 ----------------- .../r/max_write_lock_count_basic_32.result | 108 ---------- .../r/min_examined_row_limit_basic_32.result | 180 ---------------- .../r/multi_range_count_basic_32.result | 192 ----------------- .../myisam_max_sort_file_size_basic_32.result | 114 ---------- .../r/myisam_repair_threads_basic_32.result | 180 ---------------- .../r/myisam_sort_buffer_size_basic_32.result | 184 ---------------- mysql-test/r/net_retry_count_basic_32.result | 192 ----------------- .../r/query_alloc_block_size_basic_32.result | 203 ------------------ .../r/query_cache_limit_basic_32.result | 126 ----------- .../query_cache_min_res_unit_basic_32.result | 134 ------------ mysql-test/r/query_cache_size_basic_32.result | 138 ------------ .../r/query_prealloc_size_basic_32.result | 178 --------------- .../r/range_alloc_block_size_basic_32.result | 182 ---------------- .../r/rpl_recovery_rank_basic_32.result | 110 ---------- mysql-test/r/server_id_basic_32.result | 117 ---------- .../slave_transaction_retries_basic_32.result | 119 ---------- mysql-test/r/sort_buffer_size_basic_32.result | 193 ----------------- mysql-test/r/sync_binlog_basic_32.result | 105 --------- mysql-test/r/timestamp_basic_32.result | 73 ------- mysql-test/r/tmp_table_size_basic_32.result | 172 --------------- ...ansaction_alloc_block_size_basic_32.result | 180 ---------------- .../transaction_prealloc_size_basic_32.result | 172 --------------- mysql-test/r/wait_timeout_basic_32.result | 129 ----------- 41 files changed, 5980 deletions(-) delete mode 100644 mysql-test/r/binlog_cache_size_basic_32.result delete mode 100644 mysql-test/r/bulk_insert_buffer_size_basic_32.result delete mode 100644 mysql-test/r/delayed_insert_limit_basic_32.result delete mode 100644 mysql-test/r/delayed_queue_size_basic_32.result delete mode 100644 mysql-test/r/innodb_concurrency_tickets_basic_32.result delete mode 100644 mysql-test/r/innodb_max_purge_lag_basic_32.result delete mode 100644 mysql-test/r/innodb_sync_spin_loops_basic_32.result delete mode 100644 mysql-test/r/join_buffer_size_basic_32.result delete mode 100644 mysql-test/r/key_buffer_size_basic_32.result delete mode 100644 mysql-test/r/key_cache_age_threshold_basic_32.result delete mode 100644 mysql-test/r/key_cache_block_size_basic_32.result delete mode 100644 mysql-test/r/key_cache_division_limit_basic_32.result delete mode 100644 mysql-test/r/log_warnings_basic_32.result delete mode 100644 mysql-test/r/max_binlog_cache_size_basic_32.result delete mode 100644 mysql-test/r/max_connect_errors_basic_32.result delete mode 100644 mysql-test/r/max_heap_table_size_basic_32.result delete mode 100644 mysql-test/r/max_seeks_for_key_basic_32.result delete mode 100644 mysql-test/r/max_tmp_tables_basic_32.result delete mode 100644 mysql-test/r/max_write_lock_count_basic_32.result delete mode 100644 mysql-test/r/min_examined_row_limit_basic_32.result delete mode 100644 mysql-test/r/multi_range_count_basic_32.result delete mode 100644 mysql-test/r/myisam_max_sort_file_size_basic_32.result delete mode 100644 mysql-test/r/myisam_repair_threads_basic_32.result delete mode 100644 mysql-test/r/myisam_sort_buffer_size_basic_32.result delete mode 100644 mysql-test/r/net_retry_count_basic_32.result delete mode 100644 mysql-test/r/query_alloc_block_size_basic_32.result delete mode 100644 mysql-test/r/query_cache_limit_basic_32.result delete mode 100644 mysql-test/r/query_cache_min_res_unit_basic_32.result delete mode 100644 mysql-test/r/query_cache_size_basic_32.result delete mode 100644 mysql-test/r/query_prealloc_size_basic_32.result delete mode 100644 mysql-test/r/range_alloc_block_size_basic_32.result delete mode 100644 mysql-test/r/rpl_recovery_rank_basic_32.result delete mode 100644 mysql-test/r/server_id_basic_32.result delete mode 100644 mysql-test/r/slave_transaction_retries_basic_32.result delete mode 100644 mysql-test/r/sort_buffer_size_basic_32.result delete mode 100644 mysql-test/r/sync_binlog_basic_32.result delete mode 100644 mysql-test/r/timestamp_basic_32.result delete mode 100644 mysql-test/r/tmp_table_size_basic_32.result delete mode 100644 mysql-test/r/transaction_alloc_block_size_basic_32.result delete mode 100644 mysql-test/r/transaction_prealloc_size_basic_32.result delete mode 100644 mysql-test/r/wait_timeout_basic_32.result diff --git a/mysql-test/r/binlog_cache_size_basic_32.result b/mysql-test/r/binlog_cache_size_basic_32.result deleted file mode 100644 index 6267c5493da..00000000000 --- a/mysql-test/r/binlog_cache_size_basic_32.result +++ /dev/null @@ -1,102 +0,0 @@ -SET @start_value = @@global.binlog_cache_size; -SELECT @start_value; -@start_value -32768 -'#--------------------FN_DYNVARS_006_01------------------------#' -SET @@global.binlog_cache_size = 100; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '100' -SET @@global.binlog_cache_size = DEFAULT; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -32768 -'#---------------------FN_DYNVARS_006_02-------------------------#' -SET @@global.binlog_cache_size = @start_value; -SELECT @@global.binlog_cache_size = 32768; -@@global.binlog_cache_size = 32768 -1 -'#--------------------FN_DYNVARS_006_03------------------------#' -SET @@global.binlog_cache_size = 4096; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = 4294967295; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4294963200 -SET @@global.binlog_cache_size = 10000; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -8192 -SET @@global.binlog_cache_size = 21221204; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -21217280 -'Bug: Invalid values are coming in variable on assigning valid values' -'#--------------------FN_DYNVARS_006_04-------------------------#' -SET @@global.binlog_cache_size = 1024; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '1024' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' -SET @@global.binlog_cache_size = -1024; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '0' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = 42949672950; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '42949672950' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4294963200 -'Bug: Errors are not coming on assigning invalid values to variable' -SET @@global.binlog_cache_size = ON; -ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' -SET @@global.binlog_cache_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' -'#-------------------FN_DYNVARS_006_05----------------------------#' -SET @@session.binlog_cache_size = 0; -ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -'#----------------------FN_DYNVARS_006_06------------------------#' -SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size'; -@@global.binlog_cache_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_006_07----------------------#' -SET @@global.binlog_cache_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '1' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '0' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -'Bug: Errors are not coming on assigning TRUE/FALSE to variable' -'#---------------------FN_DYNVARS_006_08----------------------#' -SET @@global.binlog_cache_size = 1; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '1' -SELECT @@binlog_cache_size = @@global.binlog_cache_size; -@@binlog_cache_size = @@global.binlog_cache_size -1 -'#---------------------FN_DYNVARS_006_09----------------------#' -SET binlog_cache_size = 1; -ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SET global.binlog_cache_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1 -SELECT global.binlog_cache_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT binlog_cache_size = @@session.binlog_cache_size; -ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list' -SET @@global.binlog_cache_size = @start_value; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -32768 diff --git a/mysql-test/r/bulk_insert_buffer_size_basic_32.result b/mysql-test/r/bulk_insert_buffer_size_basic_32.result deleted file mode 100644 index 1194a0e7ce7..00000000000 --- a/mysql-test/r/bulk_insert_buffer_size_basic_32.result +++ /dev/null @@ -1,154 +0,0 @@ -SET @start_global_value = @@global.bulk_insert_buffer_size; -SELECT @start_global_value; -@start_global_value -8388608 -SET @start_session_value = @@session.bulk_insert_buffer_size; -SELECT @start_session_value; -@start_session_value -8388608 -'#--------------------FN_DYNVARS_007_01-------------------------#' -SET @@global.bulk_insert_buffer_size = 100; -SET @@global.bulk_insert_buffer_size = DEFAULT; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -8388608 -SET @@session.bulk_insert_buffer_size = 200; -SET @@session.bulk_insert_buffer_size = DEFAULT; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -8388608 -'#--------------------FN_DYNVARS_007_02-------------------------#' -SET @@global.bulk_insert_buffer_size = @start_global_value; -SELECT @@global.bulk_insert_buffer_size = 8388608; -@@global.bulk_insert_buffer_size = 8388608 -1 -SET @@session.bulk_insert_buffer_size = @start_session_value; -SELECT @@session.bulk_insert_buffer_size = 8388608; -@@session.bulk_insert_buffer_size = 8388608 -1 -'#--------------------FN_DYNVARS_007_03-------------------------#' -SET @@global.bulk_insert_buffer_size = 0; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -0 -SET @@global.bulk_insert_buffer_size = 1; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -1 -SET @@global.bulk_insert_buffer_size = 4294967295; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -4294967295 -SET @@global.bulk_insert_buffer_size = 429496; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -429496 -'#--------------------FN_DYNVARS_007_04-------------------------#' -SET @@session.bulk_insert_buffer_size = 0; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -0 -SET @@session.bulk_insert_buffer_size = 1; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -1 -SET @@session.bulk_insert_buffer_size = 4294967295; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -4294967295 -SET @@session.bulk_insert_buffer_size = 429496; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -429496 -'#------------------FN_DYNVARS_007_05-----------------------#' -SET @@global.bulk_insert_buffer_size = 42949672950; -Warnings: -Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '42949672950' -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -4294967295 -SET @@global.bulk_insert_buffer_size = -1024; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -0 -SET @@global.bulk_insert_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@global.bulk_insert_buffer_size = ON; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@global.bulk_insert_buffer_size = 429496.10; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@session.bulk_insert_buffer_size = 42949672950; -Warnings: -Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '42949672950' -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -4294967295 -SET @@session.bulk_insert_buffer_size = -2; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -0 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@session.bulk_insert_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@session.bulk_insert_buffer_size = 429496.10; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -'#------------------FN_DYNVARS_007_06-----------------------#' -SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='bulk_insert_buffer_size'; -@@global.bulk_insert_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_007_07-----------------------#' -SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='bulk_insert_buffer_size'; -@@session.bulk_insert_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_007_08-----------------------#' -SET @@global.bulk_insert_buffer_size = TRUE; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -1 -SET @@global.bulk_insert_buffer_size = FALSE; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -0 -SET @@session.bulk_insert_buffer_size = TRUE; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -1 -SET @@session.bulk_insert_buffer_size = FALSE; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -0 -'#---------------------FN_DYNVARS_007_09----------------------#' -SET @@bulk_insert_buffer_size = 100; -SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size; -@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size -1 -SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; -@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size -1 -'#---------------------FN_DYNVARS_007_10----------------------#' -SET bulk_insert_buffer_size = 1; -SELECT @@bulk_insert_buffer_size; -@@bulk_insert_buffer_size -1 -SET local.bulk_insert_buffer_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 -SELECT local.bulk_insert_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SET session.bulk_insert_buffer_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 -SELECT session.bulk_insert_buffer_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; -ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list' -SET @@global.bulk_insert_buffer_size = @start_global_value; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -8388608 -SET @@session.bulk_insert_buffer_size = @start_session_value; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -8388608 diff --git a/mysql-test/r/delayed_insert_limit_basic_32.result b/mysql-test/r/delayed_insert_limit_basic_32.result deleted file mode 100644 index cb6820b2941..00000000000 --- a/mysql-test/r/delayed_insert_limit_basic_32.result +++ /dev/null @@ -1,112 +0,0 @@ -SET @start_value = @@global.delayed_insert_limit; -SELECT @start_value; -@start_value -100 -'#--------------------FN_DYNVARS_024_01------------------------#' -SET @@global.delayed_insert_limit = 100; -SET @@global.delayed_insert_limit = DEFAULT; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -100 -'#---------------------FN_DYNVARS_024_02-------------------------#' -SET @@global.delayed_insert_limit = @start_value; -SELECT @@global.delayed_insert_limit = 100; -@@global.delayed_insert_limit = 100 -1 -'#--------------------FN_DYNVARS_024_03------------------------#' -SET @@global.delayed_insert_limit = 10000; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -10000 -SET @@global.delayed_insert_limit = 4294967295; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -4294967295 -SET @@global.delayed_insert_limit = 1; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -'#--------------------FN_DYNVARS_024_04-------------------------#' -SET @@global.delayed_insert_limit = 0; -Warnings: -Warning 1292 Truncated incorrect delayed_insert_limit value: '0' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -SET @@global.delayed_insert_limit = -1024; -Warnings: -Warning 1292 Truncated incorrect delayed_insert_limit value: '0' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -SET @@global.delayed_insert_limit = 42949672950; -Warnings: -Warning 1292 Truncated incorrect delayed_insert_limit value: '42949672950' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.delayed_insert_limit = 429496729.5; -ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -4294967295 -SET @@global.delayed_insert_limit = ON; -ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -4294967295 -'#-------------------FN_DYNVARS_024_05----------------------------#' -SET @@session.delayed_insert_limit = 0; -ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@Session.delayed_insert_limit; -ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable -'#----------------------FN_DYNVARS_024_06------------------------#' -SELECT @@global.delayed_insert_limit = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='delayed_insert_limit'; -@@global.delayed_insert_limit = -VARIABLE_VALUE -1 -SELECT @@delayed_insert_limit = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='delayed_insert_limit'; -@@delayed_insert_limit = -VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_024_07----------------------#' -SET @@global.delayed_insert_limit = TRUE; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -SET @@global.delayed_insert_limit = FALSE; -Warnings: -Warning 1292 Truncated incorrect delayed_insert_limit value: '0' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -'#---------------------FN_DYNVARS_024_08----------------------#' -SET @@global.delayed_insert_limit = 1; -SELECT @@delayed_insert_limit = @@global.delayed_insert_limit; -@@delayed_insert_limit = @@global.delayed_insert_limit -1 -'#---------------------FN_DYNVARS_024_09----------------------#' -SET delayed_insert_limit = 1; -ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@delayed_insert_limit; -@@delayed_insert_limit -1 -SET local.delayed_insert_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 -SELECT local.delayed_insert_limit; -ERROR 42S02: Unknown table 'local' in field list -SET global.delayed_insert_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 -SELECT global.delayed_insert_limit; -ERROR 42S02: Unknown table 'global' in field list -SELECT delayed_insert_limit = @@session.delayed_insert_limit; -ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list' -SET @@global.delayed_insert_limit = @start_value; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -100 diff --git a/mysql-test/r/delayed_queue_size_basic_32.result b/mysql-test/r/delayed_queue_size_basic_32.result deleted file mode 100644 index 6bfa6f0de40..00000000000 --- a/mysql-test/r/delayed_queue_size_basic_32.result +++ /dev/null @@ -1,110 +0,0 @@ -SET @start_value = @@global.delayed_queue_size; -SELECT @start_value; -@start_value -1000 -'#--------------------FN_DYNVARS_026_01------------------------#' -SET @@global.delayed_queue_size = 100; -SET @@global.delayed_queue_size = DEFAULT; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1000 -'#---------------------FN_DYNVARS_026_02-------------------------#' -SET @@global.delayed_queue_size = @start_value; -SELECT @@global.delayed_queue_size = 1000; -@@global.delayed_queue_size = 1000 -1 -'#--------------------FN_DYNVARS_026_03------------------------#' -SET @@global.delayed_queue_size = 10000; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -10000 -SET @@global.delayed_queue_size = 4294967295; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -4294967295 -SET @@global.delayed_queue_size = 1; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -'#--------------------FN_DYNVARS_026_04-------------------------#' -SET @@global.delayed_queue_size = 0; -Warnings: -Warning 1292 Truncated incorrect delayed_queue_size value: '0' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -SET @@global.delayed_queue_size = -1024; -Warnings: -Warning 1292 Truncated incorrect delayed_queue_size value: '0' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -SET @@global.delayed_queue_size = 42949672950; -Warnings: -Warning 1292 Truncated incorrect delayed_queue_size value: '42949672950' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.delayed_queue_size = 429496729.5; -ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -4294967295 -SET @@global.delayed_queue_size = ON; -ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' -SELECT @@delayed_queue_size; -@@delayed_queue_size -4294967295 -'#-------------------FN_DYNVARS_026_05----------------------------#' -SET @@session.delayed_queue_size = 0; -ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.delayed_queue_size; -ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable -'#----------------------FN_DYNVARS_026_06------------------------#' -SELECT @@global.delayed_queue_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='delayed_queue_size'; -@@global.delayed_queue_size = VARIABLE_VALUE -1 -SELECT @@delayed_queue_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='delayed_queue_size'; -@@delayed_queue_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_026_07----------------------#' -SET @@global.delayed_queue_size = TRUE; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -SET @@global.delayed_queue_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect delayed_queue_size value: '0' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -'#---------------------FN_DYNVARS_026_08----------------------#' -SET @@global.delayed_queue_size = 1; -SELECT @@delayed_queue_size = @@global.delayed_queue_size; -@@delayed_queue_size = @@global.delayed_queue_size -1 -'#---------------------FN_DYNVARS_026_09----------------------#' -SET delayed_queue_size = 1; -ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@delayed_queue_size; -@@delayed_queue_size -1 -SET local.delayed_queue_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 -SELECT local.delayed_queue_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.delayed_queue_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 -SELECT global.delayed_queue_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT delayed_queue_size = @@session.delayed_queue_size; -ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list' -SET @@global.delayed_queue_size = @start_value; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1000 diff --git a/mysql-test/r/innodb_concurrency_tickets_basic_32.result b/mysql-test/r/innodb_concurrency_tickets_basic_32.result deleted file mode 100644 index 1d1317d0d5e..00000000000 --- a/mysql-test/r/innodb_concurrency_tickets_basic_32.result +++ /dev/null @@ -1,100 +0,0 @@ -SET @global_start_value = @@global.innodb_concurrency_tickets; -SELECT @global_start_value; -@global_start_value -500 -'#--------------------FN_DYNVARS_046_01------------------------#' -SET @@global.innodb_concurrency_tickets = 0; -Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '0' -SET @@global.innodb_concurrency_tickets = DEFAULT; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -500 -'#---------------------FN_DYNVARS_046_02-------------------------#' -SET innodb_concurrency_tickets = 1; -ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@innodb_concurrency_tickets; -@@innodb_concurrency_tickets -500 -SELECT local.innodb_concurrency_tickets; -ERROR 42S02: Unknown table 'local' in field list -SET global innodb_concurrency_tickets = 0; -Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '0' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -'#--------------------FN_DYNVARS_046_03------------------------#' -SET @@global.innodb_concurrency_tickets = 1; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -SET @@global.innodb_concurrency_tickets = 1000; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1000 -SET @@global.innodb_concurrency_tickets = 4294967295; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -4294967295 -'#--------------------FN_DYNVARS_046_04-------------------------#' -SET @@global.innodb_concurrency_tickets = -1; -Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '18446744073709551615' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -4294967295 -SET @@global.innodb_concurrency_tickets = "T"; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -4294967295 -SET @@global.innodb_concurrency_tickets = "Y"; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -4294967295 -SET @@global.innodb_concurrency_tickets = 1001; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -'#----------------------FN_DYNVARS_046_05------------------------#' -SELECT @@global.innodb_concurrency_tickets = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_concurrency_tickets'; -@@global.innodb_concurrency_tickets = -VARIABLE_VALUE -1 -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_concurrency_tickets'; -VARIABLE_VALUE -1001 -'#---------------------FN_DYNVARS_046_06-------------------------#' -SET @@global.innodb_concurrency_tickets = OFF; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -SET @@global.innodb_concurrency_tickets = ON; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -'#---------------------FN_DYNVARS_046_07----------------------#' -SET @@global.innodb_concurrency_tickets = TRUE; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -SET @@global.innodb_concurrency_tickets = FALSE; -Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '0' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -SET @@global.innodb_concurrency_tickets = @global_start_value; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -500 diff --git a/mysql-test/r/innodb_max_purge_lag_basic_32.result b/mysql-test/r/innodb_max_purge_lag_basic_32.result deleted file mode 100644 index ed960f12ff1..00000000000 --- a/mysql-test/r/innodb_max_purge_lag_basic_32.result +++ /dev/null @@ -1,94 +0,0 @@ -SET @global_start_value = @@global.innodb_max_purge_lag; -SELECT @global_start_value; -@global_start_value -0 -'#--------------------FN_DYNVARS_046_01------------------------#' -SET @@global.innodb_max_purge_lag = 0; -SET @@global.innodb_max_purge_lag = DEFAULT; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -'#---------------------FN_DYNVARS_046_02-------------------------#' -SET innodb_max_purge_lag = 1; -ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@innodb_max_purge_lag; -@@innodb_max_purge_lag -0 -SELECT local.innodb_max_purge_lag; -ERROR 42S02: Unknown table 'local' in field list -SET global innodb_max_purge_lag = 0; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -'#--------------------FN_DYNVARS_046_03------------------------#' -SET @@global.innodb_max_purge_lag = 0; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -SET @@global.innodb_max_purge_lag = 1; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1 -SET @@global.innodb_max_purge_lag = 4294967295; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -4294967295 -'#--------------------FN_DYNVARS_046_04-------------------------#' -SET @@global.innodb_max_purge_lag = -1; -Warnings: -Warning 1292 Truncated incorrect max_purge_lag value: '18446744073709551615' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -4294967295 -SET @@global.innodb_max_purge_lag = "T"; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -4294967295 -SET @@global.innodb_max_purge_lag = "Y"; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -4294967295 -SET @@global.innodb_max_purge_lag = 1001; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -'#----------------------FN_DYNVARS_046_05------------------------#' -SELECT @@global.innodb_max_purge_lag = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_max_purge_lag'; -@@global.innodb_max_purge_lag = -VARIABLE_VALUE -1 -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_max_purge_lag'; -VARIABLE_VALUE -1001 -'#---------------------FN_DYNVARS_046_06-------------------------#' -SET @@global.innodb_max_purge_lag = OFF; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -SET @@global.innodb_max_purge_lag = ON; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -'#---------------------FN_DYNVARS_046_07----------------------#' -SET @@global.innodb_max_purge_lag = TRUE; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1 -SET @@global.innodb_max_purge_lag = FALSE; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -SET @@global.innodb_max_purge_lag = @global_start_value; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 diff --git a/mysql-test/r/innodb_sync_spin_loops_basic_32.result b/mysql-test/r/innodb_sync_spin_loops_basic_32.result deleted file mode 100644 index 2b976e65b14..00000000000 --- a/mysql-test/r/innodb_sync_spin_loops_basic_32.result +++ /dev/null @@ -1,94 +0,0 @@ -SET @global_start_value = @@global.innodb_sync_spin_loops; -SELECT @global_start_value; -@global_start_value -20 -'#--------------------FN_DYNVARS_046_01------------------------#' -SET @@global.innodb_sync_spin_loops = 0; -SET @@global.innodb_sync_spin_loops = DEFAULT; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -20 -'#---------------------FN_DYNVARS_046_02-------------------------#' -SET innodb_sync_spin_loops = 1; -ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@innodb_sync_spin_loops; -@@innodb_sync_spin_loops -20 -SELECT local.innodb_sync_spin_loops; -ERROR 42S02: Unknown table 'local' in field list -SET global innodb_sync_spin_loops = 0; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -0 -'#--------------------FN_DYNVARS_046_03------------------------#' -SET @@global.innodb_sync_spin_loops = 0; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -0 -SET @@global.innodb_sync_spin_loops = 1; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1 -SET @@global.innodb_sync_spin_loops = 1000; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1000 -'#--------------------FN_DYNVARS_046_04-------------------------#' -SET @@global.innodb_sync_spin_loops = -1; -Warnings: -Warning 1292 Truncated incorrect sync_spin_loops value: '18446744073709551615' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -4294967295 -SET @@global.innodb_sync_spin_loops = "T"; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -4294967295 -SET @@global.innodb_sync_spin_loops = "Y"; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -4294967295 -SET @@global.innodb_sync_spin_loops = 1001; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -'#----------------------FN_DYNVARS_046_05------------------------#' -SELECT @@global.innodb_sync_spin_loops = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_sync_spin_loops'; -@@global.innodb_sync_spin_loops = -VARIABLE_VALUE -1 -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_sync_spin_loops'; -VARIABLE_VALUE -1001 -'#---------------------FN_DYNVARS_046_06-------------------------#' -SET @@global.innodb_sync_spin_loops = OFF; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -SET @@global.innodb_sync_spin_loops = ON; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -'#---------------------FN_DYNVARS_046_07----------------------#' -SET @@global.innodb_sync_spin_loops = TRUE; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1 -SET @@global.innodb_sync_spin_loops = FALSE; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -0 -SET @@global.innodb_sync_spin_loops = @global_start_value; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -20 diff --git a/mysql-test/r/join_buffer_size_basic_32.result b/mysql-test/r/join_buffer_size_basic_32.result deleted file mode 100644 index fc3061d2f59..00000000000 --- a/mysql-test/r/join_buffer_size_basic_32.result +++ /dev/null @@ -1,198 +0,0 @@ -SET @start_global_value = @@global.join_buffer_size; -SELECT @start_global_value; -@start_global_value -131072 -SET @start_session_value = @@session.join_buffer_size; -SELECT @start_session_value; -@start_session_value -131072 -'#--------------------FN_DYNVARS_053_01-------------------------#' -SET @@global.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SET @@global.join_buffer_size = DEFAULT; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -131072 -SET @@session.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SET @@session.join_buffer_size = DEFAULT; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -131072 -'#--------------------FN_DYNVARS_053_02-------------------------#' -SET @@global.join_buffer_size = DEFAULT; -SELECT @@global.join_buffer_size = 131072; -@@global.join_buffer_size = 131072 -1 -SET @@session.join_buffer_size = DEFAULT; -SELECT @@session.join_buffer_size = 131072; -@@session.join_buffer_size = 131072 -1 -'#--------------------FN_DYNVARS_053_03-------------------------#' -SET @@global.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = 65536; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -65536 -SET @@global.join_buffer_size = 4294967295; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -4294963200 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -'#--------------------FN_DYNVARS_053_04-------------------------#' -SET @@session.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = 65536; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -65536 -SET @@session.join_buffer_size = 4294967295; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -4294963200 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -'#------------------FN_DYNVARS_053_05-----------------------#' -SET @@global.join_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = -1024; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = 8199; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8199' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = 42949672951; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '42949672951' -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -4294963200 -SET @@global.join_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -4294963200 -SET @@global.join_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'join_buffer_size' -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -4294963200 -SET @@session.join_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = -2; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = 8199; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8199' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = 42949672951; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '42949672951' -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -4294963200 -SET @@session.join_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -4294963200 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@session.join_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'join_buffer_size' -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -4294963200 -'#------------------FN_DYNVARS_053_06-----------------------#' -SELECT @@global.join_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='join_buffer_size'; -@@global.join_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_053_07-----------------------#' -SELECT @@session.join_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='join_buffer_size'; -@@session.join_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_053_08-----------------------#' -SET @@global.join_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '1' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.join_buffer_size = 10; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '10' -SELECT @@join_buffer_size = @@global.join_buffer_size; -@@join_buffer_size = @@global.join_buffer_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@join_buffer_size = 100; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '100' -SELECT @@join_buffer_size = @@local.join_buffer_size; -@@join_buffer_size = @@local.join_buffer_size -1 -SELECT @@local.join_buffer_size = @@session.join_buffer_size; -@@local.join_buffer_size = @@session.join_buffer_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET join_buffer_size = 1; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '1' -SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228; -@@join_buffer_size=8200 OR @@join_buffer_size= 8228 -1 -SELECT local.join_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.join_buffer_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT join_buffer_size = @@session.join_buffer_size; -ERROR 42S22: Unknown column 'join_buffer_size' in 'field list' -SET @@global.join_buffer_size = @start_global_value; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -131072 -SET @@session.join_buffer_size = @start_session_value; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -131072 diff --git a/mysql-test/r/key_buffer_size_basic_32.result b/mysql-test/r/key_buffer_size_basic_32.result deleted file mode 100644 index 981988a1d4d..00000000000 --- a/mysql-test/r/key_buffer_size_basic_32.result +++ /dev/null @@ -1,111 +0,0 @@ -SET @start_value = @@global.key_buffer_size; -SELECT @start_value; -@start_value -1048576 -'#--------------------FN_DYNVARS_055_01------------------------#' -SET @@global.key_buffer_size = 99; -SET @@global.key_buffer_size = DEFAULT; -ERROR 42000: Variable 'key_buffer_size' doesn't have a default value -'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'#---------------------FN_DYNVARS_055_02-------------------------#' -SET @@global.key_buffer_size = @start_value; -SELECT @@global.key_buffer_size = @start_value; -@@global.key_buffer_size = @start_value -1 -'#--------------------FN_DYNVARS_055_03------------------------#' -SET @@global.key_buffer_size = @min_key_buffer_size; -SELECT @@global.key_buffer_size= @min_key_buffer_size; -@@global.key_buffer_size= @min_key_buffer_size -1 -SET @@global.key_buffer_size = 1800; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '1800' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -SET @@global.key_buffer_size = 65535; -SELECT @@global.key_buffer_size; -@@global.key_buffer_size -61440 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -'#--------------------FN_DYNVARS_055_04-------------------------#' -SET @@global.key_buffer_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_buffer_size' -SELECT @@global.key_buffer_size; -@@global.key_buffer_size -61440 -SET @@global.key_buffer_size = 4; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '4' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.key_buffer_size = ON; -ERROR 42000: Incorrect argument type to variable 'key_buffer_size' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -SET @@global.key_buffer_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_buffer_size' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'#-------------------FN_DYNVARS_055_05----------------------------#' -SET @@session.key_buffer_size = 0; -ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_buffer_size = @min_key_buffer_size; -@@key_buffer_size = @min_key_buffer_size -1 -'#----------------------FN_DYNVARS_055_06------------------------#' -SELECT @@global.key_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_buffer_size'; -@@global.key_buffer_size = VARIABLE_VALUE -1 -SELECT @@key_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_buffer_size'; -@@key_buffer_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_055_07----------------------#' -SET @@global.key_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '1' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -SET @@global.key_buffer_size = FALSE; -Warnings: -Warning 1438 Cannot drop default keycache -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'#---------------------FN_DYNVARS_055_08----------------------#' -SET @@global.key_buffer_size = @min_key_buffer_size; -SELECT @@key_buffer_size = @@global.key_buffer_size; -@@key_buffer_size = @@global.key_buffer_size -1 -'#---------------------FN_DYNVARS_055_09----------------------#' -SET key_buffer_size = @min_key_buffer_size; -ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_buffer_size = @min_key_buffer_size; -@@key_buffer_size = @min_key_buffer_size -1 -SET local.key_buffer_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 -SELECT local.key_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_buffer_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 -SELECT global.key_buffer_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_buffer_size = @@session.key_buffer_size; -ERROR 42S22: Unknown column 'key_buffer_size' in 'field list' -SET @@global.key_buffer_size = @start_value; -SELECT @@global.key_buffer_size; -@@global.key_buffer_size -1048576 diff --git a/mysql-test/r/key_cache_age_threshold_basic_32.result b/mysql-test/r/key_cache_age_threshold_basic_32.result deleted file mode 100644 index 023b23ea425..00000000000 --- a/mysql-test/r/key_cache_age_threshold_basic_32.result +++ /dev/null @@ -1,126 +0,0 @@ -SET @start_value = @@global.key_cache_age_threshold; -SELECT @start_value; -@start_value -300 -'#--------------------FN_DYNVARS_056_01------------------------#' -SET @@global.key_cache_age_threshold = 99; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' -SET @@global.key_cache_age_threshold = DEFAULT; -ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value -'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'#---------------------FN_DYNVARS_056_02-------------------------#' -SET @@global.key_cache_age_threshold = @start_value; -SELECT @@global.key_cache_age_threshold = 300; -@@global.key_cache_age_threshold = 300 -1 -'#--------------------FN_DYNVARS_056_03------------------------#' -SET @@global.key_cache_age_threshold = 100; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -SET @@global.key_cache_age_threshold = 4294967295; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -4294967200 -SET @@global.key_cache_age_threshold = 1800; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -1800 -SET @@global.key_cache_age_threshold = 65535; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -65500 -'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; -'#--------------------FN_DYNVARS_056_04-------------------------#' -SET @@global.key_cache_age_threshold = -1; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -4294967200 -SET @@global.key_cache_age_threshold = 42949672951; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -4294967200 -SET @@global.key_cache_age_threshold = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -4294967200 -SET @@global.key_cache_age_threshold = -1024; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -4294966200 -SET @@global.key_cache_age_threshold = 99; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.key_cache_age_threshold = ON; -ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -SET @@global.key_cache_age_threshold = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'#-------------------FN_DYNVARS_056_05----------------------------#' -SET @@session.key_cache_age_threshold = 0; -ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.key_cache_age_threshold; -ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable -'#----------------------FN_DYNVARS_056_06------------------------#' -SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_age_threshold'; -@@global.key_cache_age_threshold = VARIABLE_VALUE -1 -SELECT @@key_cache_age_threshold = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_age_threshold'; -@@key_cache_age_threshold = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_056_07----------------------#' -SET @@global.key_cache_age_threshold = TRUE; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '1' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -SET @@global.key_cache_age_threshold = FALSE; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '0' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'#---------------------FN_DYNVARS_056_08----------------------#' -SET @@global.key_cache_age_threshold = 101; -SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold; -@@key_cache_age_threshold = @@global.key_cache_age_threshold -1 -'#---------------------FN_DYNVARS_056_09----------------------#' -SET key_cache_age_threshold = 8000; -ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_cache_age_threshold; -@@key_cache_age_threshold -100 -SET local.key_cache_age_threshold = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 -SELECT local.key_cache_age_threshold; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_cache_age_threshold = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 -SELECT global.key_cache_age_threshold; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_cache_age_threshold = @@session.key_cache_age_threshold; -ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list' -SET @@global.key_cache_age_threshold = @start_value; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -300 diff --git a/mysql-test/r/key_cache_block_size_basic_32.result b/mysql-test/r/key_cache_block_size_basic_32.result deleted file mode 100644 index ac78acb8244..00000000000 --- a/mysql-test/r/key_cache_block_size_basic_32.result +++ /dev/null @@ -1,142 +0,0 @@ -SET @start_value = @@global.key_cache_block_size; -SELECT @start_value; -@start_value -1024 -'#--------------------FN_DYNVARS_057_01------------------------#' -SET @@global.key_cache_block_size = 600; -SET @@global.key_cache_block_size = DEFAULT; -ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value -'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -'#---------------------FN_DYNVARS_057_02-------------------------#' -SET @@global.key_cache_block_size = @start_value; -SELECT @@global.key_cache_block_size = 1024; -@@global.key_cache_block_size = 1024 -1 -'#--------------------FN_DYNVARS_057_03------------------------#' -SET @@global.key_cache_block_size = 1024; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -1024 -SET @@global.key_cache_block_size = 16384; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 1800; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -1536 -SET @@global.key_cache_block_size = 16383; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -15872 -'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; -'#--------------------FN_DYNVARS_057_04-------------------------#' -SET @@global.key_cache_block_size = -1; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '4294967295' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 42949672951; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '4294967287' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '4294966272' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 256; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '256' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -SET @@global.key_cache_block_size = 511; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '511' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -SET @@global.key_cache_block_size = 16385; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '16385' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.key_cache_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -'#-------------------FN_DYNVARS_057_05----------------------------#' -SET @@session.key_cache_block_size = 0; -ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.key_cache_block_size; -ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable -'#----------------------FN_DYNVARS_057_06------------------------#' -SELECT @@global.key_cache_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_block_size'; -@@global.key_cache_block_size = VARIABLE_VALUE -1 -SELECT @@key_cache_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_block_size'; -@@key_cache_block_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_057_07----------------------#' -SET @@global.key_cache_block_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '1' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -SET @@global.key_cache_block_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '0' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -'#---------------------FN_DYNVARS_057_08----------------------#' -SET @@global.key_cache_block_size = 1024; -SELECT @@key_cache_block_size = @@global.key_cache_block_size; -@@key_cache_block_size = @@global.key_cache_block_size -1 -'#---------------------FN_DYNVARS_057_09----------------------#' -SET key_cache_block_size = 8000; -ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_cache_block_size; -@@key_cache_block_size -1024 -SET local.key_cache_block_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 -SELECT local.key_cache_block_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_cache_block_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 -SELECT global.key_cache_block_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_cache_block_size = @@session.key_cache_block_size; -ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list' -SET @@global.key_cache_block_size = @start_value; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -1024 diff --git a/mysql-test/r/key_cache_division_limit_basic_32.result b/mysql-test/r/key_cache_division_limit_basic_32.result deleted file mode 100644 index 5902dbcdf89..00000000000 --- a/mysql-test/r/key_cache_division_limit_basic_32.result +++ /dev/null @@ -1,139 +0,0 @@ -SET @start_value = @@global.key_cache_division_limit; -SELECT @start_value; -@start_value -100 -'#--------------------FN_DYNVARS_058_01------------------------#' -SET @@global.key_cache_division_limit = 50; -SET @@global.key_cache_division_limit = DEFAULT; -ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value -'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -50 -'#---------------------FN_DYNVARS_058_02-------------------------#' -SET @@global.key_cache_division_limit = @start_value; -SELECT @@global.key_cache_division_limit = 100; -@@global.key_cache_division_limit = 100 -1 -'#--------------------FN_DYNVARS_058_03------------------------#' -SET @@global.key_cache_division_limit = 1; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -SET @@global.key_cache_division_limit = 50; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -50 -SET @@global.key_cache_division_limit = 99; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -99 -SET @@global.key_cache_division_limit = 2; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -2 -'#--------------------FN_DYNVARS_058_04-------------------------#' -SET @@global.key_cache_division_limit = -1; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '4294967295' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 101; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '101' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = -1024; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '4294966272' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 0; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '0' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -SET @@global.key_cache_division_limit = 200; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '200' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 65535; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '65535' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.key_cache_division_limit = ON; -ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -'#-------------------FN_DYNVARS_058_05----------------------------#' -SET @@session.key_cache_division_limit = 0; -ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.key_cache_division_limit; -ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable -'#----------------------FN_DYNVARS_058_06------------------------#' -SELECT @@global.key_cache_division_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_division_limit'; -@@global.key_cache_division_limit = VARIABLE_VALUE -1 -SELECT @@key_cache_division_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_division_limit'; -@@key_cache_division_limit = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_058_07----------------------#' -SET @@global.key_cache_division_limit = TRUE; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -SET @@global.key_cache_division_limit = FALSE; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '0' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -'#---------------------FN_DYNVARS_058_08----------------------#' -SET @@global.key_cache_division_limit = 90; -SELECT @@key_cache_division_limit = @@global.key_cache_division_limit; -@@key_cache_division_limit = @@global.key_cache_division_limit -1 -'#---------------------FN_DYNVARS_058_09----------------------#' -SET key_cache_division_limit = 80; -ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_cache_division_limit; -@@key_cache_division_limit -90 -SET local.key_cache_division_limit = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 -SELECT local.key_cache_division_limit; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_cache_division_limit = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 -SELECT global.key_cache_division_limit; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_cache_division_limit = @@session.key_cache_division_limit; -ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list' -SET @@global.key_cache_division_limit = @start_value; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 diff --git a/mysql-test/r/log_warnings_basic_32.result b/mysql-test/r/log_warnings_basic_32.result deleted file mode 100644 index 702e95b1383..00000000000 --- a/mysql-test/r/log_warnings_basic_32.result +++ /dev/null @@ -1,162 +0,0 @@ -SET @start_global_value = @@global.log_warnings; -SELECT @start_global_value; -@start_global_value -1 -SET @start_session_value = @@session.log_warnings; -SELECT @start_session_value; -@start_session_value -1 -'#--------------------FN_DYNVARS_067_01-------------------------#' -SET @@global.log_warnings = 100; -SET @@global.log_warnings = DEFAULT; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@session.log_warnings = 200; -SET @@session.log_warnings = DEFAULT; -SELECT @@session.log_warnings; -@@session.log_warnings -1 -'#--------------------FN_DYNVARS_067_02-------------------------#' -SET @@global.log_warnings = DEFAULT; -SELECT @@global.log_warnings = 1; -@@global.log_warnings = 1 -1 -SET @@session.log_warnings = DEFAULT; -SELECT @@session.log_warnings = 1; -@@session.log_warnings = 1 -1 -'#--------------------FN_DYNVARS_067_03-------------------------#' -SET @@global.log_warnings = 0; -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@global.log_warnings = 1; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@global.log_warnings = 60020; -SELECT @@global.log_warnings; -@@global.log_warnings -60020 -SET @@global.log_warnings = 65535; -SELECT @@global.log_warnings; -@@global.log_warnings -65535 -SET @@global.log_warnings = 65536; -SELECT @@global.log_warnings; -@@global.log_warnings -65536 -'#--------------------FN_DYNVARS_067_04-------------------------#' -SET @@session.log_warnings = 0; -SELECT @@session.log_warnings; -@@session.log_warnings -0 -SET @@session.log_warnings = 1; -SELECT @@session.log_warnings; -@@session.log_warnings -1 -SET @@session.log_warnings = 50050; -SELECT @@session.log_warnings; -@@session.log_warnings -50050 -SET @@session.log_warnings = 65535; -SELECT @@session.log_warnings; -@@session.log_warnings -65535 -SET @@session.log_warnings = 65550; -SELECT @@session.log_warnings; -@@session.log_warnings -65550 -'#------------------FN_DYNVARS_067_05-----------------------#' -SET @@global.log_warnings = 100000000000; -Warnings: -Warning 1292 Truncated incorrect log-warnings value: '100000000000' -SELECT @@global.log_warnings; -@@global.log_warnings -4294967295 -SET @@global.log_warnings = -1024; -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@global.log_warnings = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@global.log_warnings = test; -ERROR 42000: Incorrect argument type to variable 'log_warnings' -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@session.log_warnings = 100000000000; -Warnings: -Warning 1292 Truncated incorrect log-warnings value: '100000000000' -SELECT @@session.log_warnings; -@@session.log_warnings -4294967295 -SET @@session.log_warnings = -2; -SELECT @@session.log_warnings; -@@session.log_warnings -0 -SET @@session.log_warnings = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.log_warnings = test; -ERROR 42000: Incorrect argument type to variable 'log_warnings' -SELECT @@session.log_warnings; -@@session.log_warnings -0 -'#------------------FN_DYNVARS_067_06-----------------------#' -SELECT @@global.log_warnings = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log_warnings'; -@@global.log_warnings = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_067_07-----------------------#' -SELECT @@session.log_warnings = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='log_warnings'; -@@session.log_warnings = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_067_08-----------------------#' -SET @@global.log_warnings = TRUE; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@global.log_warnings = FALSE; -SELECT @@global.log_warnings; -@@global.log_warnings -0 -'#---------------------FN_DYNVARS_067_09----------------------#' -SET @@global.log_warnings = 10; -SELECT @@log_warnings = @@global.log_warnings; -@@log_warnings = @@global.log_warnings -0 -'#---------------------FN_DYNVARS_067_10----------------------#' -SET @@log_warnings = 100; -SELECT @@log_warnings = @@local.log_warnings; -@@log_warnings = @@local.log_warnings -1 -SELECT @@local.log_warnings = @@session.log_warnings; -@@local.log_warnings = @@session.log_warnings -1 -'#---------------------FN_DYNVARS_067_11----------------------#' -SET log_warnings = 1; -SELECT @@log_warnings; -@@log_warnings -1 -SELECT local.log_warnings; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.log_warnings; -ERROR 42S02: Unknown table 'session' in field list -SELECT log_warnings = @@session.log_warnings; -ERROR 42S22: Unknown column 'log_warnings' in 'field list' -SET @@global.log_warnings = @start_global_value; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@session.log_warnings = @start_session_value; -SELECT @@session.log_warnings; -@@session.log_warnings -1 diff --git a/mysql-test/r/max_binlog_cache_size_basic_32.result b/mysql-test/r/max_binlog_cache_size_basic_32.result deleted file mode 100644 index 1dbeb50ff90..00000000000 --- a/mysql-test/r/max_binlog_cache_size_basic_32.result +++ /dev/null @@ -1,145 +0,0 @@ -SET @start_value = @@global.max_binlog_cache_size; -SELECT @start_value; -@start_value -4294967295 -'#--------------------FN_DYNVARS_072_01------------------------#' -SET @@global.max_binlog_cache_size = 5000; -SET @@global.max_binlog_cache_size = DEFAULT; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -'#---------------------FN_DYNVARS_072_02-------------------------#' -SET @@global.max_binlog_cache_size = @start_value; -SELECT @@global.max_binlog_cache_size = 4294967295; -@@global.max_binlog_cache_size = 4294967295 -0 -'Bug# 34876: Incorrect Default Value is assigned to variable'; -'#--------------------FN_DYNVARS_072_03------------------------#' -SET @@global.max_binlog_cache_size = 4096; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 4294967295; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -SET @@global.max_binlog_cache_size = 4294967294; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -SET @@global.max_binlog_cache_size = 4097; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 65535; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -61440 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_072_04-------------------------#' -SET @@global.max_binlog_cache_size = -1; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 100000000000; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '100000000000' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -SET @@global.max_binlog_cache_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -SET @@global.max_binlog_cache_size = -1024; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 1024; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '1024' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 4294967296; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '4294967296' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -SET @@global.max_binlog_cache_size = 4095; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.max_binlog_cache_size = ON; -ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -'#-------------------FN_DYNVARS_072_05----------------------------#' -SET @@session.max_binlog_cache_size = 4096; -ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.max_binlog_cache_size; -ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable -'#----------------------FN_DYNVARS_072_06------------------------#' -SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_binlog_cache_size'; -@@global.max_binlog_cache_size = VARIABLE_VALUE -1 -SELECT @@max_binlog_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_binlog_cache_size'; -@@max_binlog_cache_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_072_07----------------------#' -SET @@global.max_binlog_cache_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '1' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -'#---------------------FN_DYNVARS_072_08----------------------#' -SET @@global.max_binlog_cache_size = 5000; -SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size; -@@max_binlog_cache_size = @@global.max_binlog_cache_size -1 -'#---------------------FN_DYNVARS_072_09----------------------#' -SET max_binlog_cache_size = 6000; -ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@max_binlog_cache_size; -@@max_binlog_cache_size -4096 -SET local.max_binlog_cache_size = 7000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1 -SELECT local.max_binlog_cache_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.max_binlog_cache_size = 8000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1 -SELECT global.max_binlog_cache_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT max_binlog_cache_size = @@session.max_binlog_cache_size; -ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list' -SET @@global.max_binlog_cache_size = @start_value; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 diff --git a/mysql-test/r/max_connect_errors_basic_32.result b/mysql-test/r/max_connect_errors_basic_32.result deleted file mode 100644 index b786e0ce31a..00000000000 --- a/mysql-test/r/max_connect_errors_basic_32.result +++ /dev/null @@ -1,137 +0,0 @@ -SET @start_value = @@global.max_connect_errors; -SELECT @start_value; -@start_value -10 -'#--------------------FN_DYNVARS_073_01------------------------#' -SET @@global.max_connect_errors = 5000; -SET @@global.max_connect_errors = DEFAULT; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -10 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#---------------------FN_DYNVARS_073_02-------------------------#' -SET @@global.max_connect_errors = @start_value; -SELECT @@global.max_connect_errors = 10; -@@global.max_connect_errors = 10 -1 -'#--------------------FN_DYNVARS_073_03------------------------#' -SET @@global.max_connect_errors = 4096; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4096 -SET @@global.max_connect_errors = 4294967294; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967294 -SET @@global.max_connect_errors = 4294967295; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967295 -SET @@global.max_connect_errors = 1; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 2; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -2 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_073_04-------------------------#' -SET @@global.max_connect_errors = -1; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 100000000000; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '100000000000' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967295 -SET @@global.max_connect_errors = 10000.01; -ERROR 42000: Incorrect argument type to variable 'max_connect_errors' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967295 -SET @@global.max_connect_errors = -1024; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 0; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 4294967296; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '4294967296' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.max_connect_errors = ON; -ERROR 42000: Incorrect argument type to variable 'max_connect_errors' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967295 -SET @@global.max_connect_errors = 'test'; -ERROR 42000: Incorrect argument type to variable 'max_connect_errors' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967295 -'#-------------------FN_DYNVARS_073_05----------------------------#' -SET @@session.max_connect_errors = 4096; -ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.max_connect_errors; -ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable -'#----------------------FN_DYNVARS_073_06------------------------#' -SELECT @@global.max_connect_errors = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_connect_errors'; -@@global.max_connect_errors = VARIABLE_VALUE -1 -SELECT @@max_connect_errors = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_connect_errors'; -@@max_connect_errors = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_073_07----------------------#' -SET @@global.max_connect_errors = TRUE; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -'#---------------------FN_DYNVARS_073_08----------------------#' -SET @@global.max_connect_errors = 5000; -SELECT @@max_connect_errors = @@global.max_connect_errors; -@@max_connect_errors = @@global.max_connect_errors -1 -'#---------------------FN_DYNVARS_073_09----------------------#' -SET max_connect_errors = 6000; -ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@max_connect_errors; -@@max_connect_errors -5000 -SET local.max_connect_errors = 7000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1 -SELECT local.max_connect_errors; -ERROR 42S02: Unknown table 'local' in field list -SET global.max_connect_errors = 8000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1 -SELECT global.max_connect_errors; -ERROR 42S02: Unknown table 'global' in field list -SELECT max_connect_errors = @@session.max_connect_errors; -ERROR 42S22: Unknown column 'max_connect_errors' in 'field list' -SET @@global.max_connect_errors = @start_value; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -10 diff --git a/mysql-test/r/max_heap_table_size_basic_32.result b/mysql-test/r/max_heap_table_size_basic_32.result deleted file mode 100644 index 04eaa3ddd19..00000000000 --- a/mysql-test/r/max_heap_table_size_basic_32.result +++ /dev/null @@ -1,196 +0,0 @@ -SET @start_global_value = @@global.max_heap_table_size; -SELECT @start_global_value; -@start_global_value -1048576 -SET @start_session_value = @@session.max_heap_table_size; -SELECT @start_session_value; -@start_session_value -1048576 -'#--------------------FN_DYNVARS_077_01-------------------------#' -SET @@global.max_heap_table_size = 1677721610; -SET @@global.max_heap_table_size = DEFAULT; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16777216 -SET @@session.max_heap_table_size = 1677721610; -SET @@session.max_heap_table_size = DEFAULT; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16777216 -'#--------------------FN_DYNVARS_077_02-------------------------#' -SET @@global.max_heap_table_size = DEFAULT; -SELECT @@global.max_heap_table_size = 16777216; -@@global.max_heap_table_size = 16777216 -1 -SET @@session.max_heap_table_size = DEFAULT; -SELECT @@session.max_heap_table_size = 16777216; -@@session.max_heap_table_size = 16777216 -1 -'#--------------------FN_DYNVARS_077_03-------------------------#' -SET @@global.max_heap_table_size = 16384; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 16385; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 65535; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -64512 -SET @@global.max_heap_table_size = 4294967294; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294966272 -SET @@global.max_heap_table_size = 4294967295; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_077_04-------------------------#' -SET @@session.max_heap_table_size = 16384; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 16385; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 65535; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -64512 -SET @@session.max_heap_table_size = 4294967294; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294966272 -SET @@session.max_heap_table_size = 4294967295; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_077_05-----------------------#' -SET @@global.max_heap_table_size = -1; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = -1024; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 1024; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '1024' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 16383; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '16383' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 4294967296; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294966272 -SET @@global.max_heap_table_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294966272 -SET @@global.max_heap_table_size = test; -ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294966272 -SET @@session.max_heap_table_size = -1; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 16383; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '16383' -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 4294967296; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294966272 -SET @@session.max_heap_table_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.max_heap_table_size = 10737418241; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294966272 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.max_heap_table_size = test; -ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294966272 -'#------------------FN_DYNVARS_077_06-----------------------#' -SELECT @@global.max_heap_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_heap_table_size'; -@@global.max_heap_table_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_077_07-----------------------#' -SELECT @@session.max_heap_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_heap_table_size'; -@@session.max_heap_table_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_077_08-----------------------#' -SET @@global.max_heap_table_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '1' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -'#---------------------FN_DYNVARS_077_09----------------------#' -SET @@global.max_heap_table_size = 163845; -SELECT @@max_heap_table_size = @@global.max_heap_table_size; -@@max_heap_table_size = @@global.max_heap_table_size -0 -'#---------------------FN_DYNVARS_077_10----------------------#' -SET @@max_heap_table_size = 16777216; -SELECT @@max_heap_table_size = @@local.max_heap_table_size; -@@max_heap_table_size = @@local.max_heap_table_size -1 -SELECT @@local.max_heap_table_size = @@session.max_heap_table_size; -@@local.max_heap_table_size = @@session.max_heap_table_size -1 -'#---------------------FN_DYNVARS_077_11----------------------#' -SET max_heap_table_size = 316777216; -SELECT @@max_heap_table_size; -@@max_heap_table_size -316776448 -SELECT local.max_heap_table_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.max_heap_table_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT max_heap_table_size = @@session.max_heap_table_size; -ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list' -SET @@global.max_heap_table_size = @start_global_value; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -1048576 -SET @@session.max_heap_table_size = @start_session_value; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -1048576 diff --git a/mysql-test/r/max_seeks_for_key_basic_32.result b/mysql-test/r/max_seeks_for_key_basic_32.result deleted file mode 100644 index 64828fbe619..00000000000 --- a/mysql-test/r/max_seeks_for_key_basic_32.result +++ /dev/null @@ -1,180 +0,0 @@ -SET @start_global_value = @@global.max_seeks_for_key; -SELECT @start_global_value; -@start_global_value -4294967295 -SET @start_session_value = @@session.max_seeks_for_key; -SELECT @start_session_value; -@start_session_value -4294967295 -'#--------------------FN_DYNVARS_083_01-------------------------#' -SET @@global.max_seeks_for_key = 100; -SET @@global.max_seeks_for_key = DEFAULT; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967295 -SET @@session.max_seeks_for_key = 200; -SET @@session.max_seeks_for_key = DEFAULT; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967295 -'#--------------------FN_DYNVARS_083_02-------------------------#' -SET @@global.max_seeks_for_key = DEFAULT; -SELECT @@global.max_seeks_for_key = 4294967295; -@@global.max_seeks_for_key = 4294967295 -1 -SET @@session.max_seeks_for_key = DEFAULT; -SELECT @@session.max_seeks_for_key = 4294967295; -@@session.max_seeks_for_key = 4294967295 -1 -'#--------------------FN_DYNVARS_083_03-------------------------#' -SET @@global.max_seeks_for_key = 1; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = 2; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -2 -SET @@global.max_seeks_for_key = 65536; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -65536 -SET @@global.max_seeks_for_key = 4294967295; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967295 -SET @@global.max_seeks_for_key = 4294967294; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967294 -'#--------------------FN_DYNVARS_083_04-------------------------#' -SET @@session.max_seeks_for_key = 1; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -1 -SET @@session.max_seeks_for_key = 2; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -2 -SET @@session.max_seeks_for_key = 4294967295; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967295 -SET @@session.max_seeks_for_key = 4294967294; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967294 -SET @@session.max_seeks_for_key = 65535; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -65535 -'#------------------FN_DYNVARS_083_05-----------------------#' -SET @@global.max_seeks_for_key = 0; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = -1024; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = 4294967296; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '4294967296' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967295 -SET @@global.max_seeks_for_key = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967295 -SET @@global.max_seeks_for_key = test; -ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967295 -SET @@session.max_seeks_for_key = 0; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -1 -SET @@session.max_seeks_for_key = -2; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -1 -SET @@session.max_seeks_for_key = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.max_seeks_for_key = 4294967296; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '4294967296' -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.max_seeks_for_key = test; -ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967295 -'#------------------FN_DYNVARS_083_06-----------------------#' -SELECT @@global.max_seeks_for_key = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_seeks_for_key'; -@@global.max_seeks_for_key = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_083_07-----------------------#' -SELECT @@session.max_seeks_for_key = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_seeks_for_key'; -@@session.max_seeks_for_key = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_083_08-----------------------#' -SET @@global.max_seeks_for_key = TRUE; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -'#---------------------FN_DYNVARS_083_09----------------------#' -SET @@global.max_seeks_for_key = 10; -SELECT @@max_seeks_for_key = @@global.max_seeks_for_key; -@@max_seeks_for_key = @@global.max_seeks_for_key -0 -'#---------------------FN_DYNVARS_083_10----------------------#' -SET @@max_seeks_for_key = 100; -SELECT @@max_seeks_for_key = @@local.max_seeks_for_key; -@@max_seeks_for_key = @@local.max_seeks_for_key -1 -SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key; -@@local.max_seeks_for_key = @@session.max_seeks_for_key -1 -'#---------------------FN_DYNVARS_083_11----------------------#' -SET max_seeks_for_key = 1; -SELECT @@max_seeks_for_key; -@@max_seeks_for_key -1 -SELECT local.max_seeks_for_key; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.max_seeks_for_key; -ERROR 42S02: Unknown table 'session' in field list -SELECT max_seeks_for_key = @@session.max_seeks_for_key; -ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list' -SET @@global.max_seeks_for_key = @start_global_value; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967295 -SET @@session.max_seeks_for_key = @start_session_value; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967295 diff --git a/mysql-test/r/max_tmp_tables_basic_32.result b/mysql-test/r/max_tmp_tables_basic_32.result deleted file mode 100644 index 5f959069661..00000000000 --- a/mysql-test/r/max_tmp_tables_basic_32.result +++ /dev/null @@ -1,197 +0,0 @@ -SET @start_global_value = @@global.max_tmp_tables; -SELECT @start_global_value; -@start_global_value -32 -SET @start_session_value = @@session.max_tmp_tables; -SELECT @start_session_value; -@start_session_value -32 -'#--------------------FN_DYNVARS_086_01-------------------------#' -SET @@global.max_tmp_tables = 1000; -SET @@global.max_tmp_tables = DEFAULT; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -32 -SET @@session.max_tmp_tables = 1000; -SET @@session.max_tmp_tables = DEFAULT; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -32 -'#--------------------FN_DYNVARS_086_02-------------------------#' -SET @@global.max_tmp_tables = DEFAULT; -SELECT @@global.max_tmp_tables = 32; -@@global.max_tmp_tables = 32 -1 -SET @@session.max_tmp_tables = DEFAULT; -SELECT @@session.max_tmp_tables = 32; -@@session.max_tmp_tables = 32 -1 -'#--------------------FN_DYNVARS_086_03-------------------------#' -SET @@global.max_tmp_tables = 1; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = 2; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -2 -SET @@global.max_tmp_tables = 65536; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -65536 -SET @@global.max_tmp_tables = 4294967295; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967295 -SET @@global.max_tmp_tables = 4294967294; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967294 -'#--------------------FN_DYNVARS_086_04-------------------------#' -SET @@session.max_tmp_tables = 1; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -1 -SET @@session.max_tmp_tables = 2; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -2 -SET @@session.max_tmp_tables = 65536; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -65536 -SET @@session.max_tmp_tables = 4294967295; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967295 -SET @@session.max_tmp_tables = 4294967294; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967294 -'#------------------FN_DYNVARS_086_05-----------------------#' -SET @@global.max_tmp_tables = -1024; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = 4294967296; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967295 -SET @@global.max_tmp_tables = -1; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = 429496729500; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967295 -SET @@global.max_tmp_tables = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967295 -SET @@global.max_tmp_tables = test; -ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967295 -SET @@session.max_tmp_tables = 4294967296; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967295 -SET @@session.max_tmp_tables = -1; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -1 -SET @@session.max_tmp_tables = 429496729500; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967295 -SET @@session.max_tmp_tables = -001; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -1 -SET @@session.max_tmp_tables = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.max_tmp_tables = 10737418241; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '10737418241' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967295 -SET @@session.max_tmp_tables = test; -ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967295 -'#------------------FN_DYNVARS_086_06-----------------------#' -SELECT @@global.max_tmp_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_tmp_tables'; -@@global.max_tmp_tables = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_086_07-----------------------#' -SELECT @@session.max_tmp_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_tmp_tables'; -@@session.max_tmp_tables = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_086_08-----------------------#' -SET @@global.max_tmp_tables = TRUE; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -'#---------------------FN_DYNVARS_086_09----------------------#' -SET @@global.max_tmp_tables = 20; -SELECT @@max_tmp_tables = @@global.max_tmp_tables; -@@max_tmp_tables = @@global.max_tmp_tables -0 -'#---------------------FN_DYNVARS_086_10----------------------#' -SET @@max_tmp_tables = 255; -SELECT @@max_tmp_tables = @@local.max_tmp_tables; -@@max_tmp_tables = @@local.max_tmp_tables -1 -SELECT @@local.max_tmp_tables = @@session.max_tmp_tables; -@@local.max_tmp_tables = @@session.max_tmp_tables -1 -'#---------------------FN_DYNVARS_086_11----------------------#' -SET max_tmp_tables = 102; -SELECT @@max_tmp_tables; -@@max_tmp_tables -102 -SELECT local.max_tmp_tables; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.max_tmp_tables; -ERROR 42S02: Unknown table 'session' in field list -SELECT max_tmp_tables = @@session.max_tmp_tables; -ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list' -SET @@global.max_tmp_tables = @start_global_value; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -32 -SET @@session.max_tmp_tables = @start_session_value; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -32 diff --git a/mysql-test/r/max_write_lock_count_basic_32.result b/mysql-test/r/max_write_lock_count_basic_32.result deleted file mode 100644 index 0c9c3c00c1f..00000000000 --- a/mysql-test/r/max_write_lock_count_basic_32.result +++ /dev/null @@ -1,108 +0,0 @@ -SET @start_global_value = @@global.max_write_lock_count; -SELECT @start_global_value; -@start_global_value -4294967295 -'#--------------------FN_DYNVARS_088_01-------------------------#' -SET @@global.max_write_lock_count = 1000; -SET @@global.max_write_lock_count = DEFAULT; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 -'#--------------------FN_DYNVARS_088_02-------------------------#' -SET @@global.max_write_lock_count = DEFAULT; -SELECT @@global.max_write_lock_count = 4294967295; -@@global.max_write_lock_count = 4294967295 -1 -'#--------------------FN_DYNVARS_088_03-------------------------#' -SET @@global.max_write_lock_count = 1; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = 2; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -2 -SET @@global.max_write_lock_count = 65536; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -65536 -SET @@global.max_write_lock_count = 4294967295; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 -SET @@global.max_write_lock_count = 4294967294; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967294 -'#------------------FN_DYNVARS_088_04-----------------------#' -SET @@global.max_write_lock_count = -1024; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '0' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = 4294967296; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '4294967296' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 -SET @@global.max_write_lock_count = -1; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '0' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = 429496729500; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '429496729500' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 -SET @@global.max_write_lock_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 -SET @@global.max_write_lock_count = test; -ERROR 42000: Incorrect argument type to variable 'max_write_lock_count' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 -'#------------------FN_DYNVARS_088_05-----------------------#' -SELECT @@global.max_write_lock_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_write_lock_count'; -@@global.max_write_lock_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_088_06-----------------------#' -SET @@global.max_write_lock_count = TRUE; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '0' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -'#---------------------FN_DYNVARS_088_07----------------------#' -SET @@global.max_write_lock_count = 20; -SELECT @@max_write_lock_count = @@global.max_write_lock_count; -@@max_write_lock_count = @@global.max_write_lock_count -1 -'#---------------------FN_DYNVARS_088_08----------------------#' -SET @@global.max_write_lock_count = 102; -SELECT @@max_write_lock_count; -@@max_write_lock_count -102 -SELECT local.max_write_lock_count; -ERROR 42S02: Unknown table 'local' in field list -SELECT global.max_write_lock_count; -ERROR 42S02: Unknown table 'global' in field list -SELECT max_write_lock_count = @@global.max_write_lock_count; -ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list' -SET @@global.max_write_lock_count = @start_global_value; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 diff --git a/mysql-test/r/min_examined_row_limit_basic_32.result b/mysql-test/r/min_examined_row_limit_basic_32.result deleted file mode 100644 index c0315944a8a..00000000000 --- a/mysql-test/r/min_examined_row_limit_basic_32.result +++ /dev/null @@ -1,180 +0,0 @@ -SET @start_global_value = @@global.min_examined_row_limit; -SELECT @start_global_value; -@start_global_value -0 -SET @start_session_value = @@session.min_examined_row_limit; -SELECT @start_session_value; -@start_session_value -0 -'#--------------------FN_DYNVARS_089_01-------------------------#' -SET @@global.min_examined_row_limit = 100; -SET @@global.min_examined_row_limit = DEFAULT; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = 200; -SET @@session.min_examined_row_limit = DEFAULT; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 -'#--------------------FN_DYNVARS_089_02-------------------------#' -SET @@global.min_examined_row_limit = DEFAULT; -SELECT @@global.min_examined_row_limit = 0; -@@global.min_examined_row_limit = 0 -1 -SET @@session.min_examined_row_limit = DEFAULT; -SELECT @@session.min_examined_row_limit = 0; -@@session.min_examined_row_limit = 0 -1 -'#--------------------FN_DYNVARS_089_03-------------------------#' -SET @@global.min_examined_row_limit = 0; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@global.min_examined_row_limit = 1; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -1 -SET @@global.min_examined_row_limit = 60020; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -60020 -SET @@global.min_examined_row_limit = 65535; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -65535 -SET @@global.min_examined_row_limit = 4294967295; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -4294967295 -SET @@global.min_examined_row_limit = 4294967294; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -4294967294 -'#--------------------FN_DYNVARS_089_04-------------------------#' -SET @@session.min_examined_row_limit = 0; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = 1; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -1 -SET @@session.min_examined_row_limit = 50050; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -50050 -SET @@session.min_examined_row_limit = 65535; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -65535 -SET @@session.min_examined_row_limit = 4294967295; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967295 -SET @@session.min_examined_row_limit = 4294967294; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967294 -'#------------------FN_DYNVARS_089_05-----------------------#' -SET @@global.min_examined_row_limit = 429496726; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -429496726 -SET @@global.min_examined_row_limit = -1024; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@global.min_examined_row_limit = 429496729500; -Warnings: -Warning 1292 Truncated incorrect min_examined_row_limit value: '429496729500' -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -4294967295 -SET @@global.min_examined_row_limit = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -4294967295 -SET @@global.min_examined_row_limit = test; -ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -4294967295 -SET @@session.min_examined_row_limit = 4294967296; -Warnings: -Warning 1292 Truncated incorrect min_examined_row_limit value: '4294967296' -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967295 -SET @@session.min_examined_row_limit = -1; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.min_examined_row_limit = 4294967295021; -Warnings: -Warning 1292 Truncated incorrect min_examined_row_limit value: '4294967295021' -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.min_examined_row_limit = test; -ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967295 -'#------------------FN_DYNVARS_089_06-----------------------#' -SELECT @@global.min_examined_row_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='min_examined_row_limit'; -@@global.min_examined_row_limit = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_089_07-----------------------#' -SELECT @@session.min_examined_row_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='min_examined_row_limit'; -@@session.min_examined_row_limit = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_089_08-----------------------#' -SET @@global.min_examined_row_limit = TRUE; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -1 -SET @@global.min_examined_row_limit = FALSE; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -'#---------------------FN_DYNVARS_089_09----------------------#' -SET @@global.min_examined_row_limit = 10; -SELECT @@min_examined_row_limit = @@global.min_examined_row_limit; -@@min_examined_row_limit = @@global.min_examined_row_limit -0 -'#---------------------FN_DYNVARS_089_10----------------------#' -SET @@min_examined_row_limit = 100; -SELECT @@min_examined_row_limit = @@local.min_examined_row_limit; -@@min_examined_row_limit = @@local.min_examined_row_limit -1 -SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit; -@@local.min_examined_row_limit = @@session.min_examined_row_limit -1 -'#---------------------FN_DYNVARS_089_11----------------------#' -SET min_examined_row_limit = 1; -SELECT @@min_examined_row_limit; -@@min_examined_row_limit -1 -SELECT local.min_examined_row_limit; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.min_examined_row_limit; -ERROR 42S02: Unknown table 'session' in field list -SELECT min_examined_row_limit = @@session.min_examined_row_limit; -ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list' -SET @@global.min_examined_row_limit = @start_global_value; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = @start_session_value; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 diff --git a/mysql-test/r/multi_range_count_basic_32.result b/mysql-test/r/multi_range_count_basic_32.result deleted file mode 100644 index f6ac6490479..00000000000 --- a/mysql-test/r/multi_range_count_basic_32.result +++ /dev/null @@ -1,192 +0,0 @@ -SET @start_global_value = @@global.multi_range_count; -SELECT @start_global_value; -@start_global_value -256 -SET @start_session_value = @@session.multi_range_count; -SELECT @start_session_value; -@start_session_value -256 -'#--------------------FN_DYNVARS_090_01-------------------------#' -SET @@global.multi_range_count = 100; -SET @@global.multi_range_count = DEFAULT; -SELECT @@global.multi_range_count; -@@global.multi_range_count -256 -SET @@session.multi_range_count = 200; -SET @@session.multi_range_count = DEFAULT; -SELECT @@session.multi_range_count; -@@session.multi_range_count -256 -'#--------------------FN_DYNVARS_090_02-------------------------#' -SET @@global.multi_range_count = DEFAULT; -SELECT @@global.multi_range_count = 256; -@@global.multi_range_count = 256 -1 -SET @@session.multi_range_count = DEFAULT; -SELECT @@session.multi_range_count = 256; -@@session.multi_range_count = 256 -1 -'#--------------------FN_DYNVARS_090_03-------------------------#' -SET @@global.multi_range_count = 1; -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = 60020; -SELECT @@global.multi_range_count; -@@global.multi_range_count -60020 -SET @@global.multi_range_count = 65535; -SELECT @@global.multi_range_count; -@@global.multi_range_count -65535 -SET @@global.multi_range_count = 4294967295; -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967295 -SET @@global.multi_range_count = 4294967294; -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967294 -'#--------------------FN_DYNVARS_090_04-------------------------#' -SET @@session.multi_range_count = 1; -SELECT @@session.multi_range_count; -@@session.multi_range_count -1 -SET @@session.multi_range_count = 50050; -SELECT @@session.multi_range_count; -@@session.multi_range_count -50050 -SET @@session.multi_range_count = 65535; -SELECT @@session.multi_range_count; -@@session.multi_range_count -65535 -SET @@session.multi_range_count = 4294967295; -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967295 -SET @@session.multi_range_count = 4294967294; -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967294 -'#------------------FN_DYNVARS_090_05-----------------------#' -SET @@global.multi_range_count = 0; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = 4294967296; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '4294967296' -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967295 -SET @@global.multi_range_count = -1024; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = 429496729500; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '429496729500' -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967295 -SET @@global.multi_range_count = 65530.34; -ERROR 42000: Incorrect argument type to variable 'multi_range_count' -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967295 -SET @@global.multi_range_count = test; -ERROR 42000: Incorrect argument type to variable 'multi_range_count' -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967295 -SET @@session.multi_range_count = 0; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@session.multi_range_count; -@@session.multi_range_count -1 -SET @@session.multi_range_count = 4294967296; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '4294967296' -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967295 -SET @@session.multi_range_count = -1; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@session.multi_range_count; -@@session.multi_range_count -1 -SET @@session.multi_range_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.multi_range_count = 4294967295021; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '4294967295021' -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.multi_range_count = test; -ERROR 42000: Incorrect argument type to variable 'multi_range_count' -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967295 -'#------------------FN_DYNVARS_090_06-----------------------#' -SELECT @@global.multi_range_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='multi_range_count'; -@@global.multi_range_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_090_07-----------------------#' -SELECT @@session.multi_range_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='multi_range_count'; -@@session.multi_range_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_090_08-----------------------#' -SET @@global.multi_range_count = TRUE; -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = FALSE; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -'#---------------------FN_DYNVARS_090_09----------------------#' -SET @@global.multi_range_count = 10; -SELECT @@multi_range_count = @@global.multi_range_count; -@@multi_range_count = @@global.multi_range_count -0 -'#---------------------FN_DYNVARS_090_10----------------------#' -SET @@multi_range_count = 100; -SELECT @@multi_range_count = @@local.multi_range_count; -@@multi_range_count = @@local.multi_range_count -1 -SELECT @@local.multi_range_count = @@session.multi_range_count; -@@local.multi_range_count = @@session.multi_range_count -1 -'#---------------------FN_DYNVARS_090_11----------------------#' -SET multi_range_count = 1; -SELECT @@multi_range_count; -@@multi_range_count -1 -SELECT local.multi_range_count; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.multi_range_count; -ERROR 42S02: Unknown table 'session' in field list -SELECT multi_range_count = @@session.multi_range_count; -ERROR 42S22: Unknown column 'multi_range_count' in 'field list' -SET @@global.multi_range_count = @start_global_value; -SELECT @@global.multi_range_count; -@@global.multi_range_count -256 -SET @@session.multi_range_count = @start_session_value; -SELECT @@session.multi_range_count; -@@session.multi_range_count -256 diff --git a/mysql-test/r/myisam_max_sort_file_size_basic_32.result b/mysql-test/r/myisam_max_sort_file_size_basic_32.result deleted file mode 100644 index 64d1168685c..00000000000 --- a/mysql-test/r/myisam_max_sort_file_size_basic_32.result +++ /dev/null @@ -1,114 +0,0 @@ -SET @start_global_value = @@global.myisam_max_sort_file_size; -SELECT @start_global_value; -@start_global_value -2147483647 -'#--------------------FN_DYNVARS_094_01-------------------------#' -SET @@global.myisam_max_sort_file_size = 500000; -SET @@global.myisam_max_sort_file_size = DEFAULT; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -2146435072 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_094_02-------------------------#' -SET @@global.myisam_max_sort_file_size = DEFAULT; -SELECT @@global.myisam_max_sort_file_size = 2147483648; -@@global.myisam_max_sort_file_size = 2147483648 -0 -'#--------------------FN_DYNVARS_094_03-------------------------#' -SET @@global.myisam_max_sort_file_size = 0; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 1024; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 123456789; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -122683392 -SET @@global.myisam_max_sort_file_size = 2147483648*2; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -4294967296 -SET @@global.myisam_max_sort_file_size = 2147483648*1024; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -2199023255552 -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -2199023255552 -SET @@global.myisam_max_sort_file_size = 2147483648*2147483648; -'#--------------------FN_DYNVARS_094_04-------------------------#' -SET @@myisam_max_sort_file_size = 2; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.myisam_max_sort_file_size = 3; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.myisam_max_sort_file_size = 4; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_094_05-----------------------#' -SET @@global.myisam_max_sort_file_size = -1; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = -2147483648; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = -2147483649; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 2147483649.56; -ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 1G; -ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -'#------------------FN_DYNVARS_094_06-----------------------#' -SET @@global.myisam_max_sort_file_size = 3000; -SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_max_sort_file_size'; -@@global.myisam_max_sort_file_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_094_07-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_max_sort_file_size'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_094_08-----------------------#' -SET @@global.myisam_max_sort_file_size = TRUE; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = FALSE; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.myisam_max_sort_file_size = 512; -SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size; -@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET myisam_max_sort_file_size = 2048; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT myisam_max_sort_file_size; -ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list' -SELECT @@myisam_max_sort_file_size; -@@myisam_max_sort_file_size -0 -SET global myisam_max_sort_file_size = 64; -SET @@global.myisam_max_sort_file_size = @start_global_value; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -2146435072 diff --git a/mysql-test/r/myisam_repair_threads_basic_32.result b/mysql-test/r/myisam_repair_threads_basic_32.result deleted file mode 100644 index c91128e3f4c..00000000000 --- a/mysql-test/r/myisam_repair_threads_basic_32.result +++ /dev/null @@ -1,180 +0,0 @@ -SET @start_global_value = @@global.myisam_repair_threads; -SELECT @start_global_value; -@start_global_value -1 -SET @start_session_value = @@session.myisam_repair_threads; -SELECT @start_session_value; -@start_session_value -1 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.myisam_repair_threads = 100; -SET @@global.myisam_repair_threads = DEFAULT; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = 200; -SET @@session.myisam_repair_threads = DEFAULT; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.myisam_repair_threads = DEFAULT; -SELECT @@global.myisam_repair_threads = 1; -@@global.myisam_repair_threads = 1 -1 -SET @@session.myisam_repair_threads = DEFAULT; -SELECT @@session.myisam_repair_threads = 1; -@@session.myisam_repair_threads = 1 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.myisam_repair_threads = 1; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = 4294967295; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@global.myisam_repair_threads = 655354; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -655354 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.myisam_repair_threads = 1; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = 4294967295; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -4294967295 -SET @@session.myisam_repair_threads = 655345; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -655345 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.myisam_repair_threads = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = -1024; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = 429496729533; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '429496729533' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@global.myisam_repair_threads = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@global.myisam_repair_threads = test; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@global.myisam_repair_threads = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@global.myisam_repair_threads = 'test'; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@global.myisam_repair_threads = ON; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@session.myisam_repair_threads = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = -2; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = test; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.myisam_repair_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_repair_threads '; -@@global.myisam_repair_threads = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.myisam_repair_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_repair_threads '; -@@session.myisam_repair_threads = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_08-----------------------#' -SET @@global.myisam_repair_threads = TRUE; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = FALSE; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.myisam_repair_threads = 10; -SELECT @@myisam_repair_threads = @@global.myisam_repair_threads ; -@@myisam_repair_threads = @@global.myisam_repair_threads -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@myisam_repair_threads = 100; -SELECT @@myisam_repair_threads = @@local.myisam_repair_threads ; -@@myisam_repair_threads = @@local.myisam_repair_threads -1 -SELECT @@local.myisam_repair_threads = @@session.myisam_repair_threads ; -@@local.myisam_repair_threads = @@session.myisam_repair_threads -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET myisam_repair_threads = 1; -SELECT @@myisam_repair_threads ; -@@myisam_repair_threads -1 -SELECT local.myisam_repair_threads ; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.myisam_repair_threads ; -ERROR 42S02: Unknown table 'session' in field list -SELECT myisam_repair_threads = @@session.myisam_repair_threads ; -ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list' -SET @@global.myisam_repair_threads = @start_global_value; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = @start_session_value; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 diff --git a/mysql-test/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/r/myisam_sort_buffer_size_basic_32.result deleted file mode 100644 index 74d2fb3ec86..00000000000 --- a/mysql-test/r/myisam_sort_buffer_size_basic_32.result +++ /dev/null @@ -1,184 +0,0 @@ -SET @start_global_value = @@global.myisam_sort_buffer_size ; -SELECT @start_global_value; -@start_global_value -8388608 -SET @start_session_value = @@session.myisam_sort_buffer_size ; -SELECT @start_session_value; -@start_session_value -8388608 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.myisam_sort_buffer_size = 100; -SET @@global.myisam_sort_buffer_size = DEFAULT; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -8388608 -SET @@session.myisam_sort_buffer_size = 200; -SET @@session.myisam_sort_buffer_size = DEFAULT; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -8388608 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.myisam_sort_buffer_size = DEFAULT; -SELECT @@global.myisam_sort_buffer_size = 8388608; -@@global.myisam_sort_buffer_size = 8388608 -1 -SET @@session.myisam_sort_buffer_size = DEFAULT; -SELECT @@session.myisam_sort_buffer_size = 8388608; -@@session.myisam_sort_buffer_size = 8388608 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.myisam_sort_buffer_size = 4; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = 4294967295; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@global.myisam_sort_buffer_size = 655354; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -655354 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.myisam_sort_buffer_size = 4; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = 4294967295; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4294967295 -SET @@session.myisam_sort_buffer_size = 655345; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -655345 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.myisam_sort_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = -1024; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = 429496729533; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '429496729533' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@global.myisam_sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@global.myisam_sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@global.myisam_sort_buffer_size = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@global.myisam_sort_buffer_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@global.myisam_sort_buffer_size = ON; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@session.myisam_sort_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = -2; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_sort_buffer_size '; -@@global.myisam_sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_sort_buffer_size '; -@@session.myisam_sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_08-----------------------#' -SET @@global.myisam_sort_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.myisam_sort_buffer_size = 10; -SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; -@@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@myisam_sort_buffer_size = 100; -SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; -@@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size -1 -SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; -@@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET myisam_sort_buffer_size = 1; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' -SELECT @@myisam_sort_buffer_size ; -@@myisam_sort_buffer_size -4 -SELECT local.myisam_sort_buffer_size ; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.myisam_sort_buffer_size ; -ERROR 42S02: Unknown table 'session' in field list -SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; -ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list' -SET @@global.myisam_sort_buffer_size = @start_global_value; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -8388608 -SET @@session.myisam_sort_buffer_size = @start_session_value; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -8388608 diff --git a/mysql-test/r/net_retry_count_basic_32.result b/mysql-test/r/net_retry_count_basic_32.result deleted file mode 100644 index 3923df539e7..00000000000 --- a/mysql-test/r/net_retry_count_basic_32.result +++ /dev/null @@ -1,192 +0,0 @@ -SET @start_global_value = @@global.net_retry_count; -SELECT @start_global_value; -@start_global_value -10 -SET @start_session_value = @@session.net_retry_count; -SELECT @start_session_value; -@start_session_value -10 -'#--------------------FN_DYNVARS_111_01-------------------------#' -SET @@global.net_retry_count = 100; -SET @@global.net_retry_count = DEFAULT; -SELECT @@global.net_retry_count; -@@global.net_retry_count -10 -SET @@session.net_retry_count = 200; -SET @@session.net_retry_count = DEFAULT; -SELECT @@session.net_retry_count; -@@session.net_retry_count -10 -'#--------------------FN_DYNVARS_111_02-------------------------#' -SET @@global.net_retry_count = DEFAULT; -SELECT @@global.net_retry_count = 10; -@@global.net_retry_count = 10 -1 -SET @@session.net_retry_count = DEFAULT; -SELECT @@session.net_retry_count = 10; -@@session.net_retry_count = 10 -1 -'#--------------------FN_DYNVARS_111_03-------------------------#' -SET @@global.net_retry_count = 1; -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = 2; -SELECT @@global.net_retry_count; -@@global.net_retry_count -2 -SET @@global.net_retry_count = 4294967295; -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967295 -SET @@global.net_retry_count = 4294967294; -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967294 -SET @@global.net_retry_count = 65536; -SELECT @@global.net_retry_count; -@@global.net_retry_count -65536 -'#--------------------FN_DYNVARS_111_04-------------------------#' -SET @@session.net_retry_count = 1; -SELECT @@session.net_retry_count; -@@session.net_retry_count -1 -SET @@session.net_retry_count = 2; -SELECT @@session.net_retry_count; -@@session.net_retry_count -2 -SET @@session.net_retry_count = 65535; -SELECT @@session.net_retry_count; -@@session.net_retry_count -65535 -SET @@session.net_retry_count = 4294967295; -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967295 -SET @@session.net_retry_count = 4294967294; -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967294 -'#------------------FN_DYNVARS_111_05-----------------------#' -SET @@global.net_retry_count = 0; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = -1024; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = 4294967296; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '4294967296' -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967295 -SET @@global.net_retry_count = 429496729500; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '429496729500' -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967295 -SET @@global.net_retry_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967295 -SET @@global.net_retry_count = test; -ERROR 42000: Incorrect argument type to variable 'net_retry_count' -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967295 -SET @@session.net_retry_count = 0; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@session.net_retry_count; -@@session.net_retry_count -1 -SET @@session.net_retry_count = -2; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@session.net_retry_count; -@@session.net_retry_count -1 -SET @@session.net_retry_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.net_retry_count = 6555015425; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '6555015425' -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967295 -SET @@session.net_retry_count = 4294967296; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '4294967296' -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.net_retry_count = test; -ERROR 42000: Incorrect argument type to variable 'net_retry_count' -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967295 -'#------------------FN_DYNVARS_111_06-----------------------#' -SELECT @@global.net_retry_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='net_retry_count'; -@@global.net_retry_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_111_07-----------------------#' -SELECT @@session.net_retry_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='net_retry_count'; -@@session.net_retry_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_111_08-----------------------#' -SET @@global.net_retry_count = TRUE; -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = FALSE; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -'#---------------------FN_DYNVARS_111_09----------------------#' -SET @@global.net_retry_count = 10; -SELECT @@net_retry_count = @@global.net_retry_count; -@@net_retry_count = @@global.net_retry_count -0 -'#---------------------FN_DYNVARS_111_10----------------------#' -SET @@net_retry_count = 100; -SELECT @@net_retry_count = @@local.net_retry_count; -@@net_retry_count = @@local.net_retry_count -1 -SELECT @@local.net_retry_count = @@session.net_retry_count; -@@local.net_retry_count = @@session.net_retry_count -1 -'#---------------------FN_DYNVARS_111_11----------------------#' -SET net_retry_count = 1; -SELECT @@net_retry_count; -@@net_retry_count -1 -SELECT local.net_retry_count; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.net_retry_count; -ERROR 42S02: Unknown table 'session' in field list -SELECT net_retry_count = @@session.net_retry_count; -ERROR 42S22: Unknown column 'net_retry_count' in 'field list' -SET @@global.net_retry_count = @start_global_value; -SELECT @@global.net_retry_count; -@@global.net_retry_count -10 -SET @@session.net_retry_count = @start_session_value; -SELECT @@session.net_retry_count; -@@session.net_retry_count -10 diff --git a/mysql-test/r/query_alloc_block_size_basic_32.result b/mysql-test/r/query_alloc_block_size_basic_32.result deleted file mode 100644 index 3b7f06c8f81..00000000000 --- a/mysql-test/r/query_alloc_block_size_basic_32.result +++ /dev/null @@ -1,203 +0,0 @@ -SET @start_global_value = @@global.query_alloc_block_size; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.query_alloc_block_size; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_130_01-------------------------#' -SET @@global.query_alloc_block_size = 10000; -SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -8192 -SET @@session.query_alloc_block_size = 20000; -SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -8192 -'#--------------------FN_DYNVARS_130_02-------------------------#' -SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size = 8192; -@@global.query_alloc_block_size = 8192 -1 -SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size = 8192; -@@session.query_alloc_block_size = 8192 -1 -'#--------------------FN_DYNVARS_130_03-------------------------#' -SET @@global.query_alloc_block_size = 1024; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 1025; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 4294967295; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294966272 -SET @@global.query_alloc_block_size = 4294967294; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294966272 -SET @@global.query_alloc_block_size = 65536; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -65536 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_130_04-------------------------#' -SET @@session.query_alloc_block_size = 1024; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 1025; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 4294967295; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294966272 -SET @@session.query_alloc_block_size = 4294967294; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294966272 -SET @@session.query_alloc_block_size = 655536; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -655360 -'#------------------FN_DYNVARS_130_05-----------------------#' -SET @@global.query_alloc_block_size = 64; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '64' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = -1; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '0' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 1023; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 4294967296; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967296' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294966272 -SET @@global.query_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294966272 -SET @@global.query_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294966272 -SET @@session.query_alloc_block_size = 64; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '64' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = -2; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '0' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.query_alloc_block_size = 1023; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 4294967296; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967296' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294966272 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.query_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294966272 -'#------------------FN_DYNVARS_130_06-----------------------#' -'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement'; -SET @@global.query_alloc_block_size = 1; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1' -SET @@session.query_alloc_block_size = 12; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '12' -SELECT @@global.query_alloc_block_size = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_alloc_block_size'; -@@global.query_alloc_block_size = -VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_130_07-----------------------#' -SELECT @@session.query_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_alloc_block_size'; -@@session.query_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_130_08-----------------------#' -SET @@global.query_alloc_block_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '0' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -'#---------------------FN_DYNVARS_130_09----------------------#' -SET @@global.query_alloc_block_size = 2048; -SELECT @@query_alloc_block_size = @@global.query_alloc_block_size; -@@query_alloc_block_size = @@global.query_alloc_block_size -0 -'#---------------------FN_DYNVARS_130_10----------------------#' -SET @@query_alloc_block_size = 5000; -SELECT @@query_alloc_block_size = @@local.query_alloc_block_size; -@@query_alloc_block_size = @@local.query_alloc_block_size -1 -SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size; -@@local.query_alloc_block_size = @@session.query_alloc_block_size -1 -'#---------------------FN_DYNVARS_130_11----------------------#' -SET query_alloc_block_size = 1024; -SELECT @@query_alloc_block_size; -@@query_alloc_block_size -1024 -SELECT local.query_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.query_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT query_alloc_block_size = @@session.query_alloc_block_size; -ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list' -SET @@global.query_alloc_block_size = @start_global_value; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -8192 -SET @@session.query_alloc_block_size = @start_session_value; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -8192 diff --git a/mysql-test/r/query_cache_limit_basic_32.result b/mysql-test/r/query_cache_limit_basic_32.result deleted file mode 100644 index bb66233732d..00000000000 --- a/mysql-test/r/query_cache_limit_basic_32.result +++ /dev/null @@ -1,126 +0,0 @@ -SET @start_value = @@global.query_cache_limit; -SELECT @start_value; -@start_value -1048576 -'#--------------------FN_DYNVARS_131_01------------------------#' -SET @@global.query_cache_limit = 99; -SET @@global.query_cache_limit = DEFAULT; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048576 -'#---------------------FN_DYNVARS_131_02-------------------------#' -SET @@global.query_cache_limit = @start_value; -SELECT @@global.query_cache_limit = 1048576; -@@global.query_cache_limit = 1048576 -1 -'#--------------------FN_DYNVARS_131_03------------------------#' -SET @@global.query_cache_limit = 0; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -SET @@global.query_cache_limit = 1; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1 -SET @@global.query_cache_limit = 1048576; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048576 -SET @@global.query_cache_limit = 1048575; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048575 -'#--------------------FN_DYNVARS_131_04-------------------------#' -SET @@global.query_cache_limit = -1; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -SET @@global.query_cache_limit = 4294967296; -Warnings: -Warning 1292 Truncated incorrect query_cache_limit value: '4294967296' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -4294967295 -SET @@global.query_cache_limit = 10240022115; -Warnings: -Warning 1292 Truncated incorrect query_cache_limit value: '10240022115' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -4294967295 -SET @@global.query_cache_limit = 10000.01; -ERROR 42000: Incorrect argument type to variable 'query_cache_limit' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -4294967295 -SET @@global.query_cache_limit = -1024; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -SET @@global.query_cache_limit = 42949672950; -Warnings: -Warning 1292 Truncated incorrect query_cache_limit value: '42949672950' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.query_cache_limit = ON; -ERROR 42000: Incorrect argument type to variable 'query_cache_limit' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -4294967295 -SET @@global.query_cache_limit = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_cache_limit' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -4294967295 -'#-------------------FN_DYNVARS_131_05----------------------------#' -SET @@session.query_cache_limit = 0; -ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_limit; -@@query_cache_limit -4294967295 -'#----------------------FN_DYNVARS_131_06------------------------#' -SELECT @@global.query_cache_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_limit'; -@@global.query_cache_limit = VARIABLE_VALUE -1 -SELECT @@query_cache_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_limit'; -@@query_cache_limit = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_131_07----------------------#' -SET @@global.query_cache_limit = TRUE; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1 -SET @@global.query_cache_limit = FALSE; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -'#---------------------FN_DYNVARS_131_08----------------------#' -SET @@global.query_cache_limit = 1; -SELECT @@query_cache_limit = @@global.query_cache_limit; -@@query_cache_limit = @@global.query_cache_limit -1 -'#---------------------FN_DYNVARS_131_09----------------------#' -SET query_cache_limit = 1; -ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_limit; -@@query_cache_limit -1 -SET local.query_cache_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 -SELECT local.query_cache_limit; -ERROR 42S02: Unknown table 'local' in field list -SET global.query_cache_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 -SELECT global.query_cache_limit; -ERROR 42S02: Unknown table 'global' in field list -SELECT query_cache_limit = @@session.query_cache_limit; -ERROR 42S22: Unknown column 'query_cache_limit' in 'field list' -SET @@global.query_cache_limit = @start_value; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048576 diff --git a/mysql-test/r/query_cache_min_res_unit_basic_32.result b/mysql-test/r/query_cache_min_res_unit_basic_32.result deleted file mode 100644 index e0d8a0d2a30..00000000000 --- a/mysql-test/r/query_cache_min_res_unit_basic_32.result +++ /dev/null @@ -1,134 +0,0 @@ -SET @start_value = @@global.query_cache_min_res_unit; -SELECT @start_value; -@start_value -4096 -'#--------------------FN_DYNVARS_132_01------------------------#' -SET @@global.query_cache_min_res_unit = 99; -SET @@global.query_cache_min_res_unit = DEFAULT; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -4096 -'#---------------------FN_DYNVARS_132_02-------------------------#' -SET @@global.query_cache_min_res_unit = @start_value; -SELECT @@global.query_cache_min_res_unit = 4096; -@@global.query_cache_min_res_unit = 4096 -1 -'#--------------------FN_DYNVARS_132_03------------------------#' -SET @@global.query_cache_min_res_unit = 0; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 1; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512'; -SET @@global.query_cache_min_res_unit = 512; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 513; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -520 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.query_cache_min_res_unit = 1048576; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -1048576 -SET @@global.query_cache_min_res_unit = 1048575; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -1048576 -'#--------------------FN_DYNVARS_132_04-------------------------#' -SET @@global.query_cache_min_res_unit = -1; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 4294967296; -Warnings: -Warning 1292 Truncated incorrect query_cache_min_res_unit value: '4294967296' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -0 -SET @@global.query_cache_min_res_unit = 511; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 10000.01; -ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = -1024; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 42949672950; -Warnings: -Warning 1292 Truncated incorrect query_cache_min_res_unit value: '42949672950' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -0 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.query_cache_min_res_unit = ON; -ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -0 -SET @@global.query_cache_min_res_unit = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -0 -'#-------------------FN_DYNVARS_132_05----------------------------#' -SET @@session.query_cache_min_res_unit = 0; -ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_min_res_unit; -@@query_cache_min_res_unit -0 -'#----------------------FN_DYNVARS_132_06------------------------#' -SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_min_res_unit'; -@@global.query_cache_min_res_unit = VARIABLE_VALUE -1 -SELECT @@query_cache_min_res_unit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_min_res_unit'; -@@query_cache_min_res_unit = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_132_07----------------------#' -SET @@global.query_cache_min_res_unit = TRUE; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = FALSE; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -'#---------------------FN_DYNVARS_132_08----------------------#' -SET @@global.query_cache_min_res_unit = 1; -SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit; -@@query_cache_min_res_unit = @@global.query_cache_min_res_unit -1 -'#---------------------FN_DYNVARS_132_09----------------------#' -SET query_cache_min_res_unit = 1; -ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_min_res_unit; -@@query_cache_min_res_unit -512 -SET local.query_cache_min_res_unit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 -SELECT local.query_cache_min_res_unit; -ERROR 42S02: Unknown table 'local' in field list -SET global.query_cache_min_res_unit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 -SELECT global.query_cache_min_res_unit; -ERROR 42S02: Unknown table 'global' in field list -SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit; -ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list' -SET @@global.query_cache_min_res_unit = @start_value; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -4096 diff --git a/mysql-test/r/query_cache_size_basic_32.result b/mysql-test/r/query_cache_size_basic_32.result deleted file mode 100644 index 1af70b3af84..00000000000 --- a/mysql-test/r/query_cache_size_basic_32.result +++ /dev/null @@ -1,138 +0,0 @@ -SET @start_value = @@global.query_cache_size; -SELECT @start_value; -@start_value -0 -'#--------------------FN_DYNVARS_133_01------------------------#' -SET @@global.query_cache_size = 99; -SET @@global.query_cache_size = DEFAULT; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'#---------------------FN_DYNVARS_133_02-------------------------#' -SET @@global.query_cache_size = @start_value; -SELECT @@global.query_cache_size = 0; -@@global.query_cache_size = 0 -1 -'#--------------------FN_DYNVARS_133_03------------------------#' -SET @@global.query_cache_size = 0; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 1; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 512; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 1024; -Warnings: -Warning 1282 Query cache failed to set size 1024; new query cache size is 0 -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -: 'Bug#34880: Warnings are coming on assinging valid values to variable -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.query_cache_size = 1048576; -SELECT @@global.query_cache_size; -@@global.query_cache_size -1048576 -SET @@global.query_cache_size = 1048575; -SELECT @@global.query_cache_size; -@@global.query_cache_size -1047552 -'#--------------------FN_DYNVARS_133_04-------------------------#' -SET @@global.query_cache_size = -1; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 4294967296; -Warnings: -Warning 1292 Truncated incorrect query_cache_size value: '4294967296' -Warning 1282 Query cache failed to set size 4294966272; new query cache size is 0 -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 511; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'query_cache_size' -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = -1024; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 42949672950; -Warnings: -Warning 1292 Truncated incorrect query_cache_size value: '42949672950' -Warning 1282 Query cache failed to set size 4294966272; new query cache size is 0 -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.query_cache_size = ON; -ERROR 42000: Incorrect argument type to variable 'query_cache_size' -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_cache_size' -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'#-------------------FN_DYNVARS_133_05----------------------------#' -SET @@session.query_cache_size = 0; -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_size; -@@query_cache_size -0 -'#----------------------FN_DYNVARS_133_06------------------------#' -SELECT @@global.query_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; -@@global.query_cache_size = VARIABLE_VALUE -1 -SELECT @@query_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; -@@query_cache_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_133_07----------------------#' -SET @@global.query_cache_size = TRUE; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = FALSE; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'#---------------------FN_DYNVARS_133_08----------------------#' -SET @@global.query_cache_size = 1; -SELECT @@query_cache_size = @@global.query_cache_size; -@@query_cache_size = @@global.query_cache_size -1 -'#---------------------FN_DYNVARS_133_09----------------------#' -SET query_cache_size = 1; -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_size; -@@query_cache_size -0 -SET local.query_cache_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 -SELECT local.query_cache_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.query_cache_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 -SELECT global.query_cache_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT query_cache_size = @@session.query_cache_size; -ERROR 42S22: Unknown column 'query_cache_size' in 'field list' -SET @@global.query_cache_size = @start_value; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 diff --git a/mysql-test/r/query_prealloc_size_basic_32.result b/mysql-test/r/query_prealloc_size_basic_32.result deleted file mode 100644 index fe8aba990a7..00000000000 --- a/mysql-test/r/query_prealloc_size_basic_32.result +++ /dev/null @@ -1,178 +0,0 @@ -SET @start_global_value = @@global.query_prealloc_size ; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.query_prealloc_size ; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.query_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '100' -SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 200; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '200' -SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size = 8192; -@@global.query_prealloc_size = 8192 -1 -SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size = 8192; -@@session.query_prealloc_size = 8192 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.query_prealloc_size = 8192; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = 655354; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -654336 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.query_prealloc_size = 8192; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 655345; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -654336 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.query_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = -1024; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = test; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = "test"; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = -2; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = test; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = "test"; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_prealloc_size '; -@@global.query_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_prealloc_size '; -@@session.query_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_08-----------------------#' -SET @@global.query_prealloc_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '1' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.query_prealloc_size = 10; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '10' -SELECT @@query_prealloc_size = @@global.query_prealloc_size ; -@@query_prealloc_size = @@global.query_prealloc_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@query_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '100' -SELECT @@query_prealloc_size = @@local.query_prealloc_size ; -@@query_prealloc_size = @@local.query_prealloc_size -1 -SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ; -@@local.query_prealloc_size = @@session.query_prealloc_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET query_prealloc_size = 1; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '1' -SELECT @@query_prealloc_size ; -@@query_prealloc_size -8192 -SELECT local.query_prealloc_size ; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.query_prealloc_size ; -ERROR 42S02: Unknown table 'session' in field list -SELECT query_prealloc_size = @@session.query_prealloc_size ; -ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list' -SET @@global.query_prealloc_size = @start_global_value; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@session.query_prealloc_size = @start_session_value; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 diff --git a/mysql-test/r/range_alloc_block_size_basic_32.result b/mysql-test/r/range_alloc_block_size_basic_32.result deleted file mode 100644 index 93441448d90..00000000000 --- a/mysql-test/r/range_alloc_block_size_basic_32.result +++ /dev/null @@ -1,182 +0,0 @@ -SET @start_global_value = @@global.range_alloc_block_size; -SELECT @start_global_value; -@start_global_value -4096 -SET @start_session_value = @@session.range_alloc_block_size; -SELECT @start_session_value; -@start_session_value -4096 -'#--------------------FN_DYNVARS_137_01-------------------------#' -SET @@global.range_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '100' -SET @@global.range_alloc_block_size = DEFAULT; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = 200; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '200' -SET @@session.range_alloc_block_size = DEFAULT; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -'#--------------------FN_DYNVARS_137_02-------------------------#' -SET @@global.range_alloc_block_size = DEFAULT; -SELECT @@global.range_alloc_block_size = 2048; -@@global.range_alloc_block_size = 2048 -0 -SET @@session.range_alloc_block_size = DEFAULT; -SELECT @@session.range_alloc_block_size = 2048; -@@session.range_alloc_block_size = 2048 -0 -'#--------------------FN_DYNVARS_137_03-------------------------#' -SET @@global.range_alloc_block_size = 2048; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.range_alloc_block_size = 4294967295; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4294966272 -SET @@global.range_alloc_block_size = 4294967294; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_137_04-------------------------#' -SET @@session.range_alloc_block_size = 2048; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = 4294967295; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294966272 -SET @@session.range_alloc_block_size = 4294967294; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294966272 -'#------------------FN_DYNVARS_137_05-----------------------#' -SET @@global.range_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@global.range_alloc_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@global.range_alloc_block_size = 42949672951; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '42949672951' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4294966272 -SET @@global.range_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4294966272 -SET @@global.range_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4294966272 -SET @@session.range_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = -2; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.range_alloc_block_size = 4294967296; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967296' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294966272 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.range_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294966272 -'#------------------FN_DYNVARS_137_06-----------------------#' -SELECT @@global.range_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='range_alloc_block_size'; -@@global.range_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_137_07-----------------------#' -SELECT @@session.range_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='range_alloc_block_size'; -@@session.range_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_137_08-----------------------#' -SET @@global.range_alloc_block_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '1' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@global.range_alloc_block_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -'#---------------------FN_DYNVARS_137_09----------------------#' -SET @@global.range_alloc_block_size = 10; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '10' -SELECT @@range_alloc_block_size = @@global.range_alloc_block_size; -@@range_alloc_block_size = @@global.range_alloc_block_size -0 -'#---------------------FN_DYNVARS_137_10----------------------#' -SET @@range_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '100' -SELECT @@range_alloc_block_size = @@local.range_alloc_block_size; -@@range_alloc_block_size = @@local.range_alloc_block_size -1 -SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size; -@@local.range_alloc_block_size = @@session.range_alloc_block_size -1 -'#---------------------FN_DYNVARS_137_11----------------------#' -SET range_alloc_block_size = 1; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '1' -SELECT @@range_alloc_block_size; -@@range_alloc_block_size -4096 -SELECT local.range_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.range_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT range_alloc_block_size = @@session.range_alloc_block_size; -ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list' -SET @@global.range_alloc_block_size = @start_global_value; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = @start_session_value; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 diff --git a/mysql-test/r/rpl_recovery_rank_basic_32.result b/mysql-test/r/rpl_recovery_rank_basic_32.result deleted file mode 100644 index d4dd46eba71..00000000000 --- a/mysql-test/r/rpl_recovery_rank_basic_32.result +++ /dev/null @@ -1,110 +0,0 @@ -SET @start_global_value = @@global.rpl_recovery_rank; -SELECT @start_global_value; -@start_global_value -0 -'#--------------------FN_DYNVARS_142_01-------------------------#' -SET @@global.rpl_recovery_rank = 500000; -SET @@global.rpl_recovery_rank = DEFAULT; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -'#--------------------FN_DYNVARS_142_02-------------------------#' -SET @@global.rpl_recovery_rank = 0; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = 1024; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -1024 -SET @@global.rpl_recovery_rank = 123456789; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -123456789 -SET @@global.rpl_recovery_rank = 2147483648*2; -Warnings: -Warning 1292 Truncated incorrect rpl-recovery-rank value: '4294967296' -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -SET @@global.rpl_recovery_rank = 2147483648*1024; -Warnings: -Warning 1292 Truncated incorrect rpl-recovery-rank value: '2199023255552' -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -SET @@global.rpl_recovery_rank = 2147483648*2147483648; -Warnings: -Warning 1292 Truncated incorrect rpl-recovery-rank value: '4611686018427387904' -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -'#--------------------FN_DYNVARS_142_03-------------------------#' -SET @@rpl_recovery_rank = 2; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.rpl_recovery_rank = 3; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.rpl_recovery_rank = 4; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_142_04-----------------------#' -SET @@global.rpl_recovery_rank = -1; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = -2147483648; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = -2147483649; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@global.rpl_recovery_rank = 2147483649.56; -ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' -SET @@global.rpl_recovery_rank = 1G; -ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' -'#------------------FN_DYNVARS_142_05-----------------------#' -SET @@global.rpl_recovery_rank = 3000; -SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='rpl_recovery_rank'; -@@global.rpl_recovery_rank = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_142_06-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='rpl_recovery_rank'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_142_07-----------------------#' -SET @@global.rpl_recovery_rank = TRUE; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -1 -SET @@global.rpl_recovery_rank = FALSE; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -'#---------------------FN_DYNVARS_001_08----------------------#' -SET @@global.rpl_recovery_rank = 512; -SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank; -@@rpl_recovery_rank = @@global.rpl_recovery_rank -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET rpl_recovery_rank = 2048; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -SELECT rpl_recovery_rank; -ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list' -SELECT @@rpl_recovery_rank; -@@rpl_recovery_rank -512 -SET global rpl_recovery_rank = 64; -SET @@global.rpl_recovery_rank = @start_global_value; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 diff --git a/mysql-test/r/server_id_basic_32.result b/mysql-test/r/server_id_basic_32.result deleted file mode 100644 index 6f801fc627b..00000000000 --- a/mysql-test/r/server_id_basic_32.result +++ /dev/null @@ -1,117 +0,0 @@ -SET @@global.general_log= 0; -SET @start_global_value = @@global.server_id; -SELECT @start_global_value; -@start_global_value -1 -'#--------------------FN_DYNVARS_144_01-------------------------#' -SET @@global.server_id = 500000; -SET @@global.server_id = DEFAULT; -SELECT @@global.server_id; -@@global.server_id -0 -'#--------------------FN_DYNVARS_144_02-------------------------#' -SET @@global.server_id = DEFAULT; -SELECT @@global.server_id = 0; -@@global.server_id = 0 -1 -'#--------------------FN_DYNVARS_144_03-------------------------#' -SET @@global.server_id = 0; -SELECT @@global.server_id; -@@global.server_id -0 -SET @@global.server_id = 1; -SELECT @@global.server_id; -@@global.server_id -1 -SET @@global.server_id = 15; -SELECT @@global.server_id; -@@global.server_id -15 -SET @@global.server_id = 1024; -SELECT @@global.server_id; -@@global.server_id -1024 -SET @@global.server_id = 123456789; -SELECT @@global.server_id; -@@global.server_id -123456789 -SET @@global.server_id = 2147483648; -SELECT @@global.server_id; -@@global.server_id -2147483648 -SET @@global.server_id = 2147483648*2-1; -SELECT @@global.server_id; -@@global.server_id -4294967295 -'#--------------------FN_DYNVARS_144_04-------------------------#' -SET @@server_id = 2; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.server_id = 3; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.server_id = 4; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_144_05-----------------------#' -SET @@global.server_id = -1; -SELECT @@global.server_id; -@@global.server_id -0 -SET @@global.server_id = -2147483648; -SELECT @@global.server_id; -@@global.server_id -0 -SET @@global.server_id = 2147483649*2; -Warnings: -Warning 1292 Truncated incorrect server-id value: '4294967298' -SELECT @@global.server_id; -@@global.server_id -4294967295 -SET @@global.server_id = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@global.server_id = '125'; -ERROR 42000: Incorrect argument type to variable 'server_id' -SET @@global.server_id = 7483649.56; -ERROR 42000: Incorrect argument type to variable 'server_id' -SET @@global.server_id = 1G; -ERROR 42000: Incorrect argument type to variable 'server_id' -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_144_06-----------------------#' -SET @@global.server_id = 3000; -SELECT @@global.server_id = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='server_id'; -@@global.server_id = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_144_07-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='server_id'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_144_08-----------------------#' -SET @@global.server_id = TRUE; -SELECT @@global.server_id; -@@global.server_id -1 -SET @@global.server_id = FALSE; -SELECT @@global.server_id; -@@global.server_id -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.server_id = 512; -SELECT @@server_id = @@global.server_id; -@@server_id = @@global.server_id -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET server_id = 2048; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -SELECT server_id; -ERROR 42S22: Unknown column 'server_id' in 'field list' -SELECT @@server_id; -@@server_id -512 -SET global server_id = 99; -SET @@global.server_id = @start_global_value; -SELECT @@global.server_id; -@@global.server_id -1 -SET @@global.general_log= 1; diff --git a/mysql-test/r/slave_transaction_retries_basic_32.result b/mysql-test/r/slave_transaction_retries_basic_32.result deleted file mode 100644 index 5b77c500aa0..00000000000 --- a/mysql-test/r/slave_transaction_retries_basic_32.result +++ /dev/null @@ -1,119 +0,0 @@ -SET @start_global_value = @@global.slave_transaction_retries; -SELECT @start_global_value; -@start_global_value -10 -'#--------------------FN_DYNVARS_149_01-------------------------#' -SET @@global.slave_transaction_retries = 50; -SET @@global.slave_transaction_retries = DEFAULT; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -10 -'#--------------------FN_DYNVARS_149_02-------------------------#' -SET @@global.slave_transaction_retries = DEFAULT; -SELECT @@global.slave_transaction_retries = 10; -@@global.slave_transaction_retries = 10 -1 -'#--------------------FN_DYNVARS_149_03-------------------------#' -SET @@global.slave_transaction_retries = 0; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -0 -SET @@global.slave_transaction_retries = 1; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -1 -SET @@global.slave_transaction_retries = 15; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -15 -SET @@global.slave_transaction_retries = 1024; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -1024 -SET @@global.slave_transaction_retries = 2147483648; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -2147483648 -SET @@global.slave_transaction_retries = 2147483648*2-1; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4294967295 -SET @@global.slave_transaction_retries = 2147483649*2; -Warnings: -Warning 1292 Truncated incorrect slave_transaction_retries value: '4294967298' -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4294967295 -SET @@global.slave_transaction_retries = 4294967295; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4294967295 -'#--------------------FN_DYNVARS_149_04-------------------------#' -SET @@slave_transaction_retries = 2; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.slave_transaction_retries = 3; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.slave_transaction_retries = 4; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_149_05-----------------------#' -SET @@global.slave_transaction_retries = -1; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -0 -SET @@global.slave_transaction_retries = 2147483649*2147483649; -Warnings: -Warning 1292 Truncated incorrect slave_transaction_retries value: '4611686022722355201' -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4294967295 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.slave_transaction_retries = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@global.slave_transaction_retries = '100'; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -SET @@global.slave_transaction_retries = 7483649.56; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -SET @@global.slave_transaction_retries = ON; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -SET @@global.slave_transaction_retries = OFF; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -'#------------------FN_DYNVARS_149_06-----------------------#' -SET @@global.slave_transaction_retries = 3000; -SELECT @@global.slave_transaction_retries = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slave_transaction_retries'; -@@global.slave_transaction_retries = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_149_07-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='slave_transaction_retries'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_149_08-----------------------#' -SET @@global.slave_transaction_retries = TRUE; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -1 -SET @@global.slave_transaction_retries = FALSE; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -0 -'#---------------------FN_DYNVARS_149_09----------------------#' -SET @@global.slave_transaction_retries = 60*60; -SELECT @@slave_transaction_retries = @@global.slave_transaction_retries; -@@slave_transaction_retries = @@global.slave_transaction_retries -1 -'#---------------------FN_DYNVARS_149_10----------------------#' -SET slave_transaction_retries = 2048; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -SELECT slave_transaction_retries; -ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list' -SELECT @@slave_transaction_retries; -@@slave_transaction_retries -3600 -SET global slave_transaction_retries = 99; -SET @@global.slave_transaction_retries = @start_global_value; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -10 diff --git a/mysql-test/r/sort_buffer_size_basic_32.result b/mysql-test/r/sort_buffer_size_basic_32.result deleted file mode 100644 index 09a1fe59046..00000000000 --- a/mysql-test/r/sort_buffer_size_basic_32.result +++ /dev/null @@ -1,193 +0,0 @@ -SET @start_global_value = @@global.sort_buffer_size; -SELECT @start_global_value; -@start_global_value -262144 -SET @start_session_value = @@session.sort_buffer_size; -SELECT @start_session_value; -@start_session_value -262144 -'#--------------------FN_DYNVARS_151_01-------------------------#' -SET @@global.sort_buffer_size = 1000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '1000' -SET @@global.sort_buffer_size = DEFAULT; -SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116; -@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116 -1 -SET @@session.sort_buffer_size = 2000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '2000' -SET @@session.sort_buffer_size = DEFAULT; -SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116; -@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116 -1 -'#--------------------FN_DYNVARS_151_02-------------------------#' -SET @@global.sort_buffer_size = DEFAULT; -SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116; -@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116 -1 -SET @@session.sort_buffer_size = DEFAULT; -SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116; -@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116 -1 -'#--------------------FN_DYNVARS_151_03-------------------------#' -SET @@global.sort_buffer_size = 32776; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32776' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = 32777; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32777' -SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = 4294967295; -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967295 -SET @@global.sort_buffer_size = 4294967294; -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967294 -'Bug# 34877: Invalid Values are showing in variable on assigning valid values.'; -'#--------------------FN_DYNVARS_151_04-------------------------#' -SET @@session.sort_buffer_size = 32776; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32776' -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = 32777; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32777' -SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = 4294967295; -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967295 -SET @@session.sort_buffer_size = 4294967294; -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967294 -'#------------------FN_DYNVARS_151_05-----------------------#' -SET @@global.sort_buffer_size = 32775; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32775' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = -1024; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '0' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = 4294967296; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296' -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967295 -SET @@global.sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967295 -SET @@global.sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967295 -SET @@session.sort_buffer_size = 32775; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32775' -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = -2; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '0' -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.sort_buffer_size = 4294967296; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296' -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967295 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967295 -'#------------------FN_DYNVARS_151_06-----------------------#' -SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; -@@global.sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_151_07-----------------------#' -SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; -@@session.sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_151_08-----------------------#' -SET @@global.sort_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '1' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '0' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -'Bug: Errors should be displayed on assigning TRUE/FALSE to variable' -'#---------------------FN_DYNVARS_151_09----------------------#' -SET @@global.sort_buffer_size = 9000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '9000' -SELECT @@sort_buffer_size = @@global.sort_buffer_size; -@@sort_buffer_size = @@global.sort_buffer_size -0 -'#---------------------FN_DYNVARS_151_10----------------------#' -SET @@sort_buffer_size = 9000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '9000' -SELECT @@sort_buffer_size = @@local.sort_buffer_size; -@@sort_buffer_size = @@local.sort_buffer_size -1 -SELECT @@local.sort_buffer_size = @@session.sort_buffer_size; -@@local.sort_buffer_size = @@session.sort_buffer_size -1 -'#---------------------FN_DYNVARS_151_11----------------------#' -SET sort_buffer_size = 9100; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '9100' -SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804; -@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804 -1 -SELECT @@sort_buffer_size; -@@sort_buffer_size -32804 -SELECT local.sort_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.sort_buffer_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT sort_buffer_size = @@session.sort_buffer_size; -ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list' -SET @@global.sort_buffer_size = @start_global_value; -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -262144 -SET @@session.sort_buffer_size = @start_session_value; -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -262144 diff --git a/mysql-test/r/sync_binlog_basic_32.result b/mysql-test/r/sync_binlog_basic_32.result deleted file mode 100644 index 3d9bfb6d218..00000000000 --- a/mysql-test/r/sync_binlog_basic_32.result +++ /dev/null @@ -1,105 +0,0 @@ -SET @start_value = @@global.sync_binlog; -SELECT @start_value; -@start_value -0 -'#--------------------FN_DYNVARS_168_01------------------------#' -SET @@global.sync_binlog = 99; -SET @@global.sync_binlog = DEFAULT; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -'#---------------------FN_DYNVARS_168_02-------------------------#' -SET @@global.sync_binlog = @start_value; -SELECT @@global.sync_binlog = 0; -@@global.sync_binlog = 0 -1 -'#--------------------FN_DYNVARS_168_03------------------------#' -SET @@global.sync_binlog = 0; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -SET @@global.sync_binlog = 1; -SELECT @@global.sync_binlog; -@@global.sync_binlog -1 -SET @@global.sync_binlog = 4294967295; -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967295 -SET @@global.sync_binlog = 4294967294; -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967294 -SET @@global.sync_binlog = 65536; -SELECT @@global.sync_binlog; -@@global.sync_binlog -65536 -'#--------------------FN_DYNVARS_168_04-------------------------#' -SET @@global.sync_binlog = -1; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -SET @@global.sync_binlog = 4294967296; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -SET @@global.sync_binlog = 10240022115; -SELECT @@global.sync_binlog; -@@global.sync_binlog -1650087523 -SET @@global.sync_binlog = 10000.01; -ERROR 42000: Incorrect argument type to variable 'sync_binlog' -SELECT @@global.sync_binlog; -@@global.sync_binlog -1650087523 -SET @@global.sync_binlog = -1024; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -SET @@global.sync_binlog = 42949672950; -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967286 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.sync_binlog = ON; -ERROR 42000: Incorrect argument type to variable 'sync_binlog' -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967286 -SET @@global.sync_binlog = 'test'; -ERROR 42000: Incorrect argument type to variable 'sync_binlog' -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967286 -'#-------------------FN_DYNVARS_168_05----------------------------#' -SET @@session.sync_binlog = 0; -ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@sync_binlog; -@@sync_binlog -4294967286 -'#----------------------FN_DYNVARS_168_06------------------------#' -SELECT @@global.sync_binlog = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sync_binlog'; -@@global.sync_binlog = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_168_07----------------------#' -SET sync_binlog = 1; -ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@sync_binlog; -@@sync_binlog -4294967286 -SET local.sync_binlog = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 -SELECT local.sync_binlog; -ERROR 42S02: Unknown table 'local' in field list -SET global.sync_binlog = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 -SELECT global.sync_binlog; -ERROR 42S02: Unknown table 'global' in field list -SELECT sync_binlog = @@session.sync_binlog; -ERROR 42S22: Unknown column 'sync_binlog' in 'field list' -SET @@global.sync_binlog = @start_value; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 diff --git a/mysql-test/r/timestamp_basic_32.result b/mysql-test/r/timestamp_basic_32.result deleted file mode 100644 index cc4f0324c0f..00000000000 --- a/mysql-test/r/timestamp_basic_32.result +++ /dev/null @@ -1,73 +0,0 @@ -SET @session_start_value = @@session.timestamp; -'#--------------------FN_DYNVARS_001_01------------------------#' -SET @@timestamp = DEFAULT; -'timestamp does not have any DEFAULT value' -'#---------------------FN_DYNVARS_001_02-------------------------#' -SET @@global.timestamp = "1000"; -ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL -'#--------------------FN_DYNVARS_001_03------------------------#' -SET @@timestamp = 0; -'Setting 0 resets timestamp to session default timestamp' -SET @@timestamp = 123456789123456; -SELECT @@timestamp; -@@timestamp -2249167232 -SET @@timestamp = 60*60*60*60*365; -SELECT @@timestamp; -@@timestamp -435432704 -SET @@timestamp = -1000000000; -SELECT @@timestamp; -@@timestamp -3294967296 -SET @temp_ts = @@timestamp - @@timestamp; -SELECT @temp_ts; -@temp_ts -0 -'#--------------------FN_DYNVARS_001_04-------------------------#' -SET @@timestamp = "100"; -ERROR 42000: Incorrect argument type to variable 'timestamp' -'Bug# 34836: Documentation says its a string variable but infact its numeric' -SET @@timestamp = " "; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = 1.1; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = 9999999999999999999999; -ERROR 42000: Incorrect argument type to variable 'timestamp' -'#----------------------FN_DYNVARS_001_06------------------------#' -SELECT @@timestamp = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='timestamp'; -@@timestamp = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_08-------------------------#' -SET @@timestamp = OFF; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = ON; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = TRUE; -SELECT @@timestamp; -@@timestamp -1 -SET @@timestamp = FALSE; -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@timestamp = 123456; -SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; -@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp -1 -SET @@timestamp = 654321; -SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; -@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET timestamp = 1; -SELECT @@timestamp; -@@timestamp -1 -SELECT local.timestamp; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.timestamp; -ERROR 42S02: Unknown table 'session' in field list -SELECT timestamp = @@session.timestamp; -ERROR 42S22: Unknown column 'timestamp' in 'field list' -SET @@timestamp = @session_start_value; diff --git a/mysql-test/r/tmp_table_size_basic_32.result b/mysql-test/r/tmp_table_size_basic_32.result deleted file mode 100644 index aeafd95ed55..00000000000 --- a/mysql-test/r/tmp_table_size_basic_32.result +++ /dev/null @@ -1,172 +0,0 @@ -SET @start_global_value = @@global.tmp_table_size; -SELECT @start_global_value; -@start_global_value -16777216 -SET @start_session_value = @@session.tmp_table_size; -SELECT @start_session_value; -@start_session_value -16777216 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.tmp_table_size = 100; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '100' -SET @@global.tmp_table_size = DEFAULT; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -16777216 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -SET @@session.tmp_table_size = 200; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '200' -SET @@session.tmp_table_size = DEFAULT; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -16777216 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.tmp_table_size = DEFAULT; -SELECT @@global.tmp_table_size = 33554432; -@@global.tmp_table_size = 33554432 -0 -SET @@session.tmp_table_size = DEFAULT; -SELECT @@session.tmp_table_size = 33554432; -@@session.tmp_table_size = 33554432 -0 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.tmp_table_size = 1024; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = 60020; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -60020 -SET @@global.tmp_table_size = 4294967295; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -4294967295 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.tmp_table_size = 1024; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -1024 -SET @@session.tmp_table_size =4294967295; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -4294967295 -SET @@session.tmp_table_size = 65535; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -65535 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.tmp_table_size = 0; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = -1024; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = 1000; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '1000' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.tmp_table_size = ON; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@global.tmp_table_size = OFF; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@global.tmp_table_size = True; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '1' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = False; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -'Bug:Error should be shown that variable is numeric and can not assigned boolean value'; -SET @@global.tmp_table_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@global.tmp_table_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = ON; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = OFF; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = True; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '1' -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -1024 -SET @@session.tmp_table_size = False; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -1024 -SET @@session.tmp_table_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = 12345678901; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -4294967295 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.tmp_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='tmp_table_size'; -@@global.tmp_table_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.tmp_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='tmp_table_size'; -@@session.tmp_table_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.tmp_table_size = 1024; -SET @@tmp_table_size = 4294967295; -SELECT @@tmp_table_size = @@global.tmp_table_size; -@@tmp_table_size = @@global.tmp_table_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@tmp_table_size = 100; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '100' -SELECT @@tmp_table_size = @@local.tmp_table_size; -@@tmp_table_size = @@local.tmp_table_size -1 -SELECT @@local.tmp_table_size = @@session.tmp_table_size; -@@local.tmp_table_size = @@session.tmp_table_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET tmp_table_size = 1027; -SELECT @@tmp_table_size; -@@tmp_table_size -1027 -SELECT local.tmp_table_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT global.tmp_table_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT tmp_table_size = @@session.tmp_table_size; -ERROR 42S22: Unknown column 'tmp_table_size' in 'field list' -SET @@global.tmp_table_size = @start_global_value; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -16777216 -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -16777216 diff --git a/mysql-test/r/transaction_alloc_block_size_basic_32.result b/mysql-test/r/transaction_alloc_block_size_basic_32.result deleted file mode 100644 index 706d7802ed3..00000000000 --- a/mysql-test/r/transaction_alloc_block_size_basic_32.result +++ /dev/null @@ -1,180 +0,0 @@ -SET @start_global_value = @@global.transaction_alloc_block_size; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.transaction_alloc_block_size; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.transaction_alloc_block_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '200' -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -8192 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size = 8192; -@@global.transaction_alloc_block_size = 8192 -1 -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size = 8192; -@@session.transaction_alloc_block_size = 8192 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_alloc_block_size = 1024; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 60020; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -59392 -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_alloc_block_size = 1024; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size =4294967295; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 -SET @@session.transaction_alloc_block_size = 65535; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -64512 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 123456789201; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '123456789201' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = 12345678901; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '12345678901' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@global.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@session.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_08----------------------#' -SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@global.transaction_alloc_block_size -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@local.transaction_alloc_block_size -1 -SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; -@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET transaction_alloc_block_size = 1027; -SELECT @@transaction_alloc_block_size; -@@transaction_alloc_block_size -1024 -SELECT local.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; -ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list' -SET @@global.transaction_alloc_block_size = @start_global_value; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 diff --git a/mysql-test/r/transaction_prealloc_size_basic_32.result b/mysql-test/r/transaction_prealloc_size_basic_32.result deleted file mode 100644 index 3df7a55595e..00000000000 --- a/mysql-test/r/transaction_prealloc_size_basic_32.result +++ /dev/null @@ -1,172 +0,0 @@ -SET @start_global_value = @@global.transaction_prealloc_size; -SELECT @start_global_value; -@start_global_value -4096 -SET @start_session_value = @@session.transaction_prealloc_size; -SELECT @start_session_value; -@start_session_value -4096 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '200' -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size = 4096; -@@global.transaction_prealloc_size = 4096 -1 -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size = 4096; -@@session.transaction_prealloc_size = 4096 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_prealloc_size = 1024; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 60020; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -59392 -SET @@global.transaction_prealloc_size = 4294966272; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4294966272 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_prealloc_size = 1024; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size =4294966272; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4294966272 -SET @@session.transaction_prealloc_size = 65535; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -64512 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1000' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = 123456789031; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '123456789031' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4294966272 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@global.transaction_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@session.transaction_prealloc_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.transaction_prealloc_size = 1024; -SET @@global.transaction_prealloc_size = 10; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' -SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; -@@transaction_prealloc_size = @@global.transaction_prealloc_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; -@@transaction_prealloc_size = @@local.transaction_prealloc_size -1 -SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; -@@local.transaction_prealloc_size = @@session.transaction_prealloc_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET transaction_prealloc_size = 1027; -SELECT @@transaction_prealloc_size; -@@transaction_prealloc_size -1024 -SELECT local.transaction_prealloc_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_prealloc_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; -ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list' -SET @@global.transaction_prealloc_size = @start_global_value; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = @start_session_value; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 diff --git a/mysql-test/r/wait_timeout_basic_32.result b/mysql-test/r/wait_timeout_basic_32.result deleted file mode 100644 index ae03e677e56..00000000000 --- a/mysql-test/r/wait_timeout_basic_32.result +++ /dev/null @@ -1,129 +0,0 @@ -SET @start_global_value = @@global.wait_timeout; -SET @start_session_value = @@session.wait_timeout; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.wait_timeout = 100; -SET @@global.wait_timeout = DEFAULT; -SELECT @@global.wait_timeout; -@@global.wait_timeout -28800 -SET @@session.wait_timeout = 200; -SET @@session.wait_timeout = DEFAULT; -SELECT @@session.wait_timeout; -@@session.wait_timeout -28800 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.wait_timeout = DEFAULT; -SELECT @@global.wait_timeout = @default_wait_timeout; -@@global.wait_timeout = @default_wait_timeout -1 -SET @@session.wait_timeout = DEFAULT; -SELECT @@session.wait_timeout = @default_wait_timeout; -@@session.wait_timeout = @default_wait_timeout -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.wait_timeout= 1; -SELECT @@global.wait_timeout; -@@global.wait_timeout -1 -SET @@global.wait_timeout = 60020; -SELECT @@global.wait_timeout; -@@global.wait_timeout -60020 -SET @@global.wait_timeout = 31536000; -SELECT @@global.wait_timeout = @max_wait_timeout; -@@global.wait_timeout = @max_wait_timeout -1 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.wait_timeout =6000; -SELECT @@session.wait_timeout; -@@session.wait_timeout -6000 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.wait_timeout = 0; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -SET @@global.wait_timeout = -1024; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.wait_timeout = ON; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@global.wait_timeout = OFF; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@global.wait_timeout = True; -SELECT @@global.wait_timeout; -@@global.wait_timeout -1 -SET @@global.wait_timeout = False; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -SELECT @@global.wait_timeout; -@@global.wait_timeout -1 -SET @@global.wait_timeout = 65530.34; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@global.wait_timeout ="Test"; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = ON; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = OFF; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = True; -SELECT @@session.wait_timeout; -@@session.wait_timeout -1 -SET @@session.wait_timeout = False; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -SELECT @@session.wait_timeout; -@@session.wait_timeout -1 -SET @@session.wait_timeout = "Test"; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = 'test'; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = 123456789031; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '123456789031' -SELECT @@session.wait_timeout = @max_wait_timeout; -@@session.wait_timeout = @max_wait_timeout -1 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.wait_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='wait_timeout'; -@@global.wait_timeout = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.wait_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='wait_timeout'; -@@session.wait_timeout = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.wait_timeout = 30000; -SET @@global.wait_timeout = 40000; -SELECT @@wait_timeout = @@global.wait_timeout; -@@wait_timeout = @@global.wait_timeout -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@wait_timeout = 100; -SELECT @@wait_timeout = @@local.wait_timeout; -@@wait_timeout = @@local.wait_timeout -1 -SELECT @@local.wait_timeout = @@session.wait_timeout; -@@local.wait_timeout = @@session.wait_timeout -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET wait_timeout = 1027; -SELECT @@wait_timeout; -@@wait_timeout -1027 -SELECT local.wait_timeout; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.wait_timeout; -ERROR 42S02: Unknown table 'session' in field list -SELECT wait_timeout = @@session.wait_timeout; -ERROR 42S22: Unknown column 'wait_timeout' in 'field list' -SET @@global.wait_timeout = @start_global_value; -SET @@session.wait_timeout = @start_session_value; From d9fc253c47f922890e144b62aa818f77b2cce7af Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Tue, 22 Jul 2008 18:50:36 +0200 Subject: [PATCH 121/352] Fix for bug#37708:The result files of the removed 64 bit tests. --- .../r/binlog_cache_size_basic_64.result | 100 --------- .../r/bulk_insert_buffer_size_basic_64.result | 150 ------------- .../r/delayed_insert_limit_basic_64.result | 110 ---------- .../r/delayed_queue_size_basic_64.result | 108 ---------- ...innodb_concurrency_tickets_basic_64.result | 98 --------- .../r/innodb_max_purge_lag_basic_64.result | 92 -------- .../r/innodb_sync_spin_loops_basic_64.result | 92 -------- mysql-test/r/join_buffer_size_basic_64.result | 194 ----------------- mysql-test/r/key_buffer_size_basic_64.result | 111 ---------- .../r/key_cache_age_threshold_basic_64.result | 126 ----------- .../r/key_cache_block_size_basic_64.result | 142 ------------- .../key_cache_division_limit_basic_64.result | 139 ------------ mysql-test/r/log_warnings_basic_64.result | 158 -------------- .../r/max_binlog_cache_size_basic_64.result | 141 ------------- .../r/max_connect_errors_basic_64.result | 133 ------------ .../r/max_heap_table_size_basic_64.result | 196 ----------------- .../r/max_seeks_for_key_basic_64.result | 176 ---------------- mysql-test/r/max_tmp_tables_basic_64.result | 187 ---------------- .../r/max_write_lock_count_basic_64.result | 104 --------- .../r/min_examined_row_limit_basic_64.result | 174 --------------- .../r/multi_range_count_basic_64.result | 184 ---------------- .../myisam_max_sort_file_size_basic_64.result | 114 ---------- .../r/myisam_repair_threads_basic_64.result | 178 ---------------- .../r/myisam_sort_buffer_size_basic_64.result | 182 ---------------- mysql-test/r/net_retry_count_basic_64.result | 184 ---------------- .../r/query_alloc_block_size_basic_64.result | 199 ------------------ .../r/query_cache_limit_basic_64.result | 120 ----------- .../query_cache_min_res_unit_basic_64.result | 130 ------------ mysql-test/r/query_cache_size_basic_64.result | 134 ------------ .../r/query_prealloc_size_basic_64.result | 178 ---------------- .../r/range_alloc_block_size_basic_64.result | 178 ---------------- .../r/rpl_recovery_rank_basic_64.result | 110 ---------- mysql-test/r/server_id_basic_64.result | 115 ---------- .../slave_transaction_retries_basic_64.result | 115 ---------- mysql-test/r/sort_buffer_size_basic_64.result | 189 ----------------- mysql-test/r/sync_binlog_basic_64.result | 105 --------- mysql-test/r/timestamp_basic_64.result | 73 ------- mysql-test/r/tmp_table_size_basic_64.result | 172 --------------- ...ansaction_alloc_block_size_basic_64.result | 176 ---------------- .../transaction_prealloc_size_basic_64.result | 170 --------------- mysql-test/r/wait_timeout_basic_64.result | 129 ------------ 41 files changed, 5866 deletions(-) delete mode 100644 mysql-test/r/binlog_cache_size_basic_64.result delete mode 100644 mysql-test/r/bulk_insert_buffer_size_basic_64.result delete mode 100644 mysql-test/r/delayed_insert_limit_basic_64.result delete mode 100644 mysql-test/r/delayed_queue_size_basic_64.result delete mode 100644 mysql-test/r/innodb_concurrency_tickets_basic_64.result delete mode 100644 mysql-test/r/innodb_max_purge_lag_basic_64.result delete mode 100644 mysql-test/r/innodb_sync_spin_loops_basic_64.result delete mode 100644 mysql-test/r/join_buffer_size_basic_64.result delete mode 100644 mysql-test/r/key_buffer_size_basic_64.result delete mode 100644 mysql-test/r/key_cache_age_threshold_basic_64.result delete mode 100644 mysql-test/r/key_cache_block_size_basic_64.result delete mode 100644 mysql-test/r/key_cache_division_limit_basic_64.result delete mode 100644 mysql-test/r/log_warnings_basic_64.result delete mode 100644 mysql-test/r/max_binlog_cache_size_basic_64.result delete mode 100644 mysql-test/r/max_connect_errors_basic_64.result delete mode 100644 mysql-test/r/max_heap_table_size_basic_64.result delete mode 100644 mysql-test/r/max_seeks_for_key_basic_64.result delete mode 100644 mysql-test/r/max_tmp_tables_basic_64.result delete mode 100644 mysql-test/r/max_write_lock_count_basic_64.result delete mode 100644 mysql-test/r/min_examined_row_limit_basic_64.result delete mode 100644 mysql-test/r/multi_range_count_basic_64.result delete mode 100644 mysql-test/r/myisam_max_sort_file_size_basic_64.result delete mode 100644 mysql-test/r/myisam_repair_threads_basic_64.result delete mode 100644 mysql-test/r/myisam_sort_buffer_size_basic_64.result delete mode 100644 mysql-test/r/net_retry_count_basic_64.result delete mode 100644 mysql-test/r/query_alloc_block_size_basic_64.result delete mode 100644 mysql-test/r/query_cache_limit_basic_64.result delete mode 100644 mysql-test/r/query_cache_min_res_unit_basic_64.result delete mode 100644 mysql-test/r/query_cache_size_basic_64.result delete mode 100644 mysql-test/r/query_prealloc_size_basic_64.result delete mode 100644 mysql-test/r/range_alloc_block_size_basic_64.result delete mode 100644 mysql-test/r/rpl_recovery_rank_basic_64.result delete mode 100644 mysql-test/r/server_id_basic_64.result delete mode 100644 mysql-test/r/slave_transaction_retries_basic_64.result delete mode 100644 mysql-test/r/sort_buffer_size_basic_64.result delete mode 100644 mysql-test/r/sync_binlog_basic_64.result delete mode 100644 mysql-test/r/timestamp_basic_64.result delete mode 100644 mysql-test/r/tmp_table_size_basic_64.result delete mode 100644 mysql-test/r/transaction_alloc_block_size_basic_64.result delete mode 100644 mysql-test/r/transaction_prealloc_size_basic_64.result delete mode 100644 mysql-test/r/wait_timeout_basic_64.result diff --git a/mysql-test/r/binlog_cache_size_basic_64.result b/mysql-test/r/binlog_cache_size_basic_64.result deleted file mode 100644 index 45ed43589a3..00000000000 --- a/mysql-test/r/binlog_cache_size_basic_64.result +++ /dev/null @@ -1,100 +0,0 @@ -SET @start_value = @@global.binlog_cache_size; -SELECT @start_value; -@start_value -32768 -'#--------------------FN_DYNVARS_006_01------------------------#' -SET @@global.binlog_cache_size = 100; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '100' -SET @@global.binlog_cache_size = DEFAULT; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -32768 -'#---------------------FN_DYNVARS_006_02-------------------------#' -SET @@global.binlog_cache_size = @start_value; -SELECT @@global.binlog_cache_size = 32768; -@@global.binlog_cache_size = 32768 -1 -'#--------------------FN_DYNVARS_006_03------------------------#' -SET @@global.binlog_cache_size = 4096; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = 4294967295; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4294963200 -SET @@global.binlog_cache_size = 10000; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -8192 -SET @@global.binlog_cache_size = 21221204; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -21217280 -'Bug: Invalid values are coming in variable on assigning valid values' -'#--------------------FN_DYNVARS_006_04-------------------------#' -SET @@global.binlog_cache_size = 1024; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '1024' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' -SET @@global.binlog_cache_size = -1024; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '0' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = 42949672950; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -42949668864 -'Bug: Errors are not coming on assigning invalid values to variable' -SET @@global.binlog_cache_size = ON; -ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' -SET @@global.binlog_cache_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' -'#-------------------FN_DYNVARS_006_05----------------------------#' -SET @@session.binlog_cache_size = 0; -ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -'#----------------------FN_DYNVARS_006_06------------------------#' -SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size'; -@@global.binlog_cache_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_006_07----------------------#' -SET @@global.binlog_cache_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '1' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -SET @@global.binlog_cache_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '0' -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -4096 -'Bug: Errors are not coming on assigning TRUE/FALSE to variable' -'#---------------------FN_DYNVARS_006_08----------------------#' -SET @@global.binlog_cache_size = 1; -Warnings: -Warning 1292 Truncated incorrect binlog_cache_size value: '1' -SELECT @@binlog_cache_size = @@global.binlog_cache_size; -@@binlog_cache_size = @@global.binlog_cache_size -1 -'#---------------------FN_DYNVARS_006_09----------------------#' -SET binlog_cache_size = 1; -ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SET global.binlog_cache_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1 -SELECT global.binlog_cache_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT binlog_cache_size = @@session.binlog_cache_size; -ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list' -SET @@global.binlog_cache_size = @start_value; -SELECT @@global.binlog_cache_size; -@@global.binlog_cache_size -32768 diff --git a/mysql-test/r/bulk_insert_buffer_size_basic_64.result b/mysql-test/r/bulk_insert_buffer_size_basic_64.result deleted file mode 100644 index 9e0e8e07470..00000000000 --- a/mysql-test/r/bulk_insert_buffer_size_basic_64.result +++ /dev/null @@ -1,150 +0,0 @@ -SET @start_global_value = @@global.bulk_insert_buffer_size; -SELECT @start_global_value; -@start_global_value -8388608 -SET @start_session_value = @@session.bulk_insert_buffer_size; -SELECT @start_session_value; -@start_session_value -8388608 -'#--------------------FN_DYNVARS_007_01-------------------------#' -SET @@global.bulk_insert_buffer_size = 100; -SET @@global.bulk_insert_buffer_size = DEFAULT; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -8388608 -SET @@session.bulk_insert_buffer_size = 200; -SET @@session.bulk_insert_buffer_size = DEFAULT; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -8388608 -'#--------------------FN_DYNVARS_007_02-------------------------#' -SET @@global.bulk_insert_buffer_size = @start_global_value; -SELECT @@global.bulk_insert_buffer_size = 8388608; -@@global.bulk_insert_buffer_size = 8388608 -1 -SET @@session.bulk_insert_buffer_size = @start_session_value; -SELECT @@session.bulk_insert_buffer_size = 8388608; -@@session.bulk_insert_buffer_size = 8388608 -1 -'#--------------------FN_DYNVARS_007_03-------------------------#' -SET @@global.bulk_insert_buffer_size = 0; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -0 -SET @@global.bulk_insert_buffer_size = 1; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -1 -SET @@global.bulk_insert_buffer_size = 4294967295; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -4294967295 -SET @@global.bulk_insert_buffer_size = 429496; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -429496 -'#--------------------FN_DYNVARS_007_04-------------------------#' -SET @@session.bulk_insert_buffer_size = 0; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -0 -SET @@session.bulk_insert_buffer_size = 1; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -1 -SET @@session.bulk_insert_buffer_size = 4294967295; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -4294967295 -SET @@session.bulk_insert_buffer_size = 429496; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -429496 -'#------------------FN_DYNVARS_007_05-----------------------#' -SET @@global.bulk_insert_buffer_size = 42949672950; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -42949672950 -SET @@global.bulk_insert_buffer_size = -1024; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -0 -SET @@global.bulk_insert_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@global.bulk_insert_buffer_size = ON; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@global.bulk_insert_buffer_size = 429496.10; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@session.bulk_insert_buffer_size = 42949672950; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -42949672950 -SET @@session.bulk_insert_buffer_size = -2; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -0 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@session.bulk_insert_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -SET @@session.bulk_insert_buffer_size = 429496.10; -ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' -'#------------------FN_DYNVARS_007_06-----------------------#' -SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='bulk_insert_buffer_size'; -@@global.bulk_insert_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_007_07-----------------------#' -SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='bulk_insert_buffer_size'; -@@session.bulk_insert_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_007_08-----------------------#' -SET @@global.bulk_insert_buffer_size = TRUE; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -1 -SET @@global.bulk_insert_buffer_size = FALSE; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -0 -SET @@session.bulk_insert_buffer_size = TRUE; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -1 -SET @@session.bulk_insert_buffer_size = FALSE; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -0 -'#---------------------FN_DYNVARS_007_09----------------------#' -SET @@bulk_insert_buffer_size = 100; -SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size; -@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size -1 -SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; -@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size -1 -'#---------------------FN_DYNVARS_007_10----------------------#' -SET bulk_insert_buffer_size = 1; -SELECT @@bulk_insert_buffer_size; -@@bulk_insert_buffer_size -1 -SET local.bulk_insert_buffer_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 -SELECT local.bulk_insert_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SET session.bulk_insert_buffer_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 -SELECT session.bulk_insert_buffer_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; -ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list' -SET @@global.bulk_insert_buffer_size = @start_global_value; -SELECT @@global.bulk_insert_buffer_size; -@@global.bulk_insert_buffer_size -8388608 -SET @@session.bulk_insert_buffer_size = @start_session_value; -SELECT @@session.bulk_insert_buffer_size; -@@session.bulk_insert_buffer_size -8388608 diff --git a/mysql-test/r/delayed_insert_limit_basic_64.result b/mysql-test/r/delayed_insert_limit_basic_64.result deleted file mode 100644 index 246bf0e8734..00000000000 --- a/mysql-test/r/delayed_insert_limit_basic_64.result +++ /dev/null @@ -1,110 +0,0 @@ -SET @start_value = @@global.delayed_insert_limit; -SELECT @start_value; -@start_value -100 -'#--------------------FN_DYNVARS_024_01------------------------#' -SET @@global.delayed_insert_limit = 100; -SET @@global.delayed_insert_limit = DEFAULT; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -100 -'#---------------------FN_DYNVARS_024_02-------------------------#' -SET @@global.delayed_insert_limit = @start_value; -SELECT @@global.delayed_insert_limit = 100; -@@global.delayed_insert_limit = 100 -1 -'#--------------------FN_DYNVARS_024_03------------------------#' -SET @@global.delayed_insert_limit = 10000; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -10000 -SET @@global.delayed_insert_limit = 4294967295; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -4294967295 -SET @@global.delayed_insert_limit = 1; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -'#--------------------FN_DYNVARS_024_04-------------------------#' -SET @@global.delayed_insert_limit = 0; -Warnings: -Warning 1292 Truncated incorrect delayed_insert_limit value: '0' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -SET @@global.delayed_insert_limit = -1024; -Warnings: -Warning 1292 Truncated incorrect delayed_insert_limit value: '0' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -SET @@global.delayed_insert_limit = 42949672950; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -42949672950 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.delayed_insert_limit = 429496729.5; -ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -42949672950 -SET @@global.delayed_insert_limit = ON; -ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -42949672950 -'#-------------------FN_DYNVARS_024_05----------------------------#' -SET @@session.delayed_insert_limit = 0; -ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@Session.delayed_insert_limit; -ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable -'#----------------------FN_DYNVARS_024_06------------------------#' -SELECT @@global.delayed_insert_limit = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='delayed_insert_limit'; -@@global.delayed_insert_limit = -VARIABLE_VALUE -1 -SELECT @@delayed_insert_limit = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='delayed_insert_limit'; -@@delayed_insert_limit = -VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_024_07----------------------#' -SET @@global.delayed_insert_limit = TRUE; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -SET @@global.delayed_insert_limit = FALSE; -Warnings: -Warning 1292 Truncated incorrect delayed_insert_limit value: '0' -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -1 -'#---------------------FN_DYNVARS_024_08----------------------#' -SET @@global.delayed_insert_limit = 1; -SELECT @@delayed_insert_limit = @@global.delayed_insert_limit; -@@delayed_insert_limit = @@global.delayed_insert_limit -1 -'#---------------------FN_DYNVARS_024_09----------------------#' -SET delayed_insert_limit = 1; -ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@delayed_insert_limit; -@@delayed_insert_limit -1 -SET local.delayed_insert_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 -SELECT local.delayed_insert_limit; -ERROR 42S02: Unknown table 'local' in field list -SET global.delayed_insert_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 -SELECT global.delayed_insert_limit; -ERROR 42S02: Unknown table 'global' in field list -SELECT delayed_insert_limit = @@session.delayed_insert_limit; -ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list' -SET @@global.delayed_insert_limit = @start_value; -SELECT @@global.delayed_insert_limit; -@@global.delayed_insert_limit -100 diff --git a/mysql-test/r/delayed_queue_size_basic_64.result b/mysql-test/r/delayed_queue_size_basic_64.result deleted file mode 100644 index d575626b0a1..00000000000 --- a/mysql-test/r/delayed_queue_size_basic_64.result +++ /dev/null @@ -1,108 +0,0 @@ -SET @start_value = @@global.delayed_queue_size; -SELECT @start_value; -@start_value -1000 -'#--------------------FN_DYNVARS_026_01------------------------#' -SET @@global.delayed_queue_size = 100; -SET @@global.delayed_queue_size = DEFAULT; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1000 -'#---------------------FN_DYNVARS_026_02-------------------------#' -SET @@global.delayed_queue_size = @start_value; -SELECT @@global.delayed_queue_size = 1000; -@@global.delayed_queue_size = 1000 -1 -'#--------------------FN_DYNVARS_026_03------------------------#' -SET @@global.delayed_queue_size = 10000; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -10000 -SET @@global.delayed_queue_size = 4294967295; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -4294967295 -SET @@global.delayed_queue_size = 1; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -'#--------------------FN_DYNVARS_026_04-------------------------#' -SET @@global.delayed_queue_size = 0; -Warnings: -Warning 1292 Truncated incorrect delayed_queue_size value: '0' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -SET @@global.delayed_queue_size = -1024; -Warnings: -Warning 1292 Truncated incorrect delayed_queue_size value: '0' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -SET @@global.delayed_queue_size = 42949672950; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -42949672950 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.delayed_queue_size = 429496729.5; -ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -42949672950 -SET @@global.delayed_queue_size = ON; -ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' -SELECT @@delayed_queue_size; -@@delayed_queue_size -42949672950 -'#-------------------FN_DYNVARS_026_05----------------------------#' -SET @@session.delayed_queue_size = 0; -ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.delayed_queue_size; -ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable -'#----------------------FN_DYNVARS_026_06------------------------#' -SELECT @@global.delayed_queue_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='delayed_queue_size'; -@@global.delayed_queue_size = VARIABLE_VALUE -1 -SELECT @@delayed_queue_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='delayed_queue_size'; -@@delayed_queue_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_026_07----------------------#' -SET @@global.delayed_queue_size = TRUE; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -SET @@global.delayed_queue_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect delayed_queue_size value: '0' -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1 -'#---------------------FN_DYNVARS_026_08----------------------#' -SET @@global.delayed_queue_size = 1; -SELECT @@delayed_queue_size = @@global.delayed_queue_size; -@@delayed_queue_size = @@global.delayed_queue_size -1 -'#---------------------FN_DYNVARS_026_09----------------------#' -SET delayed_queue_size = 1; -ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@delayed_queue_size; -@@delayed_queue_size -1 -SET local.delayed_queue_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 -SELECT local.delayed_queue_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.delayed_queue_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 -SELECT global.delayed_queue_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT delayed_queue_size = @@session.delayed_queue_size; -ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list' -SET @@global.delayed_queue_size = @start_value; -SELECT @@global.delayed_queue_size; -@@global.delayed_queue_size -1000 diff --git a/mysql-test/r/innodb_concurrency_tickets_basic_64.result b/mysql-test/r/innodb_concurrency_tickets_basic_64.result deleted file mode 100644 index 40d307d8733..00000000000 --- a/mysql-test/r/innodb_concurrency_tickets_basic_64.result +++ /dev/null @@ -1,98 +0,0 @@ -SET @global_start_value = @@global.innodb_concurrency_tickets; -SELECT @global_start_value; -@global_start_value -500 -'#--------------------FN_DYNVARS_046_01------------------------#' -SET @@global.innodb_concurrency_tickets = 0; -Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '0' -SET @@global.innodb_concurrency_tickets = DEFAULT; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -500 -'#---------------------FN_DYNVARS_046_02-------------------------#' -SET innodb_concurrency_tickets = 1; -ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@innodb_concurrency_tickets; -@@innodb_concurrency_tickets -500 -SELECT local.innodb_concurrency_tickets; -ERROR 42S02: Unknown table 'local' in field list -SET global innodb_concurrency_tickets = 0; -Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '0' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -'#--------------------FN_DYNVARS_046_03------------------------#' -SET @@global.innodb_concurrency_tickets = 1; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -SET @@global.innodb_concurrency_tickets = 1000; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1000 -SET @@global.innodb_concurrency_tickets = 4294967295; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -4294967295 -'#--------------------FN_DYNVARS_046_04-------------------------#' -SET @@global.innodb_concurrency_tickets = -1; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -18446744073709551615 -SET @@global.innodb_concurrency_tickets = "T"; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -18446744073709551615 -SET @@global.innodb_concurrency_tickets = "Y"; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -18446744073709551615 -SET @@global.innodb_concurrency_tickets = 1001; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -'#----------------------FN_DYNVARS_046_05------------------------#' -SELECT @@global.innodb_concurrency_tickets = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_concurrency_tickets'; -@@global.innodb_concurrency_tickets = -VARIABLE_VALUE -1 -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_concurrency_tickets'; -VARIABLE_VALUE -1001 -'#---------------------FN_DYNVARS_046_06-------------------------#' -SET @@global.innodb_concurrency_tickets = OFF; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -SET @@global.innodb_concurrency_tickets = ON; -ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1001 -'#---------------------FN_DYNVARS_046_07----------------------#' -SET @@global.innodb_concurrency_tickets = TRUE; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -SET @@global.innodb_concurrency_tickets = FALSE; -Warnings: -Warning 1292 Truncated incorrect concurrency_tickets value: '0' -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -1 -SET @@global.innodb_concurrency_tickets = @global_start_value; -SELECT @@global.innodb_concurrency_tickets; -@@global.innodb_concurrency_tickets -500 diff --git a/mysql-test/r/innodb_max_purge_lag_basic_64.result b/mysql-test/r/innodb_max_purge_lag_basic_64.result deleted file mode 100644 index a6b669dde83..00000000000 --- a/mysql-test/r/innodb_max_purge_lag_basic_64.result +++ /dev/null @@ -1,92 +0,0 @@ -SET @global_start_value = @@global.innodb_max_purge_lag; -SELECT @global_start_value; -@global_start_value -0 -'#--------------------FN_DYNVARS_046_01------------------------#' -SET @@global.innodb_max_purge_lag = 0; -SET @@global.innodb_max_purge_lag = DEFAULT; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -'#---------------------FN_DYNVARS_046_02-------------------------#' -SET innodb_max_purge_lag = 1; -ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@innodb_max_purge_lag; -@@innodb_max_purge_lag -0 -SELECT local.innodb_max_purge_lag; -ERROR 42S02: Unknown table 'local' in field list -SET global innodb_max_purge_lag = 0; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -'#--------------------FN_DYNVARS_046_03------------------------#' -SET @@global.innodb_max_purge_lag = 0; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -SET @@global.innodb_max_purge_lag = 1; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1 -SET @@global.innodb_max_purge_lag = 4294967295; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -4294967295 -'#--------------------FN_DYNVARS_046_04-------------------------#' -SET @@global.innodb_max_purge_lag = -1; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -18446744073709551615 -SET @@global.innodb_max_purge_lag = "T"; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -18446744073709551615 -SET @@global.innodb_max_purge_lag = "Y"; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -18446744073709551615 -SET @@global.innodb_max_purge_lag = 1001; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -'#----------------------FN_DYNVARS_046_05------------------------#' -SELECT @@global.innodb_max_purge_lag = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_max_purge_lag'; -@@global.innodb_max_purge_lag = -VARIABLE_VALUE -1 -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_max_purge_lag'; -VARIABLE_VALUE -1001 -'#---------------------FN_DYNVARS_046_06-------------------------#' -SET @@global.innodb_max_purge_lag = OFF; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -SET @@global.innodb_max_purge_lag = ON; -ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1001 -'#---------------------FN_DYNVARS_046_07----------------------#' -SET @@global.innodb_max_purge_lag = TRUE; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -1 -SET @@global.innodb_max_purge_lag = FALSE; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 -SET @@global.innodb_max_purge_lag = @global_start_value; -SELECT @@global.innodb_max_purge_lag; -@@global.innodb_max_purge_lag -0 diff --git a/mysql-test/r/innodb_sync_spin_loops_basic_64.result b/mysql-test/r/innodb_sync_spin_loops_basic_64.result deleted file mode 100644 index 1b99ad8e3db..00000000000 --- a/mysql-test/r/innodb_sync_spin_loops_basic_64.result +++ /dev/null @@ -1,92 +0,0 @@ -SET @global_start_value = @@global.innodb_sync_spin_loops; -SELECT @global_start_value; -@global_start_value -20 -'#--------------------FN_DYNVARS_046_01------------------------#' -SET @@global.innodb_sync_spin_loops = 0; -SET @@global.innodb_sync_spin_loops = DEFAULT; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -20 -'#---------------------FN_DYNVARS_046_02-------------------------#' -SET innodb_sync_spin_loops = 1; -ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@innodb_sync_spin_loops; -@@innodb_sync_spin_loops -20 -SELECT local.innodb_sync_spin_loops; -ERROR 42S02: Unknown table 'local' in field list -SET global innodb_sync_spin_loops = 0; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -0 -'#--------------------FN_DYNVARS_046_03------------------------#' -SET @@global.innodb_sync_spin_loops = 0; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -0 -SET @@global.innodb_sync_spin_loops = 1; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1 -SET @@global.innodb_sync_spin_loops = 1000; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1000 -'#--------------------FN_DYNVARS_046_04-------------------------#' -SET @@global.innodb_sync_spin_loops = -1; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -18446744073709551615 -SET @@global.innodb_sync_spin_loops = "T"; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -18446744073709551615 -SET @@global.innodb_sync_spin_loops = "Y"; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -18446744073709551615 -SET @@global.innodb_sync_spin_loops = 1001; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -'#----------------------FN_DYNVARS_046_05------------------------#' -SELECT @@global.innodb_sync_spin_loops = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_sync_spin_loops'; -@@global.innodb_sync_spin_loops = -VARIABLE_VALUE -1 -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='innodb_sync_spin_loops'; -VARIABLE_VALUE -1001 -'#---------------------FN_DYNVARS_046_06-------------------------#' -SET @@global.innodb_sync_spin_loops = OFF; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -SET @@global.innodb_sync_spin_loops = ON; -ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1001 -'#---------------------FN_DYNVARS_046_07----------------------#' -SET @@global.innodb_sync_spin_loops = TRUE; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -1 -SET @@global.innodb_sync_spin_loops = FALSE; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -0 -SET @@global.innodb_sync_spin_loops = @global_start_value; -SELECT @@global.innodb_sync_spin_loops; -@@global.innodb_sync_spin_loops -20 diff --git a/mysql-test/r/join_buffer_size_basic_64.result b/mysql-test/r/join_buffer_size_basic_64.result deleted file mode 100644 index ed652af67d2..00000000000 --- a/mysql-test/r/join_buffer_size_basic_64.result +++ /dev/null @@ -1,194 +0,0 @@ -SET @start_global_value = @@global.join_buffer_size; -SELECT @start_global_value; -@start_global_value -131072 -SET @start_session_value = @@session.join_buffer_size; -SELECT @start_session_value; -@start_session_value -131072 -'#--------------------FN_DYNVARS_053_01-------------------------#' -SET @@global.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SET @@global.join_buffer_size = DEFAULT; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -131072 -SET @@session.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SET @@session.join_buffer_size = DEFAULT; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -131072 -'#--------------------FN_DYNVARS_053_02-------------------------#' -SET @@global.join_buffer_size = DEFAULT; -SELECT @@global.join_buffer_size = 131072; -@@global.join_buffer_size = 131072 -1 -SET @@session.join_buffer_size = DEFAULT; -SELECT @@session.join_buffer_size = 131072; -@@session.join_buffer_size = 131072 -1 -'#--------------------FN_DYNVARS_053_03-------------------------#' -SET @@global.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = 65536; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -65536 -SET @@global.join_buffer_size = 4294967295; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -4294963200 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -'#--------------------FN_DYNVARS_053_04-------------------------#' -SET @@session.join_buffer_size = 8200; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8200' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = 65536; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -65536 -SET @@session.join_buffer_size = 4294967295; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -4294963200 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -'#------------------FN_DYNVARS_053_05-----------------------#' -SET @@global.join_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = -1024; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = 8199; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8199' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = 42949672951; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -42949668864 -SET @@global.join_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -42949668864 -SET @@global.join_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'join_buffer_size' -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -42949668864 -SET @@session.join_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = -2; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = 8199; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '8199' -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 -1 -SET @@session.join_buffer_size = 42949672951; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -42949668864 -SET @@session.join_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -42949668864 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@session.join_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'join_buffer_size' -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -42949668864 -'#------------------FN_DYNVARS_053_06-----------------------#' -SELECT @@global.join_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='join_buffer_size'; -@@global.join_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_053_07-----------------------#' -SELECT @@session.join_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='join_buffer_size'; -@@session.join_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_053_08-----------------------#' -SET @@global.join_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '1' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -SET @@global.join_buffer_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '0' -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 -1 -'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.join_buffer_size = 10; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '10' -SELECT @@join_buffer_size = @@global.join_buffer_size; -@@join_buffer_size = @@global.join_buffer_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@join_buffer_size = 100; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '100' -SELECT @@join_buffer_size = @@local.join_buffer_size; -@@join_buffer_size = @@local.join_buffer_size -1 -SELECT @@local.join_buffer_size = @@session.join_buffer_size; -@@local.join_buffer_size = @@session.join_buffer_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET join_buffer_size = 1; -Warnings: -Warning 1292 Truncated incorrect join_buffer_size value: '1' -SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228; -@@join_buffer_size=8200 OR @@join_buffer_size= 8228 -1 -SELECT local.join_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.join_buffer_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT join_buffer_size = @@session.join_buffer_size; -ERROR 42S22: Unknown column 'join_buffer_size' in 'field list' -SET @@global.join_buffer_size = @start_global_value; -SELECT @@global.join_buffer_size; -@@global.join_buffer_size -131072 -SET @@session.join_buffer_size = @start_session_value; -SELECT @@session.join_buffer_size; -@@session.join_buffer_size -131072 diff --git a/mysql-test/r/key_buffer_size_basic_64.result b/mysql-test/r/key_buffer_size_basic_64.result deleted file mode 100644 index 981988a1d4d..00000000000 --- a/mysql-test/r/key_buffer_size_basic_64.result +++ /dev/null @@ -1,111 +0,0 @@ -SET @start_value = @@global.key_buffer_size; -SELECT @start_value; -@start_value -1048576 -'#--------------------FN_DYNVARS_055_01------------------------#' -SET @@global.key_buffer_size = 99; -SET @@global.key_buffer_size = DEFAULT; -ERROR 42000: Variable 'key_buffer_size' doesn't have a default value -'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'#---------------------FN_DYNVARS_055_02-------------------------#' -SET @@global.key_buffer_size = @start_value; -SELECT @@global.key_buffer_size = @start_value; -@@global.key_buffer_size = @start_value -1 -'#--------------------FN_DYNVARS_055_03------------------------#' -SET @@global.key_buffer_size = @min_key_buffer_size; -SELECT @@global.key_buffer_size= @min_key_buffer_size; -@@global.key_buffer_size= @min_key_buffer_size -1 -SET @@global.key_buffer_size = 1800; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '1800' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -SET @@global.key_buffer_size = 65535; -SELECT @@global.key_buffer_size; -@@global.key_buffer_size -61440 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -'#--------------------FN_DYNVARS_055_04-------------------------#' -SET @@global.key_buffer_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_buffer_size' -SELECT @@global.key_buffer_size; -@@global.key_buffer_size -61440 -SET @@global.key_buffer_size = 4; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '4' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.key_buffer_size = ON; -ERROR 42000: Incorrect argument type to variable 'key_buffer_size' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -SET @@global.key_buffer_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_buffer_size' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'#-------------------FN_DYNVARS_055_05----------------------------#' -SET @@session.key_buffer_size = 0; -ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_buffer_size = @min_key_buffer_size; -@@key_buffer_size = @min_key_buffer_size -1 -'#----------------------FN_DYNVARS_055_06------------------------#' -SELECT @@global.key_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_buffer_size'; -@@global.key_buffer_size = VARIABLE_VALUE -1 -SELECT @@key_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_buffer_size'; -@@key_buffer_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_055_07----------------------#' -SET @@global.key_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect key_buffer_size value: '1' -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -SET @@global.key_buffer_size = FALSE; -Warnings: -Warning 1438 Cannot drop default keycache -SELECT @@global.key_buffer_size = @min_key_buffer_size; -@@global.key_buffer_size = @min_key_buffer_size -1 -'#---------------------FN_DYNVARS_055_08----------------------#' -SET @@global.key_buffer_size = @min_key_buffer_size; -SELECT @@key_buffer_size = @@global.key_buffer_size; -@@key_buffer_size = @@global.key_buffer_size -1 -'#---------------------FN_DYNVARS_055_09----------------------#' -SET key_buffer_size = @min_key_buffer_size; -ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_buffer_size = @min_key_buffer_size; -@@key_buffer_size = @min_key_buffer_size -1 -SET local.key_buffer_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 -SELECT local.key_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_buffer_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 -SELECT global.key_buffer_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_buffer_size = @@session.key_buffer_size; -ERROR 42S22: Unknown column 'key_buffer_size' in 'field list' -SET @@global.key_buffer_size = @start_value; -SELECT @@global.key_buffer_size; -@@global.key_buffer_size -1048576 diff --git a/mysql-test/r/key_cache_age_threshold_basic_64.result b/mysql-test/r/key_cache_age_threshold_basic_64.result deleted file mode 100644 index 5e05dd7bacf..00000000000 --- a/mysql-test/r/key_cache_age_threshold_basic_64.result +++ /dev/null @@ -1,126 +0,0 @@ -SET @start_value = @@global.key_cache_age_threshold; -SELECT @start_value; -@start_value -300 -'#--------------------FN_DYNVARS_056_01------------------------#' -SET @@global.key_cache_age_threshold = 99; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' -SET @@global.key_cache_age_threshold = DEFAULT; -ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value -'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'#---------------------FN_DYNVARS_056_02-------------------------#' -SET @@global.key_cache_age_threshold = @start_value; -SELECT @@global.key_cache_age_threshold = 300; -@@global.key_cache_age_threshold = 300 -1 -'#--------------------FN_DYNVARS_056_03------------------------#' -SET @@global.key_cache_age_threshold = 100; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -SET @@global.key_cache_age_threshold = 4294967295; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -4294967200 -SET @@global.key_cache_age_threshold = 1800; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -1800 -SET @@global.key_cache_age_threshold = 65535; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -65500 -'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; -'#--------------------FN_DYNVARS_056_04-------------------------#' -SET @@global.key_cache_age_threshold = -1; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -18446744073709551600 -SET @@global.key_cache_age_threshold = 42949672951; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -42949672900 -SET @@global.key_cache_age_threshold = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -42949672900 -SET @@global.key_cache_age_threshold = -1024; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -18446744073709550500 -SET @@global.key_cache_age_threshold = 99; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.key_cache_age_threshold = ON; -ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -SET @@global.key_cache_age_threshold = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'#-------------------FN_DYNVARS_056_05----------------------------#' -SET @@session.key_cache_age_threshold = 0; -ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.key_cache_age_threshold; -ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable -'#----------------------FN_DYNVARS_056_06------------------------#' -SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_age_threshold'; -@@global.key_cache_age_threshold = VARIABLE_VALUE -1 -SELECT @@key_cache_age_threshold = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_age_threshold'; -@@key_cache_age_threshold = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_056_07----------------------#' -SET @@global.key_cache_age_threshold = TRUE; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '1' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -SET @@global.key_cache_age_threshold = FALSE; -Warnings: -Warning 1292 Truncated incorrect key_cache_age_threshold value: '0' -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -100 -'#---------------------FN_DYNVARS_056_08----------------------#' -SET @@global.key_cache_age_threshold = 101; -SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold; -@@key_cache_age_threshold = @@global.key_cache_age_threshold -1 -'#---------------------FN_DYNVARS_056_09----------------------#' -SET key_cache_age_threshold = 8000; -ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_cache_age_threshold; -@@key_cache_age_threshold -100 -SET local.key_cache_age_threshold = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 -SELECT local.key_cache_age_threshold; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_cache_age_threshold = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 -SELECT global.key_cache_age_threshold; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_cache_age_threshold = @@session.key_cache_age_threshold; -ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list' -SET @@global.key_cache_age_threshold = @start_value; -SELECT @@global.key_cache_age_threshold; -@@global.key_cache_age_threshold -300 diff --git a/mysql-test/r/key_cache_block_size_basic_64.result b/mysql-test/r/key_cache_block_size_basic_64.result deleted file mode 100644 index 46ce1f26b29..00000000000 --- a/mysql-test/r/key_cache_block_size_basic_64.result +++ /dev/null @@ -1,142 +0,0 @@ -SET @start_value = @@global.key_cache_block_size; -SELECT @start_value; -@start_value -1024 -'#--------------------FN_DYNVARS_057_01------------------------#' -SET @@global.key_cache_block_size = 600; -SET @@global.key_cache_block_size = DEFAULT; -ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value -'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -'#---------------------FN_DYNVARS_057_02-------------------------#' -SET @@global.key_cache_block_size = @start_value; -SELECT @@global.key_cache_block_size = 1024; -@@global.key_cache_block_size = 1024 -1 -'#--------------------FN_DYNVARS_057_03------------------------#' -SET @@global.key_cache_block_size = 1024; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -1024 -SET @@global.key_cache_block_size = 16384; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 1800; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -1536 -SET @@global.key_cache_block_size = 16383; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -15872 -'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; -'#--------------------FN_DYNVARS_057_04-------------------------#' -SET @@global.key_cache_block_size = -1; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709551615' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 42949672951; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '42949672951' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709550592' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 256; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '256' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -SET @@global.key_cache_block_size = 511; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '511' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -SET @@global.key_cache_block_size = 16385; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '16385' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.key_cache_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -SET @@global.key_cache_block_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -16384 -'#-------------------FN_DYNVARS_057_05----------------------------#' -SET @@session.key_cache_block_size = 0; -ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.key_cache_block_size; -ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable -'#----------------------FN_DYNVARS_057_06------------------------#' -SELECT @@global.key_cache_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_block_size'; -@@global.key_cache_block_size = VARIABLE_VALUE -1 -SELECT @@key_cache_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_block_size'; -@@key_cache_block_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_057_07----------------------#' -SET @@global.key_cache_block_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '1' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -SET @@global.key_cache_block_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect key_cache_block_size value: '0' -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -512 -'#---------------------FN_DYNVARS_057_08----------------------#' -SET @@global.key_cache_block_size = 1024; -SELECT @@key_cache_block_size = @@global.key_cache_block_size; -@@key_cache_block_size = @@global.key_cache_block_size -1 -'#---------------------FN_DYNVARS_057_09----------------------#' -SET key_cache_block_size = 8000; -ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_cache_block_size; -@@key_cache_block_size -1024 -SET local.key_cache_block_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 -SELECT local.key_cache_block_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_cache_block_size = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 -SELECT global.key_cache_block_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_cache_block_size = @@session.key_cache_block_size; -ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list' -SET @@global.key_cache_block_size = @start_value; -SELECT @@global.key_cache_block_size; -@@global.key_cache_block_size -1024 diff --git a/mysql-test/r/key_cache_division_limit_basic_64.result b/mysql-test/r/key_cache_division_limit_basic_64.result deleted file mode 100644 index cd0cdcbca05..00000000000 --- a/mysql-test/r/key_cache_division_limit_basic_64.result +++ /dev/null @@ -1,139 +0,0 @@ -SET @start_value = @@global.key_cache_division_limit; -SELECT @start_value; -@start_value -100 -'#--------------------FN_DYNVARS_058_01------------------------#' -SET @@global.key_cache_division_limit = 50; -SET @@global.key_cache_division_limit = DEFAULT; -ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value -'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -50 -'#---------------------FN_DYNVARS_058_02-------------------------#' -SET @@global.key_cache_division_limit = @start_value; -SELECT @@global.key_cache_division_limit = 100; -@@global.key_cache_division_limit = 100 -1 -'#--------------------FN_DYNVARS_058_03------------------------#' -SET @@global.key_cache_division_limit = 1; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -SET @@global.key_cache_division_limit = 50; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -50 -SET @@global.key_cache_division_limit = 99; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -99 -SET @@global.key_cache_division_limit = 2; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -2 -'#--------------------FN_DYNVARS_058_04-------------------------#' -SET @@global.key_cache_division_limit = -1; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709551615' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 101; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '101' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 10000.01; -ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = -1024; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709550592' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 0; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '0' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -SET @@global.key_cache_division_limit = 200; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '200' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 65535; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '65535' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -'Bug # 34837: Errors are not coming on assigning invalid values to variable' -SET @@global.key_cache_division_limit = ON; -ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -SET @@global.key_cache_division_limit = 'test'; -ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 -'#-------------------FN_DYNVARS_058_05----------------------------#' -SET @@session.key_cache_division_limit = 0; -ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.key_cache_division_limit; -ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable -'#----------------------FN_DYNVARS_058_06------------------------#' -SELECT @@global.key_cache_division_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_division_limit'; -@@global.key_cache_division_limit = VARIABLE_VALUE -1 -SELECT @@key_cache_division_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_division_limit'; -@@key_cache_division_limit = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_058_07----------------------#' -SET @@global.key_cache_division_limit = TRUE; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -SET @@global.key_cache_division_limit = FALSE; -Warnings: -Warning 1292 Truncated incorrect key_cache_division_limit value: '0' -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -1 -'#---------------------FN_DYNVARS_058_08----------------------#' -SET @@global.key_cache_division_limit = 90; -SELECT @@key_cache_division_limit = @@global.key_cache_division_limit; -@@key_cache_division_limit = @@global.key_cache_division_limit -1 -'#---------------------FN_DYNVARS_058_09----------------------#' -SET key_cache_division_limit = 80; -ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@key_cache_division_limit; -@@key_cache_division_limit -90 -SET local.key_cache_division_limit = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 -SELECT local.key_cache_division_limit; -ERROR 42S02: Unknown table 'local' in field list -SET global.key_cache_division_limit = 10; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 -SELECT global.key_cache_division_limit; -ERROR 42S02: Unknown table 'global' in field list -SELECT key_cache_division_limit = @@session.key_cache_division_limit; -ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list' -SET @@global.key_cache_division_limit = @start_value; -SELECT @@global.key_cache_division_limit; -@@global.key_cache_division_limit -100 diff --git a/mysql-test/r/log_warnings_basic_64.result b/mysql-test/r/log_warnings_basic_64.result deleted file mode 100644 index ba6671c87a4..00000000000 --- a/mysql-test/r/log_warnings_basic_64.result +++ /dev/null @@ -1,158 +0,0 @@ -SET @start_global_value = @@global.log_warnings; -SELECT @start_global_value; -@start_global_value -1 -SET @start_session_value = @@session.log_warnings; -SELECT @start_session_value; -@start_session_value -1 -'#--------------------FN_DYNVARS_067_01-------------------------#' -SET @@global.log_warnings = 100; -SET @@global.log_warnings = DEFAULT; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@session.log_warnings = 200; -SET @@session.log_warnings = DEFAULT; -SELECT @@session.log_warnings; -@@session.log_warnings -1 -'#--------------------FN_DYNVARS_067_02-------------------------#' -SET @@global.log_warnings = DEFAULT; -SELECT @@global.log_warnings = 1; -@@global.log_warnings = 1 -1 -SET @@session.log_warnings = DEFAULT; -SELECT @@session.log_warnings = 1; -@@session.log_warnings = 1 -1 -'#--------------------FN_DYNVARS_067_03-------------------------#' -SET @@global.log_warnings = 0; -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@global.log_warnings = 1; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@global.log_warnings = 60020; -SELECT @@global.log_warnings; -@@global.log_warnings -60020 -SET @@global.log_warnings = 65535; -SELECT @@global.log_warnings; -@@global.log_warnings -65535 -SET @@global.log_warnings = 65536; -SELECT @@global.log_warnings; -@@global.log_warnings -65536 -'#--------------------FN_DYNVARS_067_04-------------------------#' -SET @@session.log_warnings = 0; -SELECT @@session.log_warnings; -@@session.log_warnings -0 -SET @@session.log_warnings = 1; -SELECT @@session.log_warnings; -@@session.log_warnings -1 -SET @@session.log_warnings = 50050; -SELECT @@session.log_warnings; -@@session.log_warnings -50050 -SET @@session.log_warnings = 65535; -SELECT @@session.log_warnings; -@@session.log_warnings -65535 -SET @@session.log_warnings = 65550; -SELECT @@session.log_warnings; -@@session.log_warnings -65550 -'#------------------FN_DYNVARS_067_05-----------------------#' -SET @@global.log_warnings = 100000000000; -SELECT @@global.log_warnings; -@@global.log_warnings -100000000000 -SET @@global.log_warnings = -1024; -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@global.log_warnings = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@global.log_warnings = test; -ERROR 42000: Incorrect argument type to variable 'log_warnings' -SELECT @@global.log_warnings; -@@global.log_warnings -0 -SET @@session.log_warnings = 100000000000; -SELECT @@session.log_warnings; -@@session.log_warnings -100000000000 -SET @@session.log_warnings = -2; -SELECT @@session.log_warnings; -@@session.log_warnings -0 -SET @@session.log_warnings = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.log_warnings = test; -ERROR 42000: Incorrect argument type to variable 'log_warnings' -SELECT @@session.log_warnings; -@@session.log_warnings -0 -'#------------------FN_DYNVARS_067_06-----------------------#' -SELECT @@global.log_warnings = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log_warnings'; -@@global.log_warnings = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_067_07-----------------------#' -SELECT @@session.log_warnings = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='log_warnings'; -@@session.log_warnings = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_067_08-----------------------#' -SET @@global.log_warnings = TRUE; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@global.log_warnings = FALSE; -SELECT @@global.log_warnings; -@@global.log_warnings -0 -'#---------------------FN_DYNVARS_067_09----------------------#' -SET @@global.log_warnings = 10; -SELECT @@log_warnings = @@global.log_warnings; -@@log_warnings = @@global.log_warnings -0 -'#---------------------FN_DYNVARS_067_10----------------------#' -SET @@log_warnings = 100; -SELECT @@log_warnings = @@local.log_warnings; -@@log_warnings = @@local.log_warnings -1 -SELECT @@local.log_warnings = @@session.log_warnings; -@@local.log_warnings = @@session.log_warnings -1 -'#---------------------FN_DYNVARS_067_11----------------------#' -SET log_warnings = 1; -SELECT @@log_warnings; -@@log_warnings -1 -SELECT local.log_warnings; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.log_warnings; -ERROR 42S02: Unknown table 'session' in field list -SELECT log_warnings = @@session.log_warnings; -ERROR 42S22: Unknown column 'log_warnings' in 'field list' -SET @@global.log_warnings = @start_global_value; -SELECT @@global.log_warnings; -@@global.log_warnings -1 -SET @@session.log_warnings = @start_session_value; -SELECT @@session.log_warnings; -@@session.log_warnings -1 diff --git a/mysql-test/r/max_binlog_cache_size_basic_64.result b/mysql-test/r/max_binlog_cache_size_basic_64.result deleted file mode 100644 index 30db3f14dd4..00000000000 --- a/mysql-test/r/max_binlog_cache_size_basic_64.result +++ /dev/null @@ -1,141 +0,0 @@ -SET @start_value = @@global.max_binlog_cache_size; -SELECT @start_value; -@start_value -18446744073709551615 -'#--------------------FN_DYNVARS_072_01------------------------#' -SET @@global.max_binlog_cache_size = 5000; -SET @@global.max_binlog_cache_size = DEFAULT; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -18446744073709547520 -'#---------------------FN_DYNVARS_072_02-------------------------#' -SET @@global.max_binlog_cache_size = @start_value; -SELECT @@global.max_binlog_cache_size = 4294967295; -@@global.max_binlog_cache_size = 4294967295 -0 -'Bug# 34876: Incorrect Default Value is assigned to variable'; -'#--------------------FN_DYNVARS_072_03------------------------#' -SET @@global.max_binlog_cache_size = 4096; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 4294967295; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -SET @@global.max_binlog_cache_size = 4294967294; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294963200 -SET @@global.max_binlog_cache_size = 4097; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 65535; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -61440 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_072_04-------------------------#' -SET @@global.max_binlog_cache_size = -1; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 100000000000; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -99999997952 -SET @@global.max_binlog_cache_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -99999997952 -SET @@global.max_binlog_cache_size = -1024; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 1024; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '1024' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 4294967296; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4294967296 -SET @@global.max_binlog_cache_size = 4095; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.max_binlog_cache_size = ON; -ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -'#-------------------FN_DYNVARS_072_05----------------------------#' -SET @@session.max_binlog_cache_size = 4096; -ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.max_binlog_cache_size; -ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable -'#----------------------FN_DYNVARS_072_06------------------------#' -SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_binlog_cache_size'; -@@global.max_binlog_cache_size = VARIABLE_VALUE -1 -SELECT @@max_binlog_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_binlog_cache_size'; -@@max_binlog_cache_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_072_07----------------------#' -SET @@global.max_binlog_cache_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '1' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -SET @@global.max_binlog_cache_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -4096 -'#---------------------FN_DYNVARS_072_08----------------------#' -SET @@global.max_binlog_cache_size = 5000; -SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size; -@@max_binlog_cache_size = @@global.max_binlog_cache_size -1 -'#---------------------FN_DYNVARS_072_09----------------------#' -SET max_binlog_cache_size = 6000; -ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@max_binlog_cache_size; -@@max_binlog_cache_size -4096 -SET local.max_binlog_cache_size = 7000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1 -SELECT local.max_binlog_cache_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.max_binlog_cache_size = 8000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1 -SELECT global.max_binlog_cache_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT max_binlog_cache_size = @@session.max_binlog_cache_size; -ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list' -SET @@global.max_binlog_cache_size = @start_value; -SELECT @@global.max_binlog_cache_size; -@@global.max_binlog_cache_size -18446744073709547520 diff --git a/mysql-test/r/max_connect_errors_basic_64.result b/mysql-test/r/max_connect_errors_basic_64.result deleted file mode 100644 index 8117b650651..00000000000 --- a/mysql-test/r/max_connect_errors_basic_64.result +++ /dev/null @@ -1,133 +0,0 @@ -SET @start_value = @@global.max_connect_errors; -SELECT @start_value; -@start_value -10 -'#--------------------FN_DYNVARS_073_01------------------------#' -SET @@global.max_connect_errors = 5000; -SET @@global.max_connect_errors = DEFAULT; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -10 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#---------------------FN_DYNVARS_073_02-------------------------#' -SET @@global.max_connect_errors = @start_value; -SELECT @@global.max_connect_errors = 10; -@@global.max_connect_errors = 10 -1 -'#--------------------FN_DYNVARS_073_03------------------------#' -SET @@global.max_connect_errors = 4096; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4096 -SET @@global.max_connect_errors = 4294967294; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967294 -SET @@global.max_connect_errors = 4294967295; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967295 -SET @@global.max_connect_errors = 1; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 2; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -2 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_073_04-------------------------#' -SET @@global.max_connect_errors = -1; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 100000000000; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -100000000000 -SET @@global.max_connect_errors = 10000.01; -ERROR 42000: Incorrect argument type to variable 'max_connect_errors' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -100000000000 -SET @@global.max_connect_errors = -1024; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 0; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = 4294967296; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967296 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.max_connect_errors = ON; -ERROR 42000: Incorrect argument type to variable 'max_connect_errors' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967296 -SET @@global.max_connect_errors = 'test'; -ERROR 42000: Incorrect argument type to variable 'max_connect_errors' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -4294967296 -'#-------------------FN_DYNVARS_073_05----------------------------#' -SET @@session.max_connect_errors = 4096; -ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@session.max_connect_errors; -ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable -'#----------------------FN_DYNVARS_073_06------------------------#' -SELECT @@global.max_connect_errors = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_connect_errors'; -@@global.max_connect_errors = VARIABLE_VALUE -1 -SELECT @@max_connect_errors = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_connect_errors'; -@@max_connect_errors = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_073_07----------------------#' -SET @@global.max_connect_errors = TRUE; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -SET @@global.max_connect_errors = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_connect_errors value: '0' -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -1 -'#---------------------FN_DYNVARS_073_08----------------------#' -SET @@global.max_connect_errors = 5000; -SELECT @@max_connect_errors = @@global.max_connect_errors; -@@max_connect_errors = @@global.max_connect_errors -1 -'#---------------------FN_DYNVARS_073_09----------------------#' -SET max_connect_errors = 6000; -ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@max_connect_errors; -@@max_connect_errors -5000 -SET local.max_connect_errors = 7000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1 -SELECT local.max_connect_errors; -ERROR 42S02: Unknown table 'local' in field list -SET global.max_connect_errors = 8000; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1 -SELECT global.max_connect_errors; -ERROR 42S02: Unknown table 'global' in field list -SELECT max_connect_errors = @@session.max_connect_errors; -ERROR 42S22: Unknown column 'max_connect_errors' in 'field list' -SET @@global.max_connect_errors = @start_value; -SELECT @@global.max_connect_errors; -@@global.max_connect_errors -10 diff --git a/mysql-test/r/max_heap_table_size_basic_64.result b/mysql-test/r/max_heap_table_size_basic_64.result deleted file mode 100644 index ebab80f376b..00000000000 --- a/mysql-test/r/max_heap_table_size_basic_64.result +++ /dev/null @@ -1,196 +0,0 @@ -SET @start_global_value = @@global.max_heap_table_size; -SELECT @start_global_value; -@start_global_value -1048576 -SET @start_session_value = @@session.max_heap_table_size; -SELECT @start_session_value; -@start_session_value -1048576 -'#--------------------FN_DYNVARS_077_01-------------------------#' -SET @@global.max_heap_table_size = 1677721610; -SET @@global.max_heap_table_size = DEFAULT; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16777216 -SET @@session.max_heap_table_size = 1677721610; -SET @@session.max_heap_table_size = DEFAULT; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16777216 -'#--------------------FN_DYNVARS_077_02-------------------------#' -SET @@global.max_heap_table_size = DEFAULT; -SELECT @@global.max_heap_table_size = 16777216; -@@global.max_heap_table_size = 16777216 -1 -SET @@session.max_heap_table_size = DEFAULT; -SELECT @@session.max_heap_table_size = 16777216; -@@session.max_heap_table_size = 16777216 -1 -'#--------------------FN_DYNVARS_077_03-------------------------#' -SET @@global.max_heap_table_size = 16384; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 16385; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 65535; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -64512 -SET @@global.max_heap_table_size = 4294967294; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294966272 -SET @@global.max_heap_table_size = 4294967295; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_077_04-------------------------#' -SET @@session.max_heap_table_size = 16384; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 16385; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 65535; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -64512 -SET @@session.max_heap_table_size = 4294967294; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294966272 -SET @@session.max_heap_table_size = 4294967295; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_077_05-----------------------#' -SET @@global.max_heap_table_size = -1; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = -1024; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 1024; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '1024' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 16383; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '16383' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = 4294967296; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294967296 -SET @@global.max_heap_table_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294967296 -SET @@global.max_heap_table_size = test; -ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -4294967296 -SET @@session.max_heap_table_size = -1; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 16383; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '16383' -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -16384 -SET @@session.max_heap_table_size = 4294967296; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -4294967296 -SET @@session.max_heap_table_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.max_heap_table_size = 10737418241; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -10737418240 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.max_heap_table_size = test; -ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -10737418240 -'#------------------FN_DYNVARS_077_06-----------------------#' -SELECT @@global.max_heap_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_heap_table_size'; -@@global.max_heap_table_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_077_07-----------------------#' -SELECT @@session.max_heap_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_heap_table_size'; -@@session.max_heap_table_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_077_08-----------------------#' -SET @@global.max_heap_table_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '1' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -SET @@global.max_heap_table_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_heap_table_size value: '0' -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -16384 -'#---------------------FN_DYNVARS_077_09----------------------#' -SET @@global.max_heap_table_size = 163845; -SELECT @@max_heap_table_size = @@global.max_heap_table_size; -@@max_heap_table_size = @@global.max_heap_table_size -0 -'#---------------------FN_DYNVARS_077_10----------------------#' -SET @@max_heap_table_size = 16777216; -SELECT @@max_heap_table_size = @@local.max_heap_table_size; -@@max_heap_table_size = @@local.max_heap_table_size -1 -SELECT @@local.max_heap_table_size = @@session.max_heap_table_size; -@@local.max_heap_table_size = @@session.max_heap_table_size -1 -'#---------------------FN_DYNVARS_077_11----------------------#' -SET max_heap_table_size = 316777216; -SELECT @@max_heap_table_size; -@@max_heap_table_size -316776448 -SELECT local.max_heap_table_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.max_heap_table_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT max_heap_table_size = @@session.max_heap_table_size; -ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list' -SET @@global.max_heap_table_size = @start_global_value; -SELECT @@global.max_heap_table_size; -@@global.max_heap_table_size -1048576 -SET @@session.max_heap_table_size = @start_session_value; -SELECT @@session.max_heap_table_size; -@@session.max_heap_table_size -1048576 diff --git a/mysql-test/r/max_seeks_for_key_basic_64.result b/mysql-test/r/max_seeks_for_key_basic_64.result deleted file mode 100644 index eefb829cdae..00000000000 --- a/mysql-test/r/max_seeks_for_key_basic_64.result +++ /dev/null @@ -1,176 +0,0 @@ -SET @start_global_value = @@global.max_seeks_for_key; -SELECT @start_global_value; -@start_global_value -18446744073709551615 -SET @start_session_value = @@session.max_seeks_for_key; -SELECT @start_session_value; -@start_session_value -18446744073709551615 -'#--------------------FN_DYNVARS_083_01-------------------------#' -SET @@global.max_seeks_for_key = 100; -SET @@global.max_seeks_for_key = DEFAULT; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -18446744073709551615 -SET @@session.max_seeks_for_key = 200; -SET @@session.max_seeks_for_key = DEFAULT; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -18446744073709551615 -'#--------------------FN_DYNVARS_083_02-------------------------#' -SET @@global.max_seeks_for_key = DEFAULT; -SELECT @@global.max_seeks_for_key = 4294967295; -@@global.max_seeks_for_key = 4294967295 -0 -SET @@session.max_seeks_for_key = DEFAULT; -SELECT @@session.max_seeks_for_key = 4294967295; -@@session.max_seeks_for_key = 4294967295 -0 -'#--------------------FN_DYNVARS_083_03-------------------------#' -SET @@global.max_seeks_for_key = 1; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = 2; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -2 -SET @@global.max_seeks_for_key = 65536; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -65536 -SET @@global.max_seeks_for_key = 4294967295; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967295 -SET @@global.max_seeks_for_key = 4294967294; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967294 -'#--------------------FN_DYNVARS_083_04-------------------------#' -SET @@session.max_seeks_for_key = 1; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -1 -SET @@session.max_seeks_for_key = 2; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -2 -SET @@session.max_seeks_for_key = 4294967295; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967295 -SET @@session.max_seeks_for_key = 4294967294; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967294 -SET @@session.max_seeks_for_key = 65535; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -65535 -'#------------------FN_DYNVARS_083_05-----------------------#' -SET @@global.max_seeks_for_key = 0; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = -1024; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = 4294967296; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967296 -SET @@global.max_seeks_for_key = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967296 -SET @@global.max_seeks_for_key = test; -ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -4294967296 -SET @@session.max_seeks_for_key = 0; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -1 -SET @@session.max_seeks_for_key = -2; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -1 -SET @@session.max_seeks_for_key = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.max_seeks_for_key = 4294967296; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967296 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.max_seeks_for_key = test; -ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -4294967296 -'#------------------FN_DYNVARS_083_06-----------------------#' -SELECT @@global.max_seeks_for_key = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_seeks_for_key'; -@@global.max_seeks_for_key = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_083_07-----------------------#' -SELECT @@session.max_seeks_for_key = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_seeks_for_key'; -@@session.max_seeks_for_key = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_083_08-----------------------#' -SET @@global.max_seeks_for_key = TRUE; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -SET @@global.max_seeks_for_key = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_seeks_for_key value: '0' -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -1 -'#---------------------FN_DYNVARS_083_09----------------------#' -SET @@global.max_seeks_for_key = 10; -SELECT @@max_seeks_for_key = @@global.max_seeks_for_key; -@@max_seeks_for_key = @@global.max_seeks_for_key -0 -'#---------------------FN_DYNVARS_083_10----------------------#' -SET @@max_seeks_for_key = 100; -SELECT @@max_seeks_for_key = @@local.max_seeks_for_key; -@@max_seeks_for_key = @@local.max_seeks_for_key -1 -SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key; -@@local.max_seeks_for_key = @@session.max_seeks_for_key -1 -'#---------------------FN_DYNVARS_083_11----------------------#' -SET max_seeks_for_key = 1; -SELECT @@max_seeks_for_key; -@@max_seeks_for_key -1 -SELECT local.max_seeks_for_key; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.max_seeks_for_key; -ERROR 42S02: Unknown table 'session' in field list -SELECT max_seeks_for_key = @@session.max_seeks_for_key; -ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list' -SET @@global.max_seeks_for_key = @start_global_value; -SELECT @@global.max_seeks_for_key; -@@global.max_seeks_for_key -18446744073709551615 -SET @@session.max_seeks_for_key = @start_session_value; -SELECT @@session.max_seeks_for_key; -@@session.max_seeks_for_key -18446744073709551615 diff --git a/mysql-test/r/max_tmp_tables_basic_64.result b/mysql-test/r/max_tmp_tables_basic_64.result deleted file mode 100644 index 4b9f68c509e..00000000000 --- a/mysql-test/r/max_tmp_tables_basic_64.result +++ /dev/null @@ -1,187 +0,0 @@ -SET @start_global_value = @@global.max_tmp_tables; -SELECT @start_global_value; -@start_global_value -32 -SET @start_session_value = @@session.max_tmp_tables; -SELECT @start_session_value; -@start_session_value -32 -'#--------------------FN_DYNVARS_086_01-------------------------#' -SET @@global.max_tmp_tables = 1000; -SET @@global.max_tmp_tables = DEFAULT; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -32 -SET @@session.max_tmp_tables = 1000; -SET @@session.max_tmp_tables = DEFAULT; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -32 -'#--------------------FN_DYNVARS_086_02-------------------------#' -SET @@global.max_tmp_tables = DEFAULT; -SELECT @@global.max_tmp_tables = 32; -@@global.max_tmp_tables = 32 -1 -SET @@session.max_tmp_tables = DEFAULT; -SELECT @@session.max_tmp_tables = 32; -@@session.max_tmp_tables = 32 -1 -'#--------------------FN_DYNVARS_086_03-------------------------#' -SET @@global.max_tmp_tables = 1; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = 2; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -2 -SET @@global.max_tmp_tables = 65536; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -65536 -SET @@global.max_tmp_tables = 4294967295; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967295 -SET @@global.max_tmp_tables = 4294967294; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967294 -'#--------------------FN_DYNVARS_086_04-------------------------#' -SET @@session.max_tmp_tables = 1; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -1 -SET @@session.max_tmp_tables = 2; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -2 -SET @@session.max_tmp_tables = 65536; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -65536 -SET @@session.max_tmp_tables = 4294967295; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967295 -SET @@session.max_tmp_tables = 4294967294; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967294 -'#------------------FN_DYNVARS_086_05-----------------------#' -SET @@global.max_tmp_tables = -1024; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = 4294967296; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -4294967296 -SET @@global.max_tmp_tables = -1; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = 429496729500; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -429496729500 -SET @@global.max_tmp_tables = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -429496729500 -SET @@global.max_tmp_tables = test; -ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -429496729500 -SET @@session.max_tmp_tables = 4294967296; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -4294967296 -SET @@session.max_tmp_tables = -1; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -1 -SET @@session.max_tmp_tables = 429496729500; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -429496729500 -SET @@session.max_tmp_tables = -001; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -1 -SET @@session.max_tmp_tables = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.max_tmp_tables = 10737418241; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -10737418241 -SET @@session.max_tmp_tables = test; -ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -10737418241 -'#------------------FN_DYNVARS_086_06-----------------------#' -SELECT @@global.max_tmp_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_tmp_tables'; -@@global.max_tmp_tables = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_086_07-----------------------#' -SELECT @@session.max_tmp_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_tmp_tables'; -@@session.max_tmp_tables = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_086_08-----------------------#' -SET @@global.max_tmp_tables = TRUE; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -SET @@global.max_tmp_tables = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_tmp_tables value: '0' -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -1 -'#---------------------FN_DYNVARS_086_09----------------------#' -SET @@global.max_tmp_tables = 20; -SELECT @@max_tmp_tables = @@global.max_tmp_tables; -@@max_tmp_tables = @@global.max_tmp_tables -0 -'#---------------------FN_DYNVARS_086_10----------------------#' -SET @@max_tmp_tables = 255; -SELECT @@max_tmp_tables = @@local.max_tmp_tables; -@@max_tmp_tables = @@local.max_tmp_tables -1 -SELECT @@local.max_tmp_tables = @@session.max_tmp_tables; -@@local.max_tmp_tables = @@session.max_tmp_tables -1 -'#---------------------FN_DYNVARS_086_11----------------------#' -SET max_tmp_tables = 102; -SELECT @@max_tmp_tables; -@@max_tmp_tables -102 -SELECT local.max_tmp_tables; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.max_tmp_tables; -ERROR 42S02: Unknown table 'session' in field list -SELECT max_tmp_tables = @@session.max_tmp_tables; -ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list' -SET @@global.max_tmp_tables = @start_global_value; -SELECT @@global.max_tmp_tables; -@@global.max_tmp_tables -32 -SET @@session.max_tmp_tables = @start_session_value; -SELECT @@session.max_tmp_tables; -@@session.max_tmp_tables -32 diff --git a/mysql-test/r/max_write_lock_count_basic_64.result b/mysql-test/r/max_write_lock_count_basic_64.result deleted file mode 100644 index d74586841dd..00000000000 --- a/mysql-test/r/max_write_lock_count_basic_64.result +++ /dev/null @@ -1,104 +0,0 @@ -SET @start_global_value = @@global.max_write_lock_count; -SELECT @start_global_value; -@start_global_value -18446744073709551615 -'#--------------------FN_DYNVARS_088_01-------------------------#' -SET @@global.max_write_lock_count = 1000; -SET @@global.max_write_lock_count = DEFAULT; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -18446744073709551615 -'#--------------------FN_DYNVARS_088_02-------------------------#' -SET @@global.max_write_lock_count = DEFAULT; -SELECT @@global.max_write_lock_count = 4294967295; -@@global.max_write_lock_count = 4294967295 -0 -'#--------------------FN_DYNVARS_088_03-------------------------#' -SET @@global.max_write_lock_count = 1; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = 2; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -2 -SET @@global.max_write_lock_count = 65536; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -65536 -SET @@global.max_write_lock_count = 4294967295; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967295 -SET @@global.max_write_lock_count = 4294967294; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967294 -'#------------------FN_DYNVARS_088_04-----------------------#' -SET @@global.max_write_lock_count = -1024; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '0' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = 4294967296; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -4294967296 -SET @@global.max_write_lock_count = -1; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '0' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = 429496729500; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -429496729500 -SET @@global.max_write_lock_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -429496729500 -SET @@global.max_write_lock_count = test; -ERROR 42000: Incorrect argument type to variable 'max_write_lock_count' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -429496729500 -'#------------------FN_DYNVARS_088_05-----------------------#' -SELECT @@global.max_write_lock_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_write_lock_count'; -@@global.max_write_lock_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_088_06-----------------------#' -SET @@global.max_write_lock_count = TRUE; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -SET @@global.max_write_lock_count = FALSE; -Warnings: -Warning 1292 Truncated incorrect max_write_lock_count value: '0' -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -1 -'#---------------------FN_DYNVARS_088_07----------------------#' -SET @@global.max_write_lock_count = 20; -SELECT @@max_write_lock_count = @@global.max_write_lock_count; -@@max_write_lock_count = @@global.max_write_lock_count -1 -'#---------------------FN_DYNVARS_088_08----------------------#' -SET @@global.max_write_lock_count = 102; -SELECT @@max_write_lock_count; -@@max_write_lock_count -102 -SELECT local.max_write_lock_count; -ERROR 42S02: Unknown table 'local' in field list -SELECT global.max_write_lock_count; -ERROR 42S02: Unknown table 'global' in field list -SELECT max_write_lock_count = @@global.max_write_lock_count; -ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list' -SET @@global.max_write_lock_count = @start_global_value; -SELECT @@global.max_write_lock_count; -@@global.max_write_lock_count -18446744073709551615 diff --git a/mysql-test/r/min_examined_row_limit_basic_64.result b/mysql-test/r/min_examined_row_limit_basic_64.result deleted file mode 100644 index fa11659c6c5..00000000000 --- a/mysql-test/r/min_examined_row_limit_basic_64.result +++ /dev/null @@ -1,174 +0,0 @@ -SET @start_global_value = @@global.min_examined_row_limit; -SELECT @start_global_value; -@start_global_value -0 -SET @start_session_value = @@session.min_examined_row_limit; -SELECT @start_session_value; -@start_session_value -0 -'#--------------------FN_DYNVARS_089_01-------------------------#' -SET @@global.min_examined_row_limit = 100; -SET @@global.min_examined_row_limit = DEFAULT; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = 200; -SET @@session.min_examined_row_limit = DEFAULT; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 -'#--------------------FN_DYNVARS_089_02-------------------------#' -SET @@global.min_examined_row_limit = DEFAULT; -SELECT @@global.min_examined_row_limit = 0; -@@global.min_examined_row_limit = 0 -1 -SET @@session.min_examined_row_limit = DEFAULT; -SELECT @@session.min_examined_row_limit = 0; -@@session.min_examined_row_limit = 0 -1 -'#--------------------FN_DYNVARS_089_03-------------------------#' -SET @@global.min_examined_row_limit = 0; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@global.min_examined_row_limit = 1; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -1 -SET @@global.min_examined_row_limit = 60020; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -60020 -SET @@global.min_examined_row_limit = 65535; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -65535 -SET @@global.min_examined_row_limit = 4294967295; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -4294967295 -SET @@global.min_examined_row_limit = 4294967294; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -4294967294 -'#--------------------FN_DYNVARS_089_04-------------------------#' -SET @@session.min_examined_row_limit = 0; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = 1; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -1 -SET @@session.min_examined_row_limit = 50050; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -50050 -SET @@session.min_examined_row_limit = 65535; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -65535 -SET @@session.min_examined_row_limit = 4294967295; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967295 -SET @@session.min_examined_row_limit = 4294967294; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967294 -'#------------------FN_DYNVARS_089_05-----------------------#' -SET @@global.min_examined_row_limit = 429496726; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -429496726 -SET @@global.min_examined_row_limit = -1024; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@global.min_examined_row_limit = 429496729500; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -429496729500 -SET @@global.min_examined_row_limit = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -429496729500 -SET @@global.min_examined_row_limit = test; -ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -429496729500 -SET @@session.min_examined_row_limit = 4294967296; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967296 -SET @@session.min_examined_row_limit = -1; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.min_examined_row_limit = 4294967295021; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967295021 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.min_examined_row_limit = test; -ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -4294967295021 -'#------------------FN_DYNVARS_089_06-----------------------#' -SELECT @@global.min_examined_row_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='min_examined_row_limit'; -@@global.min_examined_row_limit = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_089_07-----------------------#' -SELECT @@session.min_examined_row_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='min_examined_row_limit'; -@@session.min_examined_row_limit = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_089_08-----------------------#' -SET @@global.min_examined_row_limit = TRUE; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -1 -SET @@global.min_examined_row_limit = FALSE; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -'#---------------------FN_DYNVARS_089_09----------------------#' -SET @@global.min_examined_row_limit = 10; -SELECT @@min_examined_row_limit = @@global.min_examined_row_limit; -@@min_examined_row_limit = @@global.min_examined_row_limit -0 -'#---------------------FN_DYNVARS_089_10----------------------#' -SET @@min_examined_row_limit = 100; -SELECT @@min_examined_row_limit = @@local.min_examined_row_limit; -@@min_examined_row_limit = @@local.min_examined_row_limit -1 -SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit; -@@local.min_examined_row_limit = @@session.min_examined_row_limit -1 -'#---------------------FN_DYNVARS_089_11----------------------#' -SET min_examined_row_limit = 1; -SELECT @@min_examined_row_limit; -@@min_examined_row_limit -1 -SELECT local.min_examined_row_limit; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.min_examined_row_limit; -ERROR 42S02: Unknown table 'session' in field list -SELECT min_examined_row_limit = @@session.min_examined_row_limit; -ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list' -SET @@global.min_examined_row_limit = @start_global_value; -SELECT @@global.min_examined_row_limit; -@@global.min_examined_row_limit -0 -SET @@session.min_examined_row_limit = @start_session_value; -SELECT @@session.min_examined_row_limit; -@@session.min_examined_row_limit -0 diff --git a/mysql-test/r/multi_range_count_basic_64.result b/mysql-test/r/multi_range_count_basic_64.result deleted file mode 100644 index f2115aec2e2..00000000000 --- a/mysql-test/r/multi_range_count_basic_64.result +++ /dev/null @@ -1,184 +0,0 @@ -SET @start_global_value = @@global.multi_range_count; -SELECT @start_global_value; -@start_global_value -256 -SET @start_session_value = @@session.multi_range_count; -SELECT @start_session_value; -@start_session_value -256 -'#--------------------FN_DYNVARS_090_01-------------------------#' -SET @@global.multi_range_count = 100; -SET @@global.multi_range_count = DEFAULT; -SELECT @@global.multi_range_count; -@@global.multi_range_count -256 -SET @@session.multi_range_count = 200; -SET @@session.multi_range_count = DEFAULT; -SELECT @@session.multi_range_count; -@@session.multi_range_count -256 -'#--------------------FN_DYNVARS_090_02-------------------------#' -SET @@global.multi_range_count = DEFAULT; -SELECT @@global.multi_range_count = 256; -@@global.multi_range_count = 256 -1 -SET @@session.multi_range_count = DEFAULT; -SELECT @@session.multi_range_count = 256; -@@session.multi_range_count = 256 -1 -'#--------------------FN_DYNVARS_090_03-------------------------#' -SET @@global.multi_range_count = 1; -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = 60020; -SELECT @@global.multi_range_count; -@@global.multi_range_count -60020 -SET @@global.multi_range_count = 65535; -SELECT @@global.multi_range_count; -@@global.multi_range_count -65535 -SET @@global.multi_range_count = 4294967295; -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967295 -SET @@global.multi_range_count = 4294967294; -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967294 -'#--------------------FN_DYNVARS_090_04-------------------------#' -SET @@session.multi_range_count = 1; -SELECT @@session.multi_range_count; -@@session.multi_range_count -1 -SET @@session.multi_range_count = 50050; -SELECT @@session.multi_range_count; -@@session.multi_range_count -50050 -SET @@session.multi_range_count = 65535; -SELECT @@session.multi_range_count; -@@session.multi_range_count -65535 -SET @@session.multi_range_count = 4294967295; -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967295 -SET @@session.multi_range_count = 4294967294; -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967294 -'#------------------FN_DYNVARS_090_05-----------------------#' -SET @@global.multi_range_count = 0; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = 4294967296; -SELECT @@global.multi_range_count; -@@global.multi_range_count -4294967296 -SET @@global.multi_range_count = -1024; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = 429496729500; -SELECT @@global.multi_range_count; -@@global.multi_range_count -429496729500 -SET @@global.multi_range_count = 65530.34; -ERROR 42000: Incorrect argument type to variable 'multi_range_count' -SELECT @@global.multi_range_count; -@@global.multi_range_count -429496729500 -SET @@global.multi_range_count = test; -ERROR 42000: Incorrect argument type to variable 'multi_range_count' -SELECT @@global.multi_range_count; -@@global.multi_range_count -429496729500 -SET @@session.multi_range_count = 0; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@session.multi_range_count; -@@session.multi_range_count -1 -SET @@session.multi_range_count = 4294967296; -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967296 -SET @@session.multi_range_count = -1; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@session.multi_range_count; -@@session.multi_range_count -1 -SET @@session.multi_range_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.multi_range_count = 4294967295021; -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967295021 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.multi_range_count = test; -ERROR 42000: Incorrect argument type to variable 'multi_range_count' -SELECT @@session.multi_range_count; -@@session.multi_range_count -4294967295021 -'#------------------FN_DYNVARS_090_06-----------------------#' -SELECT @@global.multi_range_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='multi_range_count'; -@@global.multi_range_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_090_07-----------------------#' -SELECT @@session.multi_range_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='multi_range_count'; -@@session.multi_range_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_090_08-----------------------#' -SET @@global.multi_range_count = TRUE; -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -SET @@global.multi_range_count = FALSE; -Warnings: -Warning 1292 Truncated incorrect multi_range_count value: '0' -SELECT @@global.multi_range_count; -@@global.multi_range_count -1 -'#---------------------FN_DYNVARS_090_09----------------------#' -SET @@global.multi_range_count = 10; -SELECT @@multi_range_count = @@global.multi_range_count; -@@multi_range_count = @@global.multi_range_count -0 -'#---------------------FN_DYNVARS_090_10----------------------#' -SET @@multi_range_count = 100; -SELECT @@multi_range_count = @@local.multi_range_count; -@@multi_range_count = @@local.multi_range_count -1 -SELECT @@local.multi_range_count = @@session.multi_range_count; -@@local.multi_range_count = @@session.multi_range_count -1 -'#---------------------FN_DYNVARS_090_11----------------------#' -SET multi_range_count = 1; -SELECT @@multi_range_count; -@@multi_range_count -1 -SELECT local.multi_range_count; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.multi_range_count; -ERROR 42S02: Unknown table 'session' in field list -SELECT multi_range_count = @@session.multi_range_count; -ERROR 42S22: Unknown column 'multi_range_count' in 'field list' -SET @@global.multi_range_count = @start_global_value; -SELECT @@global.multi_range_count; -@@global.multi_range_count -256 -SET @@session.multi_range_count = @start_session_value; -SELECT @@session.multi_range_count; -@@session.multi_range_count -256 diff --git a/mysql-test/r/myisam_max_sort_file_size_basic_64.result b/mysql-test/r/myisam_max_sort_file_size_basic_64.result deleted file mode 100644 index 00ff1dfc1ab..00000000000 --- a/mysql-test/r/myisam_max_sort_file_size_basic_64.result +++ /dev/null @@ -1,114 +0,0 @@ -SET @start_global_value = @@global.myisam_max_sort_file_size; -SELECT @start_global_value; -@start_global_value -9223372036854775807 -'#--------------------FN_DYNVARS_094_01-------------------------#' -SET @@global.myisam_max_sort_file_size = 500000; -SET @@global.myisam_max_sort_file_size = DEFAULT; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -9223372036853727232 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_094_02-------------------------#' -SET @@global.myisam_max_sort_file_size = DEFAULT; -SELECT @@global.myisam_max_sort_file_size = 2147483648; -@@global.myisam_max_sort_file_size = 2147483648 -0 -'#--------------------FN_DYNVARS_094_03-------------------------#' -SET @@global.myisam_max_sort_file_size = 0; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 1024; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 123456789; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -122683392 -SET @@global.myisam_max_sort_file_size = 2147483648*2; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -4294967296 -SET @@global.myisam_max_sort_file_size = 2147483648*1024; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -2199023255552 -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -2199023255552 -SET @@global.myisam_max_sort_file_size = 2147483648*2147483648; -'#--------------------FN_DYNVARS_094_04-------------------------#' -SET @@myisam_max_sort_file_size = 2; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.myisam_max_sort_file_size = 3; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.myisam_max_sort_file_size = 4; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_094_05-----------------------#' -SET @@global.myisam_max_sort_file_size = -1; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = -2147483648; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = -2147483649; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 2147483649.56; -ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = 1G; -ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -'#------------------FN_DYNVARS_094_06-----------------------#' -SET @@global.myisam_max_sort_file_size = 3000; -SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_max_sort_file_size'; -@@global.myisam_max_sort_file_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_094_07-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_max_sort_file_size'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_094_08-----------------------#' -SET @@global.myisam_max_sort_file_size = TRUE; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -SET @@global.myisam_max_sort_file_size = FALSE; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.myisam_max_sort_file_size = 512; -SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size; -@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET myisam_max_sort_file_size = 2048; -ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT myisam_max_sort_file_size; -ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list' -SELECT @@myisam_max_sort_file_size; -@@myisam_max_sort_file_size -0 -SET global myisam_max_sort_file_size = 64; -SET @@global.myisam_max_sort_file_size = @start_global_value; -SELECT @@global.myisam_max_sort_file_size; -@@global.myisam_max_sort_file_size -9223372036853727232 diff --git a/mysql-test/r/myisam_repair_threads_basic_64.result b/mysql-test/r/myisam_repair_threads_basic_64.result deleted file mode 100644 index 8271451cc9e..00000000000 --- a/mysql-test/r/myisam_repair_threads_basic_64.result +++ /dev/null @@ -1,178 +0,0 @@ -SET @start_global_value = @@global.myisam_repair_threads; -SELECT @start_global_value; -@start_global_value -1 -SET @start_session_value = @@session.myisam_repair_threads; -SELECT @start_session_value; -@start_session_value -1 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.myisam_repair_threads = 100; -SET @@global.myisam_repair_threads = DEFAULT; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = 200; -SET @@session.myisam_repair_threads = DEFAULT; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.myisam_repair_threads = DEFAULT; -SELECT @@global.myisam_repair_threads = 1; -@@global.myisam_repair_threads = 1 -1 -SET @@session.myisam_repair_threads = DEFAULT; -SELECT @@session.myisam_repair_threads = 1; -@@session.myisam_repair_threads = 1 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.myisam_repair_threads = 1; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = 4294967295; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -4294967295 -SET @@global.myisam_repair_threads = 655354; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -655354 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.myisam_repair_threads = 1; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = 4294967295; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -4294967295 -SET @@session.myisam_repair_threads = 655345; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -655345 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.myisam_repair_threads = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = -1024; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = 429496729533; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -429496729533 -SET @@global.myisam_repair_threads = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -429496729533 -SET @@global.myisam_repair_threads = test; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -429496729533 -SET @@global.myisam_repair_threads = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -429496729533 -SET @@global.myisam_repair_threads = 'test'; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -429496729533 -SET @@global.myisam_repair_threads = ON; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -429496729533 -SET @@session.myisam_repair_threads = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = -2; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = test; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.myisam_repair_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_repair_threads '; -@@global.myisam_repair_threads = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.myisam_repair_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_repair_threads '; -@@session.myisam_repair_threads = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_08-----------------------#' -SET @@global.myisam_repair_threads = TRUE; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@global.myisam_repair_threads = FALSE; -Warnings: -Warning 1292 Truncated incorrect myisam_repair_threads value: '0' -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.myisam_repair_threads = 10; -SELECT @@myisam_repair_threads = @@global.myisam_repair_threads ; -@@myisam_repair_threads = @@global.myisam_repair_threads -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@myisam_repair_threads = 100; -SELECT @@myisam_repair_threads = @@local.myisam_repair_threads ; -@@myisam_repair_threads = @@local.myisam_repair_threads -1 -SELECT @@local.myisam_repair_threads = @@session.myisam_repair_threads ; -@@local.myisam_repair_threads = @@session.myisam_repair_threads -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET myisam_repair_threads = 1; -SELECT @@myisam_repair_threads ; -@@myisam_repair_threads -1 -SELECT local.myisam_repair_threads ; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.myisam_repair_threads ; -ERROR 42S02: Unknown table 'session' in field list -SELECT myisam_repair_threads = @@session.myisam_repair_threads ; -ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list' -SET @@global.myisam_repair_threads = @start_global_value; -SELECT @@global.myisam_repair_threads ; -@@global.myisam_repair_threads -1 -SET @@session.myisam_repair_threads = @start_session_value; -SELECT @@session.myisam_repair_threads ; -@@session.myisam_repair_threads -1 diff --git a/mysql-test/r/myisam_sort_buffer_size_basic_64.result b/mysql-test/r/myisam_sort_buffer_size_basic_64.result deleted file mode 100644 index bfcada76a46..00000000000 --- a/mysql-test/r/myisam_sort_buffer_size_basic_64.result +++ /dev/null @@ -1,182 +0,0 @@ -SET @start_global_value = @@global.myisam_sort_buffer_size ; -SELECT @start_global_value; -@start_global_value -8388608 -SET @start_session_value = @@session.myisam_sort_buffer_size ; -SELECT @start_session_value; -@start_session_value -8388608 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.myisam_sort_buffer_size = 100; -SET @@global.myisam_sort_buffer_size = DEFAULT; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -8388608 -SET @@session.myisam_sort_buffer_size = 200; -SET @@session.myisam_sort_buffer_size = DEFAULT; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -8388608 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.myisam_sort_buffer_size = DEFAULT; -SELECT @@global.myisam_sort_buffer_size = 8388608; -@@global.myisam_sort_buffer_size = 8388608 -1 -SET @@session.myisam_sort_buffer_size = DEFAULT; -SELECT @@session.myisam_sort_buffer_size = 8388608; -@@session.myisam_sort_buffer_size = 8388608 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.myisam_sort_buffer_size = 4; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = 4294967295; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4294967295 -SET @@global.myisam_sort_buffer_size = 655354; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -655354 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.myisam_sort_buffer_size = 4; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = 4294967295; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4294967295 -SET @@session.myisam_sort_buffer_size = 655345; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -655345 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.myisam_sort_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = -1024; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = 429496729533; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -429496729533 -SET @@global.myisam_sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -429496729533 -SET @@global.myisam_sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -429496729533 -SET @@global.myisam_sort_buffer_size = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -429496729533 -SET @@global.myisam_sort_buffer_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -429496729533 -SET @@global.myisam_sort_buffer_size = ON; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -429496729533 -SET @@session.myisam_sort_buffer_size = 0; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = -2; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -SET @@session.myisam_sort_buffer_size = "test"; -ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -4 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_sort_buffer_size '; -@@global.myisam_sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_sort_buffer_size '; -@@session.myisam_sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_08-----------------------#' -SET @@global.myisam_sort_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -SET @@global.myisam_sort_buffer_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -4 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.myisam_sort_buffer_size = 10; -SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; -@@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@myisam_sort_buffer_size = 100; -SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; -@@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size -1 -SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; -@@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET myisam_sort_buffer_size = 1; -Warnings: -Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' -SELECT @@myisam_sort_buffer_size ; -@@myisam_sort_buffer_size -4 -SELECT local.myisam_sort_buffer_size ; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.myisam_sort_buffer_size ; -ERROR 42S02: Unknown table 'session' in field list -SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; -ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list' -SET @@global.myisam_sort_buffer_size = @start_global_value; -SELECT @@global.myisam_sort_buffer_size ; -@@global.myisam_sort_buffer_size -8388608 -SET @@session.myisam_sort_buffer_size = @start_session_value; -SELECT @@session.myisam_sort_buffer_size ; -@@session.myisam_sort_buffer_size -8388608 diff --git a/mysql-test/r/net_retry_count_basic_64.result b/mysql-test/r/net_retry_count_basic_64.result deleted file mode 100644 index db133d23f79..00000000000 --- a/mysql-test/r/net_retry_count_basic_64.result +++ /dev/null @@ -1,184 +0,0 @@ -SET @start_global_value = @@global.net_retry_count; -SELECT @start_global_value; -@start_global_value -10 -SET @start_session_value = @@session.net_retry_count; -SELECT @start_session_value; -@start_session_value -10 -'#--------------------FN_DYNVARS_111_01-------------------------#' -SET @@global.net_retry_count = 100; -SET @@global.net_retry_count = DEFAULT; -SELECT @@global.net_retry_count; -@@global.net_retry_count -10 -SET @@session.net_retry_count = 200; -SET @@session.net_retry_count = DEFAULT; -SELECT @@session.net_retry_count; -@@session.net_retry_count -10 -'#--------------------FN_DYNVARS_111_02-------------------------#' -SET @@global.net_retry_count = DEFAULT; -SELECT @@global.net_retry_count = 10; -@@global.net_retry_count = 10 -1 -SET @@session.net_retry_count = DEFAULT; -SELECT @@session.net_retry_count = 10; -@@session.net_retry_count = 10 -1 -'#--------------------FN_DYNVARS_111_03-------------------------#' -SET @@global.net_retry_count = 1; -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = 2; -SELECT @@global.net_retry_count; -@@global.net_retry_count -2 -SET @@global.net_retry_count = 4294967295; -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967295 -SET @@global.net_retry_count = 4294967294; -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967294 -SET @@global.net_retry_count = 65536; -SELECT @@global.net_retry_count; -@@global.net_retry_count -65536 -'#--------------------FN_DYNVARS_111_04-------------------------#' -SET @@session.net_retry_count = 1; -SELECT @@session.net_retry_count; -@@session.net_retry_count -1 -SET @@session.net_retry_count = 2; -SELECT @@session.net_retry_count; -@@session.net_retry_count -2 -SET @@session.net_retry_count = 65535; -SELECT @@session.net_retry_count; -@@session.net_retry_count -65535 -SET @@session.net_retry_count = 4294967295; -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967295 -SET @@session.net_retry_count = 4294967294; -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967294 -'#------------------FN_DYNVARS_111_05-----------------------#' -SET @@global.net_retry_count = 0; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = -1024; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = 4294967296; -SELECT @@global.net_retry_count; -@@global.net_retry_count -4294967296 -SET @@global.net_retry_count = 429496729500; -SELECT @@global.net_retry_count; -@@global.net_retry_count -429496729500 -SET @@global.net_retry_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.net_retry_count; -@@global.net_retry_count -429496729500 -SET @@global.net_retry_count = test; -ERROR 42000: Incorrect argument type to variable 'net_retry_count' -SELECT @@global.net_retry_count; -@@global.net_retry_count -429496729500 -SET @@session.net_retry_count = 0; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@session.net_retry_count; -@@session.net_retry_count -1 -SET @@session.net_retry_count = -2; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@session.net_retry_count; -@@session.net_retry_count -1 -SET @@session.net_retry_count = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.net_retry_count = 6555015425; -SELECT @@session.net_retry_count; -@@session.net_retry_count -6555015425 -SET @@session.net_retry_count = 4294967296; -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967296 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.net_retry_count = test; -ERROR 42000: Incorrect argument type to variable 'net_retry_count' -SELECT @@session.net_retry_count; -@@session.net_retry_count -4294967296 -'#------------------FN_DYNVARS_111_06-----------------------#' -SELECT @@global.net_retry_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='net_retry_count'; -@@global.net_retry_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_111_07-----------------------#' -SELECT @@session.net_retry_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='net_retry_count'; -@@session.net_retry_count = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_111_08-----------------------#' -SET @@global.net_retry_count = TRUE; -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -SET @@global.net_retry_count = FALSE; -Warnings: -Warning 1292 Truncated incorrect net_retry_count value: '0' -SELECT @@global.net_retry_count; -@@global.net_retry_count -1 -'#---------------------FN_DYNVARS_111_09----------------------#' -SET @@global.net_retry_count = 10; -SELECT @@net_retry_count = @@global.net_retry_count; -@@net_retry_count = @@global.net_retry_count -0 -'#---------------------FN_DYNVARS_111_10----------------------#' -SET @@net_retry_count = 100; -SELECT @@net_retry_count = @@local.net_retry_count; -@@net_retry_count = @@local.net_retry_count -1 -SELECT @@local.net_retry_count = @@session.net_retry_count; -@@local.net_retry_count = @@session.net_retry_count -1 -'#---------------------FN_DYNVARS_111_11----------------------#' -SET net_retry_count = 1; -SELECT @@net_retry_count; -@@net_retry_count -1 -SELECT local.net_retry_count; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.net_retry_count; -ERROR 42S02: Unknown table 'session' in field list -SELECT net_retry_count = @@session.net_retry_count; -ERROR 42S22: Unknown column 'net_retry_count' in 'field list' -SET @@global.net_retry_count = @start_global_value; -SELECT @@global.net_retry_count; -@@global.net_retry_count -10 -SET @@session.net_retry_count = @start_session_value; -SELECT @@session.net_retry_count; -@@session.net_retry_count -10 diff --git a/mysql-test/r/query_alloc_block_size_basic_64.result b/mysql-test/r/query_alloc_block_size_basic_64.result deleted file mode 100644 index 57c96a8168a..00000000000 --- a/mysql-test/r/query_alloc_block_size_basic_64.result +++ /dev/null @@ -1,199 +0,0 @@ -SET @start_global_value = @@global.query_alloc_block_size; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.query_alloc_block_size; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_130_01-------------------------#' -SET @@global.query_alloc_block_size = 10000; -SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -8192 -SET @@session.query_alloc_block_size = 20000; -SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -8192 -'#--------------------FN_DYNVARS_130_02-------------------------#' -SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size = 8192; -@@global.query_alloc_block_size = 8192 -1 -SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size = 8192; -@@session.query_alloc_block_size = 8192 -1 -'#--------------------FN_DYNVARS_130_03-------------------------#' -SET @@global.query_alloc_block_size = 1024; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 1025; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 4294967295; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294966272 -SET @@global.query_alloc_block_size = 4294967294; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294966272 -SET @@global.query_alloc_block_size = 65536; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -65536 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_130_04-------------------------#' -SET @@session.query_alloc_block_size = 1024; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 1025; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 4294967295; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294966272 -SET @@session.query_alloc_block_size = 4294967294; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294966272 -SET @@session.query_alloc_block_size = 655536; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -655360 -'#------------------FN_DYNVARS_130_05-----------------------#' -SET @@global.query_alloc_block_size = 64; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '64' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = -1; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '0' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 1023; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = 4294967296; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294967296 -SET @@global.query_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294967296 -SET @@global.query_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -4294967296 -SET @@session.query_alloc_block_size = 64; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '64' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = -2; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '0' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.query_alloc_block_size = 1023; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -1024 -SET @@session.query_alloc_block_size = 4294967296; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294967296 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.query_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -4294967296 -'#------------------FN_DYNVARS_130_06-----------------------#' -'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement'; -SET @@global.query_alloc_block_size = 1; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1' -SET @@session.query_alloc_block_size = 12; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '12' -SELECT @@global.query_alloc_block_size = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_alloc_block_size'; -@@global.query_alloc_block_size = -VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_130_07-----------------------#' -SELECT @@session.query_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_alloc_block_size'; -@@session.query_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_130_08-----------------------#' -SET @@global.query_alloc_block_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '1' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -SET @@global.query_alloc_block_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect query_alloc_block_size value: '0' -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -1024 -'#---------------------FN_DYNVARS_130_09----------------------#' -SET @@global.query_alloc_block_size = 2048; -SELECT @@query_alloc_block_size = @@global.query_alloc_block_size; -@@query_alloc_block_size = @@global.query_alloc_block_size -0 -'#---------------------FN_DYNVARS_130_10----------------------#' -SET @@query_alloc_block_size = 5000; -SELECT @@query_alloc_block_size = @@local.query_alloc_block_size; -@@query_alloc_block_size = @@local.query_alloc_block_size -1 -SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size; -@@local.query_alloc_block_size = @@session.query_alloc_block_size -1 -'#---------------------FN_DYNVARS_130_11----------------------#' -SET query_alloc_block_size = 1024; -SELECT @@query_alloc_block_size; -@@query_alloc_block_size -1024 -SELECT local.query_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.query_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT query_alloc_block_size = @@session.query_alloc_block_size; -ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list' -SET @@global.query_alloc_block_size = @start_global_value; -SELECT @@global.query_alloc_block_size; -@@global.query_alloc_block_size -8192 -SET @@session.query_alloc_block_size = @start_session_value; -SELECT @@session.query_alloc_block_size; -@@session.query_alloc_block_size -8192 diff --git a/mysql-test/r/query_cache_limit_basic_64.result b/mysql-test/r/query_cache_limit_basic_64.result deleted file mode 100644 index a592883ef91..00000000000 --- a/mysql-test/r/query_cache_limit_basic_64.result +++ /dev/null @@ -1,120 +0,0 @@ -SET @start_value = @@global.query_cache_limit; -SELECT @start_value; -@start_value -1048576 -'#--------------------FN_DYNVARS_131_01------------------------#' -SET @@global.query_cache_limit = 99; -SET @@global.query_cache_limit = DEFAULT; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048576 -'#---------------------FN_DYNVARS_131_02-------------------------#' -SET @@global.query_cache_limit = @start_value; -SELECT @@global.query_cache_limit = 1048576; -@@global.query_cache_limit = 1048576 -1 -'#--------------------FN_DYNVARS_131_03------------------------#' -SET @@global.query_cache_limit = 0; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -SET @@global.query_cache_limit = 1; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1 -SET @@global.query_cache_limit = 1048576; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048576 -SET @@global.query_cache_limit = 1048575; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048575 -'#--------------------FN_DYNVARS_131_04-------------------------#' -SET @@global.query_cache_limit = -1; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -SET @@global.query_cache_limit = 4294967296; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -4294967296 -SET @@global.query_cache_limit = 10240022115; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -10240022115 -SET @@global.query_cache_limit = 10000.01; -ERROR 42000: Incorrect argument type to variable 'query_cache_limit' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -10240022115 -SET @@global.query_cache_limit = -1024; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -SET @@global.query_cache_limit = 42949672950; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -42949672950 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.query_cache_limit = ON; -ERROR 42000: Incorrect argument type to variable 'query_cache_limit' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -42949672950 -SET @@global.query_cache_limit = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_cache_limit' -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -42949672950 -'#-------------------FN_DYNVARS_131_05----------------------------#' -SET @@session.query_cache_limit = 0; -ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_limit; -@@query_cache_limit -42949672950 -'#----------------------FN_DYNVARS_131_06------------------------#' -SELECT @@global.query_cache_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_limit'; -@@global.query_cache_limit = VARIABLE_VALUE -1 -SELECT @@query_cache_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_limit'; -@@query_cache_limit = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_131_07----------------------#' -SET @@global.query_cache_limit = TRUE; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1 -SET @@global.query_cache_limit = FALSE; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -0 -'#---------------------FN_DYNVARS_131_08----------------------#' -SET @@global.query_cache_limit = 1; -SELECT @@query_cache_limit = @@global.query_cache_limit; -@@query_cache_limit = @@global.query_cache_limit -1 -'#---------------------FN_DYNVARS_131_09----------------------#' -SET query_cache_limit = 1; -ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_limit; -@@query_cache_limit -1 -SET local.query_cache_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 -SELECT local.query_cache_limit; -ERROR 42S02: Unknown table 'local' in field list -SET global.query_cache_limit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 -SELECT global.query_cache_limit; -ERROR 42S02: Unknown table 'global' in field list -SELECT query_cache_limit = @@session.query_cache_limit; -ERROR 42S22: Unknown column 'query_cache_limit' in 'field list' -SET @@global.query_cache_limit = @start_value; -SELECT @@global.query_cache_limit; -@@global.query_cache_limit -1048576 diff --git a/mysql-test/r/query_cache_min_res_unit_basic_64.result b/mysql-test/r/query_cache_min_res_unit_basic_64.result deleted file mode 100644 index e1c74d2bbc1..00000000000 --- a/mysql-test/r/query_cache_min_res_unit_basic_64.result +++ /dev/null @@ -1,130 +0,0 @@ -SET @start_value = @@global.query_cache_min_res_unit; -SELECT @start_value; -@start_value -4096 -'#--------------------FN_DYNVARS_132_01------------------------#' -SET @@global.query_cache_min_res_unit = 99; -SET @@global.query_cache_min_res_unit = DEFAULT; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -4096 -'#---------------------FN_DYNVARS_132_02-------------------------#' -SET @@global.query_cache_min_res_unit = @start_value; -SELECT @@global.query_cache_min_res_unit = 4096; -@@global.query_cache_min_res_unit = 4096 -1 -'#--------------------FN_DYNVARS_132_03------------------------#' -SET @@global.query_cache_min_res_unit = 0; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 1; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512'; -SET @@global.query_cache_min_res_unit = 512; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 513; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -520 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.query_cache_min_res_unit = 1048576; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -1048576 -SET @@global.query_cache_min_res_unit = 1048575; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -1048576 -'#--------------------FN_DYNVARS_132_04-------------------------#' -SET @@global.query_cache_min_res_unit = -1; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 4294967296; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -4294967296 -SET @@global.query_cache_min_res_unit = 511; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 10000.01; -ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = -1024; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = 42949672950; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -42949672952 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.query_cache_min_res_unit = ON; -ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -42949672952 -SET @@global.query_cache_min_res_unit = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -42949672952 -'#-------------------FN_DYNVARS_132_05----------------------------#' -SET @@session.query_cache_min_res_unit = 0; -ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_min_res_unit; -@@query_cache_min_res_unit -42949672952 -'#----------------------FN_DYNVARS_132_06------------------------#' -SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_min_res_unit'; -@@global.query_cache_min_res_unit = VARIABLE_VALUE -1 -SELECT @@query_cache_min_res_unit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_min_res_unit'; -@@query_cache_min_res_unit = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_132_07----------------------#' -SET @@global.query_cache_min_res_unit = TRUE; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -SET @@global.query_cache_min_res_unit = FALSE; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -512 -'#---------------------FN_DYNVARS_132_08----------------------#' -SET @@global.query_cache_min_res_unit = 1; -SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit; -@@query_cache_min_res_unit = @@global.query_cache_min_res_unit -1 -'#---------------------FN_DYNVARS_132_09----------------------#' -SET query_cache_min_res_unit = 1; -ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_min_res_unit; -@@query_cache_min_res_unit -512 -SET local.query_cache_min_res_unit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 -SELECT local.query_cache_min_res_unit; -ERROR 42S02: Unknown table 'local' in field list -SET global.query_cache_min_res_unit = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 -SELECT global.query_cache_min_res_unit; -ERROR 42S02: Unknown table 'global' in field list -SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit; -ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list' -SET @@global.query_cache_min_res_unit = @start_value; -SELECT @@global.query_cache_min_res_unit; -@@global.query_cache_min_res_unit -4096 diff --git a/mysql-test/r/query_cache_size_basic_64.result b/mysql-test/r/query_cache_size_basic_64.result deleted file mode 100644 index 0d67eec1ccc..00000000000 --- a/mysql-test/r/query_cache_size_basic_64.result +++ /dev/null @@ -1,134 +0,0 @@ -SET @start_value = @@global.query_cache_size; -SELECT @start_value; -@start_value -0 -'#--------------------FN_DYNVARS_133_01------------------------#' -SET @@global.query_cache_size = 99; -SET @@global.query_cache_size = DEFAULT; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'#---------------------FN_DYNVARS_133_02-------------------------#' -SET @@global.query_cache_size = @start_value; -SELECT @@global.query_cache_size = 0; -@@global.query_cache_size = 0 -1 -'#--------------------FN_DYNVARS_133_03------------------------#' -SET @@global.query_cache_size = 0; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 1; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 512; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 1024; -Warnings: -Warning 1282 Query cache failed to set size 1024; new query cache size is 0 -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -: 'Bug#34880: Warnings are coming on assinging valid values to variable -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.query_cache_size = 1048576; -SELECT @@global.query_cache_size; -@@global.query_cache_size -1048576 -SET @@global.query_cache_size = 1048575; -SELECT @@global.query_cache_size; -@@global.query_cache_size -1047552 -'#--------------------FN_DYNVARS_133_04-------------------------#' -SET @@global.query_cache_size = -1; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 4294967296; -SELECT @@global.query_cache_size; -@@global.query_cache_size -4294967296 -SET @@global.query_cache_size = 511; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 10000.01; -ERROR 42000: Incorrect argument type to variable 'query_cache_size' -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = -1024; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 42949672950; -Warnings: -Warning 1282 Query cache failed to set size 42949671936; new query cache size is 0 -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.query_cache_size = ON; -ERROR 42000: Incorrect argument type to variable 'query_cache_size' -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_cache_size' -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'#-------------------FN_DYNVARS_133_05----------------------------#' -SET @@session.query_cache_size = 0; -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_size; -@@query_cache_size -0 -'#----------------------FN_DYNVARS_133_06------------------------#' -SELECT @@global.query_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; -@@global.query_cache_size = VARIABLE_VALUE -1 -SELECT @@query_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; -@@query_cache_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_133_07----------------------#' -SET @@global.query_cache_size = TRUE; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -SET @@global.query_cache_size = FALSE; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 -'#---------------------FN_DYNVARS_133_08----------------------#' -SET @@global.query_cache_size = 1; -SELECT @@query_cache_size = @@global.query_cache_size; -@@query_cache_size = @@global.query_cache_size -1 -'#---------------------FN_DYNVARS_133_09----------------------#' -SET query_cache_size = 1; -ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@query_cache_size; -@@query_cache_size -0 -SET local.query_cache_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 -SELECT local.query_cache_size; -ERROR 42S02: Unknown table 'local' in field list -SET global.query_cache_size = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 -SELECT global.query_cache_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT query_cache_size = @@session.query_cache_size; -ERROR 42S22: Unknown column 'query_cache_size' in 'field list' -SET @@global.query_cache_size = @start_value; -SELECT @@global.query_cache_size; -@@global.query_cache_size -0 diff --git a/mysql-test/r/query_prealloc_size_basic_64.result b/mysql-test/r/query_prealloc_size_basic_64.result deleted file mode 100644 index fe8aba990a7..00000000000 --- a/mysql-test/r/query_prealloc_size_basic_64.result +++ /dev/null @@ -1,178 +0,0 @@ -SET @start_global_value = @@global.query_prealloc_size ; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.query_prealloc_size ; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.query_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '100' -SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 200; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '200' -SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size = 8192; -@@global.query_prealloc_size = 8192 -1 -SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size = 8192; -@@session.query_prealloc_size = 8192 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.query_prealloc_size = 8192; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = 655354; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -654336 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.query_prealloc_size = 8192; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 655345; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -654336 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.query_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = -1024; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = test; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = "test"; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = -2; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = test; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -SET @@session.query_prealloc_size = "test"; -ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_prealloc_size '; -@@global.query_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_prealloc_size '; -@@session.query_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_08-----------------------#' -SET @@global.query_prealloc_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '1' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@global.query_prealloc_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '0' -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.query_prealloc_size = 10; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '10' -SELECT @@query_prealloc_size = @@global.query_prealloc_size ; -@@query_prealloc_size = @@global.query_prealloc_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@query_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '100' -SELECT @@query_prealloc_size = @@local.query_prealloc_size ; -@@query_prealloc_size = @@local.query_prealloc_size -1 -SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ; -@@local.query_prealloc_size = @@session.query_prealloc_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET query_prealloc_size = 1; -Warnings: -Warning 1292 Truncated incorrect query_prealloc_size value: '1' -SELECT @@query_prealloc_size ; -@@query_prealloc_size -8192 -SELECT local.query_prealloc_size ; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.query_prealloc_size ; -ERROR 42S02: Unknown table 'session' in field list -SELECT query_prealloc_size = @@session.query_prealloc_size ; -ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list' -SET @@global.query_prealloc_size = @start_global_value; -SELECT @@global.query_prealloc_size ; -@@global.query_prealloc_size -8192 -SET @@session.query_prealloc_size = @start_session_value; -SELECT @@session.query_prealloc_size ; -@@session.query_prealloc_size -8192 diff --git a/mysql-test/r/range_alloc_block_size_basic_64.result b/mysql-test/r/range_alloc_block_size_basic_64.result deleted file mode 100644 index 26ddfdd2bae..00000000000 --- a/mysql-test/r/range_alloc_block_size_basic_64.result +++ /dev/null @@ -1,178 +0,0 @@ -SET @start_global_value = @@global.range_alloc_block_size; -SELECT @start_global_value; -@start_global_value -4096 -SET @start_session_value = @@session.range_alloc_block_size; -SELECT @start_session_value; -@start_session_value -4096 -'#--------------------FN_DYNVARS_137_01-------------------------#' -SET @@global.range_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '100' -SET @@global.range_alloc_block_size = DEFAULT; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = 200; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '200' -SET @@session.range_alloc_block_size = DEFAULT; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -'#--------------------FN_DYNVARS_137_02-------------------------#' -SET @@global.range_alloc_block_size = DEFAULT; -SELECT @@global.range_alloc_block_size = 2048; -@@global.range_alloc_block_size = 2048 -0 -SET @@session.range_alloc_block_size = DEFAULT; -SELECT @@session.range_alloc_block_size = 2048; -@@session.range_alloc_block_size = 2048 -0 -'#--------------------FN_DYNVARS_137_03-------------------------#' -SET @@global.range_alloc_block_size = 2048; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.range_alloc_block_size = 4294967295; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4294966272 -SET @@global.range_alloc_block_size = 4294967294; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_137_04-------------------------#' -SET @@session.range_alloc_block_size = 2048; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = 4294967295; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294966272 -SET @@session.range_alloc_block_size = 4294967294; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294966272 -'#------------------FN_DYNVARS_137_05-----------------------#' -SET @@global.range_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@global.range_alloc_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@global.range_alloc_block_size = 42949672951; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -42949671936 -SET @@global.range_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -42949671936 -SET @@global.range_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -42949671936 -SET @@session.range_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = -2; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.range_alloc_block_size = 4294967296; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294967296 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.range_alloc_block_size = test; -ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4294967296 -'#------------------FN_DYNVARS_137_06-----------------------#' -SELECT @@global.range_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='range_alloc_block_size'; -@@global.range_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_137_07-----------------------#' -SELECT @@session.range_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='range_alloc_block_size'; -@@session.range_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_137_08-----------------------#' -SET @@global.range_alloc_block_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '1' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@global.range_alloc_block_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '0' -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -'#---------------------FN_DYNVARS_137_09----------------------#' -SET @@global.range_alloc_block_size = 10; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '10' -SELECT @@range_alloc_block_size = @@global.range_alloc_block_size; -@@range_alloc_block_size = @@global.range_alloc_block_size -0 -'#---------------------FN_DYNVARS_137_10----------------------#' -SET @@range_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '100' -SELECT @@range_alloc_block_size = @@local.range_alloc_block_size; -@@range_alloc_block_size = @@local.range_alloc_block_size -1 -SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size; -@@local.range_alloc_block_size = @@session.range_alloc_block_size -1 -'#---------------------FN_DYNVARS_137_11----------------------#' -SET range_alloc_block_size = 1; -Warnings: -Warning 1292 Truncated incorrect range_alloc_block_size value: '1' -SELECT @@range_alloc_block_size; -@@range_alloc_block_size -4096 -SELECT local.range_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.range_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT range_alloc_block_size = @@session.range_alloc_block_size; -ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list' -SET @@global.range_alloc_block_size = @start_global_value; -SELECT @@global.range_alloc_block_size; -@@global.range_alloc_block_size -4096 -SET @@session.range_alloc_block_size = @start_session_value; -SELECT @@session.range_alloc_block_size; -@@session.range_alloc_block_size -4096 diff --git a/mysql-test/r/rpl_recovery_rank_basic_64.result b/mysql-test/r/rpl_recovery_rank_basic_64.result deleted file mode 100644 index d4dd46eba71..00000000000 --- a/mysql-test/r/rpl_recovery_rank_basic_64.result +++ /dev/null @@ -1,110 +0,0 @@ -SET @start_global_value = @@global.rpl_recovery_rank; -SELECT @start_global_value; -@start_global_value -0 -'#--------------------FN_DYNVARS_142_01-------------------------#' -SET @@global.rpl_recovery_rank = 500000; -SET @@global.rpl_recovery_rank = DEFAULT; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -'#--------------------FN_DYNVARS_142_02-------------------------#' -SET @@global.rpl_recovery_rank = 0; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = 1024; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -1024 -SET @@global.rpl_recovery_rank = 123456789; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -123456789 -SET @@global.rpl_recovery_rank = 2147483648*2; -Warnings: -Warning 1292 Truncated incorrect rpl-recovery-rank value: '4294967296' -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -SET @@global.rpl_recovery_rank = 2147483648*1024; -Warnings: -Warning 1292 Truncated incorrect rpl-recovery-rank value: '2199023255552' -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -SET @@global.rpl_recovery_rank = 2147483648*2147483648; -Warnings: -Warning 1292 Truncated incorrect rpl-recovery-rank value: '4611686018427387904' -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -4294967295 -'#--------------------FN_DYNVARS_142_03-------------------------#' -SET @@rpl_recovery_rank = 2; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.rpl_recovery_rank = 3; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.rpl_recovery_rank = 4; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_142_04-----------------------#' -SET @@global.rpl_recovery_rank = -1; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = -2147483648; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = -2147483649; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -SET @@global.rpl_recovery_rank = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@global.rpl_recovery_rank = 2147483649.56; -ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' -SET @@global.rpl_recovery_rank = 1G; -ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' -'#------------------FN_DYNVARS_142_05-----------------------#' -SET @@global.rpl_recovery_rank = 3000; -SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='rpl_recovery_rank'; -@@global.rpl_recovery_rank = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_142_06-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='rpl_recovery_rank'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_142_07-----------------------#' -SET @@global.rpl_recovery_rank = TRUE; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -1 -SET @@global.rpl_recovery_rank = FALSE; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 -'#---------------------FN_DYNVARS_001_08----------------------#' -SET @@global.rpl_recovery_rank = 512; -SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank; -@@rpl_recovery_rank = @@global.rpl_recovery_rank -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET rpl_recovery_rank = 2048; -ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL -SELECT rpl_recovery_rank; -ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list' -SELECT @@rpl_recovery_rank; -@@rpl_recovery_rank -512 -SET global rpl_recovery_rank = 64; -SET @@global.rpl_recovery_rank = @start_global_value; -SELECT @@global.rpl_recovery_rank; -@@global.rpl_recovery_rank -0 diff --git a/mysql-test/r/server_id_basic_64.result b/mysql-test/r/server_id_basic_64.result deleted file mode 100644 index b6f3095ccfe..00000000000 --- a/mysql-test/r/server_id_basic_64.result +++ /dev/null @@ -1,115 +0,0 @@ -SET @@global.general_log= 0; -SET @start_global_value = @@global.server_id; -SELECT @start_global_value; -@start_global_value -1 -'#--------------------FN_DYNVARS_144_01-------------------------#' -SET @@global.server_id = 500000; -SET @@global.server_id = DEFAULT; -SELECT @@global.server_id; -@@global.server_id -0 -'#--------------------FN_DYNVARS_144_02-------------------------#' -SET @@global.server_id = DEFAULT; -SELECT @@global.server_id = 0; -@@global.server_id = 0 -1 -'#--------------------FN_DYNVARS_144_03-------------------------#' -SET @@global.server_id = 0; -SELECT @@global.server_id; -@@global.server_id -0 -SET @@global.server_id = 1; -SELECT @@global.server_id; -@@global.server_id -1 -SET @@global.server_id = 15; -SELECT @@global.server_id; -@@global.server_id -15 -SET @@global.server_id = 1024; -SELECT @@global.server_id; -@@global.server_id -1024 -SET @@global.server_id = 123456789; -SELECT @@global.server_id; -@@global.server_id -123456789 -SET @@global.server_id = 2147483648; -SELECT @@global.server_id; -@@global.server_id -2147483648 -SET @@global.server_id = 2147483648*2-1; -SELECT @@global.server_id; -@@global.server_id -4294967295 -'#--------------------FN_DYNVARS_144_04-------------------------#' -SET @@server_id = 2; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.server_id = 3; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.server_id = 4; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_144_05-----------------------#' -SET @@global.server_id = -1; -SELECT @@global.server_id; -@@global.server_id -0 -SET @@global.server_id = -2147483648; -SELECT @@global.server_id; -@@global.server_id -0 -SET @@global.server_id = 2147483649*2; -SELECT @@global.server_id; -@@global.server_id -4294967298 -SET @@global.server_id = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@global.server_id = '125'; -ERROR 42000: Incorrect argument type to variable 'server_id' -SET @@global.server_id = 7483649.56; -ERROR 42000: Incorrect argument type to variable 'server_id' -SET @@global.server_id = 1G; -ERROR 42000: Incorrect argument type to variable 'server_id' -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_144_06-----------------------#' -SET @@global.server_id = 3000; -SELECT @@global.server_id = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='server_id'; -@@global.server_id = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_144_07-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='server_id'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_144_08-----------------------#' -SET @@global.server_id = TRUE; -SELECT @@global.server_id; -@@global.server_id -1 -SET @@global.server_id = FALSE; -SELECT @@global.server_id; -@@global.server_id -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.server_id = 512; -SELECT @@server_id = @@global.server_id; -@@server_id = @@global.server_id -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET server_id = 2048; -ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL -SELECT server_id; -ERROR 42S22: Unknown column 'server_id' in 'field list' -SELECT @@server_id; -@@server_id -512 -SET global server_id = 99; -SET @@global.server_id = @start_global_value; -SELECT @@global.server_id; -@@global.server_id -1 -SET @@global.general_log= 1; diff --git a/mysql-test/r/slave_transaction_retries_basic_64.result b/mysql-test/r/slave_transaction_retries_basic_64.result deleted file mode 100644 index 9434b14b238..00000000000 --- a/mysql-test/r/slave_transaction_retries_basic_64.result +++ /dev/null @@ -1,115 +0,0 @@ -SET @start_global_value = @@global.slave_transaction_retries; -SELECT @start_global_value; -@start_global_value -10 -'#--------------------FN_DYNVARS_149_01-------------------------#' -SET @@global.slave_transaction_retries = 50; -SET @@global.slave_transaction_retries = DEFAULT; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -10 -'#--------------------FN_DYNVARS_149_02-------------------------#' -SET @@global.slave_transaction_retries = DEFAULT; -SELECT @@global.slave_transaction_retries = 10; -@@global.slave_transaction_retries = 10 -1 -'#--------------------FN_DYNVARS_149_03-------------------------#' -SET @@global.slave_transaction_retries = 0; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -0 -SET @@global.slave_transaction_retries = 1; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -1 -SET @@global.slave_transaction_retries = 15; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -15 -SET @@global.slave_transaction_retries = 1024; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -1024 -SET @@global.slave_transaction_retries = 2147483648; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -2147483648 -SET @@global.slave_transaction_retries = 2147483648*2-1; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4294967295 -SET @@global.slave_transaction_retries = 2147483649*2; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4294967298 -SET @@global.slave_transaction_retries = 4294967295; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4294967295 -'#--------------------FN_DYNVARS_149_04-------------------------#' -SET @@slave_transaction_retries = 2; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -SET @@session.slave_transaction_retries = 3; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -SET @@local.slave_transaction_retries = 4; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -'#------------------FN_DYNVARS_149_05-----------------------#' -SET @@global.slave_transaction_retries = -1; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -0 -SET @@global.slave_transaction_retries = 2147483649*2147483649; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -4611686022722355201 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.slave_transaction_retries = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@global.slave_transaction_retries = '100'; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -SET @@global.slave_transaction_retries = 7483649.56; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -SET @@global.slave_transaction_retries = ON; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -SET @@global.slave_transaction_retries = OFF; -ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' -'#------------------FN_DYNVARS_149_06-----------------------#' -SET @@global.slave_transaction_retries = 3000; -SELECT @@global.slave_transaction_retries = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slave_transaction_retries'; -@@global.slave_transaction_retries = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_149_07-----------------------#' -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='slave_transaction_retries'; -count(VARIABLE_VALUE) -1 -'#------------------FN_DYNVARS_149_08-----------------------#' -SET @@global.slave_transaction_retries = TRUE; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -1 -SET @@global.slave_transaction_retries = FALSE; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -0 -'#---------------------FN_DYNVARS_149_09----------------------#' -SET @@global.slave_transaction_retries = 60*60; -SELECT @@slave_transaction_retries = @@global.slave_transaction_retries; -@@slave_transaction_retries = @@global.slave_transaction_retries -1 -'#---------------------FN_DYNVARS_149_10----------------------#' -SET slave_transaction_retries = 2048; -ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL -SELECT slave_transaction_retries; -ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list' -SELECT @@slave_transaction_retries; -@@slave_transaction_retries -3600 -SET global slave_transaction_retries = 99; -SET @@global.slave_transaction_retries = @start_global_value; -SELECT @@global.slave_transaction_retries; -@@global.slave_transaction_retries -10 diff --git a/mysql-test/r/sort_buffer_size_basic_64.result b/mysql-test/r/sort_buffer_size_basic_64.result deleted file mode 100644 index e9bd14abc67..00000000000 --- a/mysql-test/r/sort_buffer_size_basic_64.result +++ /dev/null @@ -1,189 +0,0 @@ -SET @start_global_value = @@global.sort_buffer_size; -SELECT @start_global_value; -@start_global_value -262144 -SET @start_session_value = @@session.sort_buffer_size; -SELECT @start_session_value; -@start_session_value -262144 -'#--------------------FN_DYNVARS_151_01-------------------------#' -SET @@global.sort_buffer_size = 1000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '1000' -SET @@global.sort_buffer_size = DEFAULT; -SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116; -@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116 -1 -SET @@session.sort_buffer_size = 2000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '2000' -SET @@session.sort_buffer_size = DEFAULT; -SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116; -@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116 -1 -'#--------------------FN_DYNVARS_151_02-------------------------#' -SET @@global.sort_buffer_size = DEFAULT; -SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116; -@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116 -1 -SET @@session.sort_buffer_size = DEFAULT; -SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116; -@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116 -1 -'#--------------------FN_DYNVARS_151_03-------------------------#' -SET @@global.sort_buffer_size = 32776; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32776' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = 32777; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32777' -SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = 4294967295; -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967295 -SET @@global.sort_buffer_size = 4294967294; -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967294 -'Bug# 34877: Invalid Values are showing in variable on assigning valid values.'; -'#--------------------FN_DYNVARS_151_04-------------------------#' -SET @@session.sort_buffer_size = 32776; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32776' -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = 32777; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32777' -SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = 4294967295; -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967295 -SET @@session.sort_buffer_size = 4294967294; -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967294 -'#------------------FN_DYNVARS_151_05-----------------------#' -SET @@global.sort_buffer_size = 32775; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32775' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = -1024; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '0' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = 4294967296; -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967296 -SET @@global.sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967296 -SET @@global.sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -4294967296 -SET @@session.sort_buffer_size = 32775; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '32775' -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = -2; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '0' -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 -1 -SET @@session.sort_buffer_size = 65530.34.; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 -SET @@session.sort_buffer_size = 4294967296; -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967296 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.sort_buffer_size = test; -ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -4294967296 -'#------------------FN_DYNVARS_151_06-----------------------#' -SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; -@@global.sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_151_07-----------------------#' -SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; -@@session.sort_buffer_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_151_08-----------------------#' -SET @@global.sort_buffer_size = TRUE; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '1' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -SET @@global.sort_buffer_size = FALSE; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '0' -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 -1 -'Bug: Errors should be displayed on assigning TRUE/FALSE to variable' -'#---------------------FN_DYNVARS_151_09----------------------#' -SET @@global.sort_buffer_size = 9000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '9000' -SELECT @@sort_buffer_size = @@global.sort_buffer_size; -@@sort_buffer_size = @@global.sort_buffer_size -0 -'#---------------------FN_DYNVARS_151_10----------------------#' -SET @@sort_buffer_size = 9000; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '9000' -SELECT @@sort_buffer_size = @@local.sort_buffer_size; -@@sort_buffer_size = @@local.sort_buffer_size -1 -SELECT @@local.sort_buffer_size = @@session.sort_buffer_size; -@@local.sort_buffer_size = @@session.sort_buffer_size -1 -'#---------------------FN_DYNVARS_151_11----------------------#' -SET sort_buffer_size = 9100; -Warnings: -Warning 1292 Truncated incorrect sort_buffer_size value: '9100' -SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804; -@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804 -1 -SELECT @@sort_buffer_size; -@@sort_buffer_size -32804 -SELECT local.sort_buffer_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.sort_buffer_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT sort_buffer_size = @@session.sort_buffer_size; -ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list' -SET @@global.sort_buffer_size = @start_global_value; -SELECT @@global.sort_buffer_size; -@@global.sort_buffer_size -262144 -SET @@session.sort_buffer_size = @start_session_value; -SELECT @@session.sort_buffer_size; -@@session.sort_buffer_size -262144 diff --git a/mysql-test/r/sync_binlog_basic_64.result b/mysql-test/r/sync_binlog_basic_64.result deleted file mode 100644 index ffd1b3fc4f1..00000000000 --- a/mysql-test/r/sync_binlog_basic_64.result +++ /dev/null @@ -1,105 +0,0 @@ -SET @start_value = @@global.sync_binlog; -SELECT @start_value; -@start_value -0 -'#--------------------FN_DYNVARS_168_01------------------------#' -SET @@global.sync_binlog = 99; -SET @@global.sync_binlog = DEFAULT; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -'#---------------------FN_DYNVARS_168_02-------------------------#' -SET @@global.sync_binlog = @start_value; -SELECT @@global.sync_binlog = 0; -@@global.sync_binlog = 0 -1 -'#--------------------FN_DYNVARS_168_03------------------------#' -SET @@global.sync_binlog = 0; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -SET @@global.sync_binlog = 1; -SELECT @@global.sync_binlog; -@@global.sync_binlog -1 -SET @@global.sync_binlog = 4294967295; -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967295 -SET @@global.sync_binlog = 4294967294; -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967294 -SET @@global.sync_binlog = 65536; -SELECT @@global.sync_binlog; -@@global.sync_binlog -65536 -'#--------------------FN_DYNVARS_168_04-------------------------#' -SET @@global.sync_binlog = -1; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -SET @@global.sync_binlog = 4294967296; -SELECT @@global.sync_binlog; -@@global.sync_binlog -4294967296 -SET @@global.sync_binlog = 10240022115; -SELECT @@global.sync_binlog; -@@global.sync_binlog -10240022115 -SET @@global.sync_binlog = 10000.01; -ERROR 42000: Incorrect argument type to variable 'sync_binlog' -SELECT @@global.sync_binlog; -@@global.sync_binlog -10240022115 -SET @@global.sync_binlog = -1024; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 -SET @@global.sync_binlog = 42949672950; -SELECT @@global.sync_binlog; -@@global.sync_binlog -42949672950 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.sync_binlog = ON; -ERROR 42000: Incorrect argument type to variable 'sync_binlog' -SELECT @@global.sync_binlog; -@@global.sync_binlog -42949672950 -SET @@global.sync_binlog = 'test'; -ERROR 42000: Incorrect argument type to variable 'sync_binlog' -SELECT @@global.sync_binlog; -@@global.sync_binlog -42949672950 -'#-------------------FN_DYNVARS_168_05----------------------------#' -SET @@session.sync_binlog = 0; -ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@sync_binlog; -@@sync_binlog -42949672950 -'#----------------------FN_DYNVARS_168_06------------------------#' -SELECT @@global.sync_binlog = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sync_binlog'; -@@global.sync_binlog = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_168_07----------------------#' -SET sync_binlog = 1; -ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL -SELECT @@sync_binlog; -@@sync_binlog -42949672950 -SET local.sync_binlog = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 -SELECT local.sync_binlog; -ERROR 42S02: Unknown table 'local' in field list -SET global.sync_binlog = 1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 -SELECT global.sync_binlog; -ERROR 42S02: Unknown table 'global' in field list -SELECT sync_binlog = @@session.sync_binlog; -ERROR 42S22: Unknown column 'sync_binlog' in 'field list' -SET @@global.sync_binlog = @start_value; -SELECT @@global.sync_binlog; -@@global.sync_binlog -0 diff --git a/mysql-test/r/timestamp_basic_64.result b/mysql-test/r/timestamp_basic_64.result deleted file mode 100644 index df877cd455b..00000000000 --- a/mysql-test/r/timestamp_basic_64.result +++ /dev/null @@ -1,73 +0,0 @@ -SET @session_start_value = @@session.timestamp; -'#--------------------FN_DYNVARS_001_01------------------------#' -SET @@timestamp = DEFAULT; -'timestamp does not have any DEFAULT value' -'#---------------------FN_DYNVARS_001_02-------------------------#' -SET @@global.timestamp = "1000"; -ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL -'#--------------------FN_DYNVARS_001_03------------------------#' -SET @@timestamp = 0; -'Setting 0 resets timestamp to session default timestamp' -SET @@timestamp = 123456789123456; -SELECT @@timestamp; -@@timestamp -123456789123456 -SET @@timestamp = 60*60*60*60*365; -SELECT @@timestamp; -@@timestamp -4730400000 -SET @@timestamp = -1000000000; -SELECT @@timestamp; -@@timestamp -18446744072709551616 -SET @temp_ts = @@timestamp - @@timestamp; -SELECT @temp_ts; -@temp_ts -0 -'#--------------------FN_DYNVARS_001_04-------------------------#' -SET @@timestamp = "100"; -ERROR 42000: Incorrect argument type to variable 'timestamp' -'Bug# 34836: Documentation says its a string variable but infact its numeric' -SET @@timestamp = " "; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = 1.1; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = 9999999999999999999999; -ERROR 42000: Incorrect argument type to variable 'timestamp' -'#----------------------FN_DYNVARS_001_06------------------------#' -SELECT @@timestamp = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='timestamp'; -@@timestamp = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_08-------------------------#' -SET @@timestamp = OFF; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = ON; -ERROR 42000: Incorrect argument type to variable 'timestamp' -SET @@timestamp = TRUE; -SELECT @@timestamp; -@@timestamp -1 -SET @@timestamp = FALSE; -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@timestamp = 123456; -SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; -@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp -1 -SET @@timestamp = 654321; -SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; -@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET timestamp = 1; -SELECT @@timestamp; -@@timestamp -1 -SELECT local.timestamp; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.timestamp; -ERROR 42S02: Unknown table 'session' in field list -SELECT timestamp = @@session.timestamp; -ERROR 42S22: Unknown column 'timestamp' in 'field list' -SET @@timestamp = @session_start_value; diff --git a/mysql-test/r/tmp_table_size_basic_64.result b/mysql-test/r/tmp_table_size_basic_64.result deleted file mode 100644 index 837b90fc143..00000000000 --- a/mysql-test/r/tmp_table_size_basic_64.result +++ /dev/null @@ -1,172 +0,0 @@ -SET @start_global_value = @@global.tmp_table_size; -SELECT @start_global_value; -@start_global_value -16777216 -SET @start_session_value = @@session.tmp_table_size; -SELECT @start_session_value; -@start_session_value -16777216 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.tmp_table_size = 100; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '100' -SET @@global.tmp_table_size = DEFAULT; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -16777216 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -SET @@session.tmp_table_size = 200; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '200' -SET @@session.tmp_table_size = DEFAULT; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -16777216 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.tmp_table_size = DEFAULT; -SELECT @@global.tmp_table_size = 33554432; -@@global.tmp_table_size = 33554432 -0 -SET @@session.tmp_table_size = DEFAULT; -SELECT @@session.tmp_table_size = 33554432; -@@session.tmp_table_size = 33554432 -0 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.tmp_table_size = 1024; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = 60020; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -60020 -SET @@global.tmp_table_size = 4294967295; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -4294967295 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.tmp_table_size = 1024; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -1024 -SET @@session.tmp_table_size =4294967295; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -4294967295 -SET @@session.tmp_table_size = 65535; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -65535 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.tmp_table_size = 0; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = -1024; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = 1000; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '1000' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.tmp_table_size = ON; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@global.tmp_table_size = OFF; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@global.tmp_table_size = True; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '1' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -SET @@global.tmp_table_size = False; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -1024 -'Bug:Error should be shown that variable is numeric and can not assigned boolean value'; -SET @@global.tmp_table_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@global.tmp_table_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = ON; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = OFF; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = True; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '1' -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -1024 -SET @@session.tmp_table_size = False; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '0' -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -1024 -SET @@session.tmp_table_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'tmp_table_size' -SET @@session.tmp_table_size = 12345678901; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -12345678901 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.tmp_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='tmp_table_size'; -@@global.tmp_table_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.tmp_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='tmp_table_size'; -@@session.tmp_table_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.tmp_table_size = 1024; -SET @@tmp_table_size = 4294967295; -SELECT @@tmp_table_size = @@global.tmp_table_size; -@@tmp_table_size = @@global.tmp_table_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@tmp_table_size = 100; -Warnings: -Warning 1292 Truncated incorrect tmp_table_size value: '100' -SELECT @@tmp_table_size = @@local.tmp_table_size; -@@tmp_table_size = @@local.tmp_table_size -1 -SELECT @@local.tmp_table_size = @@session.tmp_table_size; -@@local.tmp_table_size = @@session.tmp_table_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET tmp_table_size = 1027; -SELECT @@tmp_table_size; -@@tmp_table_size -1027 -SELECT local.tmp_table_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT global.tmp_table_size; -ERROR 42S02: Unknown table 'global' in field list -SELECT tmp_table_size = @@session.tmp_table_size; -ERROR 42S22: Unknown column 'tmp_table_size' in 'field list' -SET @@global.tmp_table_size = @start_global_value; -SELECT @@global.tmp_table_size; -@@global.tmp_table_size -16777216 -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.tmp_table_size; -@@session.tmp_table_size -16777216 diff --git a/mysql-test/r/transaction_alloc_block_size_basic_64.result b/mysql-test/r/transaction_alloc_block_size_basic_64.result deleted file mode 100644 index c968d6f108c..00000000000 --- a/mysql-test/r/transaction_alloc_block_size_basic_64.result +++ /dev/null @@ -1,176 +0,0 @@ -SET @start_global_value = @@global.transaction_alloc_block_size; -SELECT @start_global_value; -@start_global_value -8192 -SET @start_session_value = @@session.transaction_alloc_block_size; -SELECT @start_session_value; -@start_session_value -8192 -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.transaction_alloc_block_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '200' -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -8192 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size = 8192; -@@global.transaction_alloc_block_size = 8192 -1 -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size = 8192; -@@session.transaction_alloc_block_size = 8192 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_alloc_block_size = 1024; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 60020; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -59392 -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_alloc_block_size = 1024; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size =4294967295; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 -SET @@session.transaction_alloc_block_size = 65535; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -64512 -'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_alloc_block_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 123456789201; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -123456788480 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@global.transaction_alloc_block_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@global.transaction_alloc_block_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = 12345678901; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -12345678848 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@session.transaction_alloc_block_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 -SET @@session.transaction_alloc_block_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -SET @@session.transaction_alloc_block_size = 'test'; -ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@global.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; -@@session.transaction_alloc_block_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_08----------------------#' -SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@global.transaction_alloc_block_size -0 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@transaction_alloc_block_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' -SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; -@@transaction_alloc_block_size = @@local.transaction_alloc_block_size -1 -SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; -@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size -1 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET transaction_alloc_block_size = 1027; -SELECT @@transaction_alloc_block_size; -@@transaction_alloc_block_size -1024 -SELECT local.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_alloc_block_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; -ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list' -SET @@global.transaction_alloc_block_size = @start_global_value; -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -8192 -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -1024 diff --git a/mysql-test/r/transaction_prealloc_size_basic_64.result b/mysql-test/r/transaction_prealloc_size_basic_64.result deleted file mode 100644 index 2fb6451372f..00000000000 --- a/mysql-test/r/transaction_prealloc_size_basic_64.result +++ /dev/null @@ -1,170 +0,0 @@ -SET @start_global_value = @@global.transaction_prealloc_size; -SELECT @start_global_value; -@start_global_value -4096 -SET @start_session_value = @@session.transaction_prealloc_size; -SELECT @start_session_value; -@start_session_value -4096 -'Bug# 34876: This variable has invalid default value as compared to documentation'; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = 200; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '200' -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size = 4096; -@@global.transaction_prealloc_size = 4096 -1 -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size = 4096; -@@session.transaction_prealloc_size = 4096 -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.transaction_prealloc_size = 1024; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 60020; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -59392 -SET @@global.transaction_prealloc_size = 4294966272; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4294966272 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.transaction_prealloc_size = 1024; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size =4294966272; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4294966272 -SET @@session.transaction_prealloc_size = 65535; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -64512 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.transaction_prealloc_size = 0; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = -1024; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@global.transaction_prealloc_size = 65530.34; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size ="Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@global.transaction_prealloc_size = 1000; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1000' -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = ON; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = OFF; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = True; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = False; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -1024 -SET @@session.transaction_prealloc_size = "Test"; -ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' -SET @@session.transaction_prealloc_size = 123456789031; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -123456788480 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@global.transaction_prealloc_size = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; -@@session.transaction_prealloc_size = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.transaction_prealloc_size = 1024; -SET @@global.transaction_prealloc_size = 10; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' -SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; -@@transaction_prealloc_size = @@global.transaction_prealloc_size -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@transaction_prealloc_size = 100; -Warnings: -Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' -SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; -@@transaction_prealloc_size = @@local.transaction_prealloc_size -1 -SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; -@@local.transaction_prealloc_size = @@session.transaction_prealloc_size -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET transaction_prealloc_size = 1027; -SELECT @@transaction_prealloc_size; -@@transaction_prealloc_size -1024 -SELECT local.transaction_prealloc_size; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.transaction_prealloc_size; -ERROR 42S02: Unknown table 'session' in field list -SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; -ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list' -SET @@global.transaction_prealloc_size = @start_global_value; -SELECT @@global.transaction_prealloc_size; -@@global.transaction_prealloc_size -4096 -SET @@session.transaction_prealloc_size = @start_session_value; -SELECT @@session.transaction_prealloc_size; -@@session.transaction_prealloc_size -4096 diff --git a/mysql-test/r/wait_timeout_basic_64.result b/mysql-test/r/wait_timeout_basic_64.result deleted file mode 100644 index ae03e677e56..00000000000 --- a/mysql-test/r/wait_timeout_basic_64.result +++ /dev/null @@ -1,129 +0,0 @@ -SET @start_global_value = @@global.wait_timeout; -SET @start_session_value = @@session.wait_timeout; -'#--------------------FN_DYNVARS_005_01-------------------------#' -SET @@global.wait_timeout = 100; -SET @@global.wait_timeout = DEFAULT; -SELECT @@global.wait_timeout; -@@global.wait_timeout -28800 -SET @@session.wait_timeout = 200; -SET @@session.wait_timeout = DEFAULT; -SELECT @@session.wait_timeout; -@@session.wait_timeout -28800 -'#--------------------FN_DYNVARS_005_02-------------------------#' -SET @@global.wait_timeout = DEFAULT; -SELECT @@global.wait_timeout = @default_wait_timeout; -@@global.wait_timeout = @default_wait_timeout -1 -SET @@session.wait_timeout = DEFAULT; -SELECT @@session.wait_timeout = @default_wait_timeout; -@@session.wait_timeout = @default_wait_timeout -1 -'#--------------------FN_DYNVARS_005_03-------------------------#' -SET @@global.wait_timeout= 1; -SELECT @@global.wait_timeout; -@@global.wait_timeout -1 -SET @@global.wait_timeout = 60020; -SELECT @@global.wait_timeout; -@@global.wait_timeout -60020 -SET @@global.wait_timeout = 31536000; -SELECT @@global.wait_timeout = @max_wait_timeout; -@@global.wait_timeout = @max_wait_timeout -1 -'#--------------------FN_DYNVARS_005_04-------------------------#' -SET @@session.wait_timeout =6000; -SELECT @@session.wait_timeout; -@@session.wait_timeout -6000 -'#------------------FN_DYNVARS_005_05-----------------------#' -SET @@global.wait_timeout = 0; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -SET @@global.wait_timeout = -1024; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -'Bug # 34837: Errors are not coming on assigning invalid values to variable'; -SET @@global.wait_timeout = ON; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@global.wait_timeout = OFF; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@global.wait_timeout = True; -SELECT @@global.wait_timeout; -@@global.wait_timeout -1 -SET @@global.wait_timeout = False; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -SELECT @@global.wait_timeout; -@@global.wait_timeout -1 -SET @@global.wait_timeout = 65530.34; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@global.wait_timeout ="Test"; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = ON; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = OFF; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = True; -SELECT @@session.wait_timeout; -@@session.wait_timeout -1 -SET @@session.wait_timeout = False; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '0' -SELECT @@session.wait_timeout; -@@session.wait_timeout -1 -SET @@session.wait_timeout = "Test"; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = 'test'; -ERROR 42000: Incorrect argument type to variable 'wait_timeout' -SET @@session.wait_timeout = 123456789031; -Warnings: -Warning 1292 Truncated incorrect wait_timeout value: '123456789031' -SELECT @@session.wait_timeout = @max_wait_timeout; -@@session.wait_timeout = @max_wait_timeout -1 -'#------------------FN_DYNVARS_005_06-----------------------#' -SELECT @@global.wait_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='wait_timeout'; -@@global.wait_timeout = VARIABLE_VALUE -1 -'#------------------FN_DYNVARS_005_07-----------------------#' -SELECT @@session.wait_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='wait_timeout'; -@@session.wait_timeout = VARIABLE_VALUE -1 -'#---------------------FN_DYNVARS_001_09----------------------#' -SET @@global.wait_timeout = 30000; -SET @@global.wait_timeout = 40000; -SELECT @@wait_timeout = @@global.wait_timeout; -@@wait_timeout = @@global.wait_timeout -0 -'#---------------------FN_DYNVARS_001_10----------------------#' -SET @@wait_timeout = 100; -SELECT @@wait_timeout = @@local.wait_timeout; -@@wait_timeout = @@local.wait_timeout -1 -SELECT @@local.wait_timeout = @@session.wait_timeout; -@@local.wait_timeout = @@session.wait_timeout -1 -'#---------------------FN_DYNVARS_001_11----------------------#' -SET wait_timeout = 1027; -SELECT @@wait_timeout; -@@wait_timeout -1027 -SELECT local.wait_timeout; -ERROR 42S02: Unknown table 'local' in field list -SELECT session.wait_timeout; -ERROR 42S02: Unknown table 'session' in field list -SELECT wait_timeout = @@session.wait_timeout; -ERROR 42S22: Unknown column 'wait_timeout' in 'field list' -SET @@global.wait_timeout = @start_global_value; -SET @@session.wait_timeout = @start_session_value; From 497c97905e73aa69fac0f1dfaeb4eb89a241e5b0 Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Tue, 22 Jul 2008 18:56:50 +0200 Subject: [PATCH 122/352] --- .../include/binlog_cache_size_basic.inc | 154 ----------- .../include/bulk_insert_buffer_size_basic.inc | 203 -------------- .../include/delayed_insert_limit_basic.inc | 167 ------------ .../include/delayed_queue_size_basic.inc | 163 ------------ .../innodb_concurrency_tickets_basic.inc | 147 ----------- .../include/innodb_max_purge_lag_basic.inc | 147 ----------- .../include/innodb_sync_spin_loops_basic.inc | 142 ---------- mysql-test/include/join_buffer_size_basic.inc | 216 --------------- mysql-test/include/key_buffer_size_basic.inc | 187 ------------- .../include/key_cache_age_threshold_basic.inc | 180 ------------- .../include/key_cache_block_size_basic.inc | 185 ------------- .../key_cache_division_limit_basic.inc | 184 ------------- mysql-test/include/log_warnings_basic.inc | 210 --------------- .../include/max_binlog_cache_size_basic.inc | 187 ------------- .../include/max_connect_errors_basic.inc | 182 ------------- .../include/max_heap_table_size_basic.inc | 222 ---------------- .../include/max_seeks_for_key_basic.inc | 213 --------------- mysql-test/include/max_tmp_tables_basic.inc | 227 ---------------- .../include/max_write_lock_count_basic.inc | 158 ----------- .../include/min_examined_row_limit_basic.inc | 219 ---------------- .../include/multi_range_count_basic.inc | 219 ---------------- .../myisam_max_sort_file_size_basic.inc | 184 ------------- .../include/myisam_repair_threads_basic.inc | 242 ----------------- .../include/myisam_sort_buffer_size_basic.inc | 240 ----------------- mysql-test/include/net_retry_count_basic.inc | 217 --------------- .../include/query_alloc_block_size_basic.inc | 225 ---------------- .../include/query_cache_limit_basic.inc | 178 ------------- .../query_cache_min_res_unit_basic.inc | 187 ------------- mysql-test/include/query_cache_size_basic.inc | 175 ------------- .../include/query_prealloc_size_basic.inc | 247 ------------------ .../include/range_alloc_block_size_basic.inc | 208 --------------- .../include/rpl_recovery_rank_basic.inc | 171 ------------ mysql-test/include/server_id_basic.inc | 190 -------------- .../slave_transaction_retries_basic.inc | 188 ------------- mysql-test/include/sort_buffer_size_basic.inc | 213 --------------- mysql-test/include/sync_binlog_basic.inc | 156 ----------- mysql-test/include/timestamp_basic.inc | 162 ------------ mysql-test/include/tmp_table_size_basic.inc | 233 ----------------- .../transaction_alloc_block_size_basic.inc | 240 ----------------- .../transaction_prealloc_size_basic.inc | 229 ---------------- 40 files changed, 7797 deletions(-) delete mode 100644 mysql-test/include/binlog_cache_size_basic.inc delete mode 100644 mysql-test/include/bulk_insert_buffer_size_basic.inc delete mode 100644 mysql-test/include/delayed_insert_limit_basic.inc delete mode 100644 mysql-test/include/delayed_queue_size_basic.inc delete mode 100644 mysql-test/include/innodb_concurrency_tickets_basic.inc delete mode 100644 mysql-test/include/innodb_max_purge_lag_basic.inc delete mode 100644 mysql-test/include/innodb_sync_spin_loops_basic.inc delete mode 100644 mysql-test/include/join_buffer_size_basic.inc delete mode 100644 mysql-test/include/key_buffer_size_basic.inc delete mode 100644 mysql-test/include/key_cache_age_threshold_basic.inc delete mode 100644 mysql-test/include/key_cache_block_size_basic.inc delete mode 100644 mysql-test/include/key_cache_division_limit_basic.inc delete mode 100644 mysql-test/include/log_warnings_basic.inc delete mode 100644 mysql-test/include/max_binlog_cache_size_basic.inc delete mode 100644 mysql-test/include/max_connect_errors_basic.inc delete mode 100644 mysql-test/include/max_heap_table_size_basic.inc delete mode 100644 mysql-test/include/max_seeks_for_key_basic.inc delete mode 100644 mysql-test/include/max_tmp_tables_basic.inc delete mode 100644 mysql-test/include/max_write_lock_count_basic.inc delete mode 100644 mysql-test/include/min_examined_row_limit_basic.inc delete mode 100644 mysql-test/include/multi_range_count_basic.inc delete mode 100644 mysql-test/include/myisam_max_sort_file_size_basic.inc delete mode 100644 mysql-test/include/myisam_repair_threads_basic.inc delete mode 100644 mysql-test/include/myisam_sort_buffer_size_basic.inc delete mode 100644 mysql-test/include/net_retry_count_basic.inc delete mode 100644 mysql-test/include/query_alloc_block_size_basic.inc delete mode 100644 mysql-test/include/query_cache_limit_basic.inc delete mode 100644 mysql-test/include/query_cache_min_res_unit_basic.inc delete mode 100644 mysql-test/include/query_cache_size_basic.inc delete mode 100644 mysql-test/include/query_prealloc_size_basic.inc delete mode 100644 mysql-test/include/range_alloc_block_size_basic.inc delete mode 100644 mysql-test/include/rpl_recovery_rank_basic.inc delete mode 100644 mysql-test/include/server_id_basic.inc delete mode 100644 mysql-test/include/slave_transaction_retries_basic.inc delete mode 100644 mysql-test/include/sort_buffer_size_basic.inc delete mode 100644 mysql-test/include/sync_binlog_basic.inc delete mode 100644 mysql-test/include/timestamp_basic.inc delete mode 100644 mysql-test/include/tmp_table_size_basic.inc delete mode 100644 mysql-test/include/transaction_alloc_block_size_basic.inc delete mode 100644 mysql-test/include/transaction_prealloc_size_basic.inc diff --git a/mysql-test/include/binlog_cache_size_basic.inc b/mysql-test/include/binlog_cache_size_basic.inc deleted file mode 100644 index 323e19c4d66..00000000000 --- a/mysql-test/include/binlog_cache_size_basic.inc +++ /dev/null @@ -1,154 +0,0 @@ -################# mysql-test\t\binlog_cache_size_basic.test #################### -# # -# Variable Name: binlog_cache_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 32768 # -# Range: 4096 - 4294967295 # -# # -# # -# Creation Date: 2008-04-28 # -# Author: Salman Rawala/Horst Hunger # -# # -# Description: Test Cases of Dynamic System Variable "binlog_cache_size" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_binlog_cache_size # -# # -################################################################################ - -################################################################# -# START OF binlog_cache_size TESTS # -################################################################# - -######################################################################### -# Saving initial value of binlog_cache_size in a temporary variable # -######################################################################### - -SET @start_value = @@global.binlog_cache_size; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_006_01------------------------#' -######################################################################### -# Display the DEFAULT value of binlog_cache_size # -######################################################################### - -SET @@global.binlog_cache_size = 100; -SET @@global.binlog_cache_size = DEFAULT; -SELECT @@global.binlog_cache_size; - - ---echo '#---------------------FN_DYNVARS_006_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.binlog_cache_size = @start_value; -SELECT @@global.binlog_cache_size = 32768; - - ---echo '#--------------------FN_DYNVARS_006_03------------------------#' -######################################################################### -# Change the value of binlog_cache_size to a valid value # -######################################################################### - -SET @@global.binlog_cache_size = 4096; -SELECT @@global.binlog_cache_size; -SET @@global.binlog_cache_size = 4294967295; -SELECT @@global.binlog_cache_size; -SET @@global.binlog_cache_size = 10000; -SELECT @@global.binlog_cache_size; -SET @@global.binlog_cache_size = 21221204; -SELECT @@global.binlog_cache_size; -echo 'Bug: Invalid values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_006_04-------------------------#' -############################################################################ -# Change the value of binlog_cache_size to invalid value # -############################################################################ - -SET @@global.binlog_cache_size = 1024; -SELECT @@global.binlog_cache_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.binlog_cache_size = 10000.01; -SET @@global.binlog_cache_size = -1024; -SELECT @@global.binlog_cache_size; -SET @@global.binlog_cache_size = 42949672950; -SELECT @@global.binlog_cache_size; -echo 'Bug: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.binlog_cache_size = ON; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.binlog_cache_size = 'test'; - - ---echo '#-------------------FN_DYNVARS_006_05----------------------------#' -############################################################################ -# Test if accessing session binlog_cache_size gives error # -############################################################################ - ---Error ER_GLOBAL_VARIABLE -SET @@session.binlog_cache_size = 0; - - ---echo '#----------------------FN_DYNVARS_006_06------------------------#' -############################################################################## -# Check if the value in GLOBAL Tables matches values in variable # -############################################################################## - -SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size'; - ---echo '#---------------------FN_DYNVARS_006_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.binlog_cache_size = TRUE; -SELECT @@global.binlog_cache_size; -SET @@global.binlog_cache_size = FALSE; -SELECT @@global.binlog_cache_size; -echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; - ---echo '#---------------------FN_DYNVARS_006_08----------------------#' -############################################################################### -# Check if accessing variable without SCOPE points to same global variable # -############################################################################### - -SET @@global.binlog_cache_size = 1; -SELECT @@binlog_cache_size = @@global.binlog_cache_size; - ---echo '#---------------------FN_DYNVARS_006_09----------------------#' -########################################################################### -# Check if binlog_cache_size can be accessed with and without @@ sign # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET binlog_cache_size = 1; ---Error ER_PARSE_ERROR -SET global.binlog_cache_size = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.binlog_cache_size; ---Error ER_BAD_FIELD_ERROR -SELECT binlog_cache_size = @@session.binlog_cache_size; - - -############################## -# Restore initial value # -############################## - -SET @@global.binlog_cache_size = @start_value; -SELECT @@global.binlog_cache_size; - - -########################################################### -# END OF binlog_cache_size TESTS # -########################################################### diff --git a/mysql-test/include/bulk_insert_buffer_size_basic.inc b/mysql-test/include/bulk_insert_buffer_size_basic.inc deleted file mode 100644 index 56ffbace173..00000000000 --- a/mysql-test/include/bulk_insert_buffer_size_basic.inc +++ /dev/null @@ -1,203 +0,0 @@ -############## mysql-test\t\bulk_insert_buffer_size_basic.test ################# -# # -# Variable Name: bulk_insert_buffer_size # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 8388608 # -# Range: 0 - 4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "bulk_insert_buffer_size" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_bulk_insert_buffer_size # -# # -################################################################################ - ---source include/load_sysvars.inc - -####################################################################### -# START OF bulk_insert_buffer_size TESTS # -####################################################################### - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.bulk_insert_buffer_size; -SELECT @start_global_value; -SET @start_session_value = @@session.bulk_insert_buffer_size; -SELECT @start_session_value; - ---echo '#--------------------FN_DYNVARS_007_01-------------------------#' -####################################################################### -# Display the DEFAULT value of bulk_insert_buffer_size # -####################################################################### - -SET @@global.bulk_insert_buffer_size = 100; -SET @@global.bulk_insert_buffer_size = DEFAULT; -SELECT @@global.bulk_insert_buffer_size; - -SET @@session.bulk_insert_buffer_size = 200; -SET @@session.bulk_insert_buffer_size = DEFAULT; -SELECT @@session.bulk_insert_buffer_size; - - ---echo '#--------------------FN_DYNVARS_007_02-------------------------#' -####################################################################### -# Check the DEFAULT value of bulk_insert_buffer_size # -####################################################################### - -SET @@global.bulk_insert_buffer_size = @start_global_value; -SELECT @@global.bulk_insert_buffer_size = 8388608; - -SET @@session.bulk_insert_buffer_size = @start_session_value; -SELECT @@session.bulk_insert_buffer_size = 8388608; - - ---echo '#--------------------FN_DYNVARS_007_03-------------------------#' -############################################################################### -#Change the value of bulk_insert_buffer_size to valid values for GLOBAL Scope # -############################################################################### - -SET @@global.bulk_insert_buffer_size = 0; -SELECT @@global.bulk_insert_buffer_size; -SET @@global.bulk_insert_buffer_size = 1; -SELECT @@global.bulk_insert_buffer_size; -SET @@global.bulk_insert_buffer_size = 4294967295; -SELECT @@global.bulk_insert_buffer_size; -SET @@global.bulk_insert_buffer_size = 429496; -SELECT @@global.bulk_insert_buffer_size; - - ---echo '#--------------------FN_DYNVARS_007_04-------------------------#' -############################################################################### -#Change the value of bulk_insert_buffer_size to valid values for SESSION Scope# -############################################################################### - -SET @@session.bulk_insert_buffer_size = 0; -SELECT @@session.bulk_insert_buffer_size; -SET @@session.bulk_insert_buffer_size = 1; -SELECT @@session.bulk_insert_buffer_size; -SET @@session.bulk_insert_buffer_size = 4294967295; -SELECT @@session.bulk_insert_buffer_size; -SET @@session.bulk_insert_buffer_size = 429496; -SELECT @@session.bulk_insert_buffer_size; - - ---echo '#------------------FN_DYNVARS_007_05-----------------------#' -################################################################### -# Change the value of bulk_insert_buffer_size to an invalid value # -################################################################### - -SET @@global.bulk_insert_buffer_size = 42949672950; -SELECT @@global.bulk_insert_buffer_size; -SET @@global.bulk_insert_buffer_size = -1024; -SELECT @@global.bulk_insert_buffer_size; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.bulk_insert_buffer_size = test; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.bulk_insert_buffer_size = ON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.bulk_insert_buffer_size = 429496.10; - -SET @@session.bulk_insert_buffer_size = 42949672950; -SELECT @@session.bulk_insert_buffer_size; -SET @@session.bulk_insert_buffer_size = -2; -SELECT @@session.bulk_insert_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.bulk_insert_buffer_size = test; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.bulk_insert_buffer_size = 429496.10; - - ---echo '#------------------FN_DYNVARS_007_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='bulk_insert_buffer_size'; - ---echo '#------------------FN_DYNVARS_007_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='bulk_insert_buffer_size'; - - ---echo '#------------------FN_DYNVARS_007_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.bulk_insert_buffer_size = TRUE; -SELECT @@global.bulk_insert_buffer_size; -SET @@global.bulk_insert_buffer_size = FALSE; -SELECT @@global.bulk_insert_buffer_size; - -SET @@session.bulk_insert_buffer_size = TRUE; -SELECT @@session.bulk_insert_buffer_size; -SET @@session.bulk_insert_buffer_size = FALSE; -SELECT @@session.bulk_insert_buffer_size; - - ---echo '#---------------------FN_DYNVARS_007_09----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points # -# to same session variable # -############################################################################## - -SET @@bulk_insert_buffer_size = 100; -SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size; -SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; - - ---echo '#---------------------FN_DYNVARS_007_10----------------------#' -############################################################################### -# Check if bulk_insert_buffer_size can be accessed with and without @@ sign # -############################################################################### - -SET bulk_insert_buffer_size = 1; -SELECT @@bulk_insert_buffer_size; ---Error ER_PARSE_ERROR -SET local.bulk_insert_buffer_size = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.bulk_insert_buffer_size; ---Error ER_PARSE_ERROR -SET session.bulk_insert_buffer_size = 1; ---Error ER_UNKNOWN_TABLE -SELECT session.bulk_insert_buffer_size; ---Error ER_BAD_FIELD_ERROR -SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.bulk_insert_buffer_size = @start_global_value; -SELECT @@global.bulk_insert_buffer_size; -SET @@session.bulk_insert_buffer_size = @start_session_value; -SELECT @@session.bulk_insert_buffer_size; - - -#################################################### -# END OF bulk_insert_buffer_size TESTS # -#################################################### diff --git a/mysql-test/include/delayed_insert_limit_basic.inc b/mysql-test/include/delayed_insert_limit_basic.inc deleted file mode 100644 index ab158bc593e..00000000000 --- a/mysql-test/include/delayed_insert_limit_basic.inc +++ /dev/null @@ -1,167 +0,0 @@ -############### mysql-test\t\delayed_insert_limit_basic.test ################### -# # -# Variable Name: delayed_insert_limit # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 100 # -# Range: 1 - 4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "delayed_insert_limit" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_delayed_insert_limit # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################# -# START OF delayed_insert_limit TESTS # -################################################################# - -######################################################################### -# Saving initial value of delayed_insert_limit in a temporary variable # -######################################################################### - -SET @start_value = @@global.delayed_insert_limit; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_024_01------------------------#' -######################################################################### -# Display the DEFAULT value of delayed_insert_limit # -######################################################################### - -SET @@global.delayed_insert_limit = 100; -SET @@global.delayed_insert_limit = DEFAULT; -SELECT @@global.delayed_insert_limit; - - ---echo '#---------------------FN_DYNVARS_024_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.delayed_insert_limit = @start_value; -SELECT @@global.delayed_insert_limit = 100; - - ---echo '#--------------------FN_DYNVARS_024_03------------------------#' -######################################################################### -# Change the value of delayed_insert_limit to a valid value # -######################################################################### - -SET @@global.delayed_insert_limit = 10000; -SELECT @@global.delayed_insert_limit; -SET @@global.delayed_insert_limit = 4294967295; -SELECT @@global.delayed_insert_limit; -SET @@global.delayed_insert_limit = 1; -SELECT @@global.delayed_insert_limit; - - ---echo '#--------------------FN_DYNVARS_024_04-------------------------#' -############################################################################ -# Change the value of delayed_insert_limit to invalid value # -############################################################################ - -SET @@global.delayed_insert_limit = 0; -SELECT @@global.delayed_insert_limit; -SET @@global.delayed_insert_limit = -1024; -SELECT @@global.delayed_insert_limit; -SET @@global.delayed_insert_limit = 42949672950; -SELECT @@global.delayed_insert_limit; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.delayed_insert_limit = 429496729.5; -SELECT @@global.delayed_insert_limit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.delayed_insert_limit = ON; -SELECT @@global.delayed_insert_limit; - - - ---echo '#-------------------FN_DYNVARS_024_05----------------------------#' -############################################################################ -# Test if accessing session delayed_insert_limit gives error # -############################################################################ - ---Error ER_GLOBAL_VARIABLE -SET @@session.delayed_insert_limit = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@Session.delayed_insert_limit; - - ---echo '#----------------------FN_DYNVARS_024_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.delayed_insert_limit = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='delayed_insert_limit'; - -SELECT @@delayed_insert_limit = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES - WHERE VARIABLE_NAME='delayed_insert_limit'; - - ---echo '#---------------------FN_DYNVARS_024_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.delayed_insert_limit = TRUE; -SELECT @@global.delayed_insert_limit; -SET @@global.delayed_insert_limit = FALSE; -SELECT @@global.delayed_insert_limit; - ---echo '#---------------------FN_DYNVARS_024_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.delayed_insert_limit = 1; -SELECT @@delayed_insert_limit = @@global.delayed_insert_limit; - - ---echo '#---------------------FN_DYNVARS_024_09----------------------#' -############################################################################## -# Check if delayed_insert_limit can be accessed with and without @@ sign # -############################################################################## - ---Error ER_GLOBAL_VARIABLE -SET delayed_insert_limit = 1; -SELECT @@delayed_insert_limit; ---Error ER_PARSE_ERROR -SET local.delayed_insert_limit = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.delayed_insert_limit; ---Error ER_PARSE_ERROR -SET global.delayed_insert_limit = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.delayed_insert_limit; ---Error ER_BAD_FIELD_ERROR -SELECT delayed_insert_limit = @@session.delayed_insert_limit; - -############################## -# Restore initial value # -############################## - -SET @@global.delayed_insert_limit = @start_value; -SELECT @@global.delayed_insert_limit; - - -########################################################### -# END OF delayed_insert_limit TESTS # -########################################################### - diff --git a/mysql-test/include/delayed_queue_size_basic.inc b/mysql-test/include/delayed_queue_size_basic.inc deleted file mode 100644 index 2d16f75d4e1..00000000000 --- a/mysql-test/include/delayed_queue_size_basic.inc +++ /dev/null @@ -1,163 +0,0 @@ -################# mysql-test\t\delayed_queue_size_basic.test ################### -# # -# Variable Name: delayed_queue_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1000 # -# Range: 1 - 4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable "delayed_queue_size" # -# that checks behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity . # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_delayed_queue_size # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################# -# START OF delayed_queue_size TESTS # -################################################################# - -######################################################################### -# Saving initial value of delayed_queue_size in a temporary variable # -######################################################################### - -SET @start_value = @@global.delayed_queue_size; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_026_01------------------------#' -######################################################################### -# Display the DEFAULT value of delayed_queue_size # -######################################################################### - -SET @@global.delayed_queue_size = 100; -SET @@global.delayed_queue_size = DEFAULT; -SELECT @@global.delayed_queue_size; - ---echo '#---------------------FN_DYNVARS_026_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.delayed_queue_size = @start_value; -SELECT @@global.delayed_queue_size = 1000; - ---echo '#--------------------FN_DYNVARS_026_03------------------------#' -######################################################################### -# Change the value of delayed_queue_size to a valid value # -######################################################################### - -SET @@global.delayed_queue_size = 10000; -SELECT @@global.delayed_queue_size; -SET @@global.delayed_queue_size = 4294967295; -SELECT @@global.delayed_queue_size; -SET @@global.delayed_queue_size = 1; -SELECT @@global.delayed_queue_size; - - ---echo '#--------------------FN_DYNVARS_026_04-------------------------#' -############################################################################ -# Change the value of delayed_queue_size to invalid value # -############################################################################ - -SET @@global.delayed_queue_size = 0; -SELECT @@global.delayed_queue_size; -SET @@global.delayed_queue_size = -1024; -SELECT @@global.delayed_queue_size; -SET @@global.delayed_queue_size = 42949672950; -SELECT @@global.delayed_queue_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.delayed_queue_size = 429496729.5; -SELECT @@global.delayed_queue_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.delayed_queue_size = ON; -SELECT @@delayed_queue_size; - ---echo '#-------------------FN_DYNVARS_026_05----------------------------#' -############################################################################ -# Test if accessing session delayed_queue_size gives error # -############################################################################ - ---Error 1229 -SET @@session.delayed_queue_size = 0; ---Error 1238 -SELECT @@session.delayed_queue_size; - ---echo '#----------------------FN_DYNVARS_026_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.delayed_queue_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='delayed_queue_size'; - -SELECT @@delayed_queue_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='delayed_queue_size'; - - ---echo '#---------------------FN_DYNVARS_026_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.delayed_queue_size = TRUE; -SELECT @@global.delayed_queue_size; -SET @@global.delayed_queue_size = FALSE; -SELECT @@global.delayed_queue_size; - ---echo '#---------------------FN_DYNVARS_026_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.delayed_queue_size = 1; -SELECT @@delayed_queue_size = @@global.delayed_queue_size; - - ---echo '#---------------------FN_DYNVARS_026_09----------------------#' -########################################################################### -# Check if delayed_queue_size can be accessed with and without @@ sign # -########################################################################### - ---Error 1229 -SET delayed_queue_size = 1; -SELECT @@delayed_queue_size; ---Error ER_PARSE_ERROR -SET local.delayed_queue_size = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.delayed_queue_size; ---Error ER_PARSE_ERROR -SET global.delayed_queue_size = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.delayed_queue_size; ---Error ER_BAD_FIELD_ERROR -SELECT delayed_queue_size = @@session.delayed_queue_size; - - -############################## -# Restore initial value # -############################## - -SET @@global.delayed_queue_size = @start_value; -SELECT @@global.delayed_queue_size; - - -########################################################### -# END OF delayed_queue_size TESTS # -########################################################### - diff --git a/mysql-test/include/innodb_concurrency_tickets_basic.inc b/mysql-test/include/innodb_concurrency_tickets_basic.inc deleted file mode 100644 index 67b0247d169..00000000000 --- a/mysql-test/include/innodb_concurrency_tickets_basic.inc +++ /dev/null @@ -1,147 +0,0 @@ -################# mysql-test\t\innodb_concurrency_tickets_basic.test ########## -# # -# Variable Name: innodb_concurrency_tickets # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 500 # -# Range: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description:Test Cases of Dynamic System Variable innodb_concurrency_tickets # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_concurrency_tickets TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of innodb_concurrency_tickets in a temporary variable # -################################################################################ - -SET @global_start_value = @@global.innodb_concurrency_tickets; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_concurrency_tickets # -######################################################################## - -SET @@global.innodb_concurrency_tickets = 0; -SET @@global.innodb_concurrency_tickets = DEFAULT; -SELECT @@global.innodb_concurrency_tickets; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -################################################################################ -# Check if innodb_concurrency_tickets can be accessed with and without @@ sign # -################################################################################ - ---Error ER_GLOBAL_VARIABLE -SET innodb_concurrency_tickets = 1; -SELECT @@innodb_concurrency_tickets; - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_concurrency_tickets; - - -SET global innodb_concurrency_tickets = 0; -SELECT @@global.innodb_concurrency_tickets; - - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_concurrency_tickets to a valid value # -########################################################################## - - -SET @@global.innodb_concurrency_tickets = 1; -SELECT @@global.innodb_concurrency_tickets; - -SET @@global.innodb_concurrency_tickets = 1000; -SELECT @@global.innodb_concurrency_tickets; - -SET @@global.innodb_concurrency_tickets = 4294967295; -SELECT @@global.innodb_concurrency_tickets; - - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_concurrency_tickets to invalid value # -########################################################################### - -SET @@global.innodb_concurrency_tickets = -1; -SELECT @@global.innodb_concurrency_tickets; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_concurrency_tickets = "T"; -SELECT @@global.innodb_concurrency_tickets; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_concurrency_tickets = "Y"; -SELECT @@global.innodb_concurrency_tickets; - -SET @@global.innodb_concurrency_tickets = 1001; -SELECT @@global.innodb_concurrency_tickets; - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_concurrency_tickets = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_concurrency_tickets'; -SELECT @@global.innodb_concurrency_tickets; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_concurrency_tickets'; - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_concurrency_tickets = OFF; -SELECT @@global.innodb_concurrency_tickets; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_concurrency_tickets = ON; -SELECT @@global.innodb_concurrency_tickets; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.innodb_concurrency_tickets = TRUE; -SELECT @@global.innodb_concurrency_tickets; -SET @@global.innodb_concurrency_tickets = FALSE; -SELECT @@global.innodb_concurrency_tickets; - -############################## -# Restore initial value # -############################## - -SET @@global.innodb_concurrency_tickets = @global_start_value; -SELECT @@global.innodb_concurrency_tickets; - -############################################################### -# END OF innodb_concurrency_tickets TESTS # -############################################################### - diff --git a/mysql-test/include/innodb_max_purge_lag_basic.inc b/mysql-test/include/innodb_max_purge_lag_basic.inc deleted file mode 100644 index 9e6b8201e3d..00000000000 --- a/mysql-test/include/innodb_max_purge_lag_basic.inc +++ /dev/null @@ -1,147 +0,0 @@ -################# mysql-test\t\innodb_max_purge_lag_basic.test ################ -# # -# Variable Name: innodb_max_purge_lag # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 0 # -# Range: 0-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description:Test Cases of Dynamic System Variable innodb_max_purge_lag # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_max_purge_lag TESTS # -######################################################################## - -################################################################################ -# Saving initial value of innodb_max_purge_lag in a temporary variable # -################################################################################ - -SET @global_start_value = @@global.innodb_max_purge_lag; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_max_purge_lag # -######################################################################## - -SET @@global.innodb_max_purge_lag = 0; -SET @@global.innodb_max_purge_lag = DEFAULT; -SELECT @@global.innodb_max_purge_lag; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -############################################################################ -# Check if innodb_max_purge_lag can be accessed with and without @@ sign # -############################################################################ - ---Error ER_GLOBAL_VARIABLE -SET innodb_max_purge_lag = 1; -SELECT @@innodb_max_purge_lag; - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_max_purge_lag; - -SET global innodb_max_purge_lag = 0; -SELECT @@global.innodb_max_purge_lag; - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_max_purge_lag to a valid value # -########################################################################## - - -SET @@global.innodb_max_purge_lag = 0; -SELECT @@global.innodb_max_purge_lag; - -SET @@global.innodb_max_purge_lag = 1; -SELECT @@global.innodb_max_purge_lag; -SET @@global.innodb_max_purge_lag = 4294967295; -SELECT @@global.innodb_max_purge_lag; - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_max_purge_lag to invalid value # -########################################################################### - -SET @@global.innodb_max_purge_lag = -1; -SELECT @@global.innodb_max_purge_lag; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_purge_lag = "T"; -SELECT @@global.innodb_max_purge_lag; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_purge_lag = "Y"; -SELECT @@global.innodb_max_purge_lag; - - -SET @@global.innodb_max_purge_lag = 1001; -SELECT @@global.innodb_max_purge_lag; - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_max_purge_lag = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_max_purge_lag'; -SELECT @@global.innodb_max_purge_lag; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_max_purge_lag'; - - - - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_purge_lag = OFF; -SELECT @@global.innodb_max_purge_lag; - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_max_purge_lag = ON; -SELECT @@global.innodb_max_purge_lag; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - - -SET @@global.innodb_max_purge_lag = TRUE; -SELECT @@global.innodb_max_purge_lag; -SET @@global.innodb_max_purge_lag = FALSE; -SELECT @@global.innodb_max_purge_lag; - -############################## -# Restore initial value # -############################## - - -SET @@global.innodb_max_purge_lag = @global_start_value; -SELECT @@global.innodb_max_purge_lag; - -############################################################### -# END OF innodb_max_purge_lag TESTS # -############################################################### diff --git a/mysql-test/include/innodb_sync_spin_loops_basic.inc b/mysql-test/include/innodb_sync_spin_loops_basic.inc deleted file mode 100644 index 35460fe47f2..00000000000 --- a/mysql-test/include/innodb_sync_spin_loops_basic.inc +++ /dev/null @@ -1,142 +0,0 @@ -################# mysql-test\t\innodb_sync_spin_loops_basic.test ############## -# # -# Variable Name: innodb_sync_spin_loops # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 20 # -# Range: 0-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -#Description:Test Cases of Dynamic System Variable innodb_sync_spin_loops # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_innodb.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF innodb_sync_spin_loops TESTS # -######################################################################## - - -############################################################################ -# Saving initial value of innodb_sync_spin_loops in a temporary variable # -############################################################################ - -SET @global_start_value = @@global.innodb_sync_spin_loops; -SELECT @global_start_value; - ---echo '#--------------------FN_DYNVARS_046_01------------------------#' -######################################################################## -# Display the DEFAULT value of innodb_sync_spin_loops # -######################################################################## - -SET @@global.innodb_sync_spin_loops = 0; -SET @@global.innodb_sync_spin_loops = DEFAULT; -SELECT @@global.innodb_sync_spin_loops; - ---echo '#---------------------FN_DYNVARS_046_02-------------------------#' -############################################################################## -# Check if innodb_sync_spin_loops can be accessed with and without @@ sign # -############################################################################## - ---Error ER_GLOBAL_VARIABLE -SET innodb_sync_spin_loops = 1; -SELECT @@innodb_sync_spin_loops; - ---Error ER_UNKNOWN_TABLE -SELECT local.innodb_sync_spin_loops; - -SET global innodb_sync_spin_loops = 0; -SELECT @@global.innodb_sync_spin_loops; - ---echo '#--------------------FN_DYNVARS_046_03------------------------#' -########################################################################## -# change the value of innodb_sync_spin_loops to a valid value # -########################################################################## - -SET @@global.innodb_sync_spin_loops = 0; -SELECT @@global.innodb_sync_spin_loops; - -SET @@global.innodb_sync_spin_loops = 1; -SELECT @@global.innodb_sync_spin_loops; -SET @@global.innodb_sync_spin_loops = 1000; -SELECT @@global.innodb_sync_spin_loops; - ---echo '#--------------------FN_DYNVARS_046_04-------------------------#' -########################################################################### -# Change the value of innodb_sync_spin_loops to invalid value # -########################################################################### - -SET @@global.innodb_sync_spin_loops = -1; -SELECT @@global.innodb_sync_spin_loops; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_sync_spin_loops = "T"; -SELECT @@global.innodb_sync_spin_loops; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_sync_spin_loops = "Y"; -SELECT @@global.innodb_sync_spin_loops; - -SET @@global.innodb_sync_spin_loops = 1001; -SELECT @@global.innodb_sync_spin_loops; - ---echo '#----------------------FN_DYNVARS_046_05------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -SELECT @@global.innodb_sync_spin_loops = - VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_sync_spin_loops'; -SELECT @@global.innodb_sync_spin_loops; -SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE VARIABLE_NAME='innodb_sync_spin_loops'; - ---echo '#---------------------FN_DYNVARS_046_06-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_sync_spin_loops = OFF; -SELECT @@global.innodb_sync_spin_loops; - ---ERROR ER_WRONG_TYPE_FOR_VAR -SET @@global.innodb_sync_spin_loops = ON; -SELECT @@global.innodb_sync_spin_loops; - ---echo '#---------------------FN_DYNVARS_046_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - - -SET @@global.innodb_sync_spin_loops = TRUE; -SELECT @@global.innodb_sync_spin_loops; -SET @@global.innodb_sync_spin_loops = FALSE; -SELECT @@global.innodb_sync_spin_loops; - -############################## -# Restore initial value # -############################## - -SET @@global.innodb_sync_spin_loops = @global_start_value; -SELECT @@global.innodb_sync_spin_loops; - -############################################################### -# END OF innodb_sync_spin_loops TESTS # -############################################################### diff --git a/mysql-test/include/join_buffer_size_basic.inc b/mysql-test/include/join_buffer_size_basic.inc deleted file mode 100644 index 880dac4cac4..00000000000 --- a/mysql-test/include/join_buffer_size_basic.inc +++ /dev/null @@ -1,216 +0,0 @@ -############## mysql-test\t\join_buffer_size_basic.test ############### -# # -# Variable Name: join_buffer_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 131072 # -# Range: 8200-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable join_buffer_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################ -# START OF join_buffer_size TESTS # -################################################################ - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.join_buffer_size; -SELECT @start_global_value; -SET @start_session_value = @@session.join_buffer_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_053_01-------------------------#' -################################################################ -# Display the DEFAULT value of join_buffer_size # -################################################################ - -SET @@global.join_buffer_size = 8200; -SET @@global.join_buffer_size = DEFAULT; -SELECT @@global.join_buffer_size; - -SET @@session.join_buffer_size = 8200; -SET @@session.join_buffer_size = DEFAULT; -SELECT @@session.join_buffer_size; - - ---echo '#--------------------FN_DYNVARS_053_02-------------------------#' -################################################################### -# Check the DEFAULT value of join_buffer_size # -################################################################### - -SET @@global.join_buffer_size = DEFAULT; -SELECT @@global.join_buffer_size = 131072; - -SET @@session.join_buffer_size = DEFAULT; -SELECT @@session.join_buffer_size = 131072; - - ---echo '#--------------------FN_DYNVARS_053_03-------------------------#' -########################################################################## -# Change the value of join_buffer_size to a valid value for GLOBAL Scope # -########################################################################## - -SET @@global.join_buffer_size = 8200; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -SET @@global.join_buffer_size = 65536; -SELECT @@global.join_buffer_size; -SET @@global.join_buffer_size = 4294967295; -SELECT @@global.join_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---echo '#--------------------FN_DYNVARS_053_04-------------------------#' -########################################################################### -# Change the value of join_buffer_size to a valid value for SESSION Scope # -########################################################################### - -SET @@session.join_buffer_size = 8200; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -SET @@session.join_buffer_size = 65536; -SELECT @@session.join_buffer_size; -SET @@session.join_buffer_size = 4294967295; -SELECT @@session.join_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---echo '#------------------FN_DYNVARS_053_05-----------------------#' -############################################################ -# Change the value of join_buffer_size to an invalid value # -############################################################ - -SET @@global.join_buffer_size = 0; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -SET @@global.join_buffer_size = -1024; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -SET @@global.join_buffer_size = 8199; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -SET @@global.join_buffer_size = 42949672951; -SELECT @@global.join_buffer_size; - ---Error ER_PARSE_ERROR -SET @@global.join_buffer_size = 65530.34.; -SELECT @@global.join_buffer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.join_buffer_size = test; -SELECT @@global.join_buffer_size; - -SET @@session.join_buffer_size = 0; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -SET @@session.join_buffer_size = -2; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -SET @@session.join_buffer_size = 8199; -SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; -SET @@session.join_buffer_size = 42949672951; -SELECT @@session.join_buffer_size; - ---Error ER_PARSE_ERROR -SET @@session.join_buffer_size = 65530.34.; -SELECT @@session.join_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.join_buffer_size = test; -SELECT @@session.join_buffer_size; - - ---echo '#------------------FN_DYNVARS_053_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.join_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='join_buffer_size'; - ---echo '#------------------FN_DYNVARS_053_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.join_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='join_buffer_size'; - - ---echo '#------------------FN_DYNVARS_053_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.join_buffer_size = TRUE; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; -SET @@global.join_buffer_size = FALSE; -SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; ---echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.join_buffer_size = 10; -SELECT @@join_buffer_size = @@global.join_buffer_size; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@join_buffer_size = 100; -SELECT @@join_buffer_size = @@local.join_buffer_size; -SELECT @@local.join_buffer_size = @@session.join_buffer_size; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################## -# Check if join_buffer_size can be accessed with and without @@ sign # -############################################################################## - -SET join_buffer_size = 1; -SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228; ---Error ER_UNKNOWN_TABLE -SELECT local.join_buffer_size; ---Error ER_UNKNOWN_TABLE -SELECT session.join_buffer_size; ---Error ER_BAD_FIELD_ERROR -SELECT join_buffer_size = @@session.join_buffer_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.join_buffer_size = @start_global_value; -SELECT @@global.join_buffer_size; -SET @@session.join_buffer_size = @start_session_value; -SELECT @@session.join_buffer_size; - - -######################################################## -# END OF join_buffer_size TESTS # -######################################################## - diff --git a/mysql-test/include/key_buffer_size_basic.inc b/mysql-test/include/key_buffer_size_basic.inc deleted file mode 100644 index 996a9e712f9..00000000000 --- a/mysql-test/include/key_buffer_size_basic.inc +++ /dev/null @@ -1,187 +0,0 @@ -############## mysql-test\t\key_buffer_size_basic.test ######################## -# # -# Variable Name: key_buffer_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 131072 # -# Range:8-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable key_buffer_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### -# Changes: # -# 2008-03-06 hhunger Got "lost connections with 5.1.24 # -######################################################################## - ---source include/load_sysvars.inc - -######################################################################## -# START OF key_buffer_size TESTS # -######################################################################## - ---disable_warnings -######################################################################## -# Saving initial value of key_buffer_size in a temporary variable # -######################################################################## - -SET @start_value = @@global.key_buffer_size; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_055_01------------------------#' -######################################################################## -# Display the DEFAULT value of key_buffer_size # -######################################################################## - -SET @@global.key_buffer_size = 99; ---Error ER_NO_DEFAULT -SET @@global.key_buffer_size = DEFAULT; ---echo 'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_buffer_size = @min_key_buffer_size; - - ---echo '#---------------------FN_DYNVARS_055_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.key_buffer_size = @start_value; -SELECT @@global.key_buffer_size = @start_value; - ---echo '#--------------------FN_DYNVARS_055_03------------------------#' -######################################################################## -# Change the value of key_buffer_size to a valid value # -######################################################################## - -SET @@global.key_buffer_size = @min_key_buffer_size; -SELECT @@global.key_buffer_size= @min_key_buffer_size; ---disable_warnings -#Due to "lost connection" -#SET @@global.key_buffer_size = 4294967295; ---enable_warnings -#SELECT @@global.key_buffer_size; -SET @@global.key_buffer_size = 1800; -SELECT @@global.key_buffer_size = @min_key_buffer_size; -SET @@global.key_buffer_size = 65535; -SELECT @@global.key_buffer_size; -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---echo '#--------------------FN_DYNVARS_055_04-------------------------#' -########################################################################### -# Change the value of key_buffer_size to invalid value # -########################################################################### - -# Due to "lost connection" -#SET @@global.key_buffer_size = -1; -#SELECT @@global.key_buffer_size; -#SET @@global.key_buffer_size = 100000000000; -#SELECT @@global.key_buffer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_buffer_size = 10000.01; -SELECT @@global.key_buffer_size; -#SET @@global.key_buffer_size = -1024; -#SELECT @@global.key_buffer_size; -SET @@global.key_buffer_size = 4; -SELECT @@global.key_buffer_size = @min_key_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_buffer_size = ON; -SELECT @@global.key_buffer_size = @min_key_buffer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_buffer_size = 'test'; -SELECT @@global.key_buffer_size = @min_key_buffer_size; - - ---echo '#-------------------FN_DYNVARS_055_05----------------------------#' -########################################################################### -# Test if accessing session key_buffer_size gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.key_buffer_size = 0; -SELECT @@key_buffer_size = @min_key_buffer_size; - - ---echo '#----------------------FN_DYNVARS_055_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.key_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_buffer_size'; - -SELECT @@key_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_buffer_size'; - - ---echo '#---------------------FN_DYNVARS_055_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.key_buffer_size = TRUE; -SELECT @@global.key_buffer_size = @min_key_buffer_size; -SET @@global.key_buffer_size = FALSE; -SELECT @@global.key_buffer_size = @min_key_buffer_size; - - ---echo '#---------------------FN_DYNVARS_055_08----------------------#' -##################################################################### -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -##################################################################### - -# due to differences in contents of the warnings ---disable_warnings -SET @@global.key_buffer_size = @min_key_buffer_size; -SELECT @@key_buffer_size = @@global.key_buffer_size; ---enable_warnings - ---echo '#---------------------FN_DYNVARS_055_09----------------------#' -########################################################################## -# Check if key_buffer_size can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET key_buffer_size = @min_key_buffer_size; -SELECT @@key_buffer_size = @min_key_buffer_size; ---Error ER_PARSE_ERROR -SET local.key_buffer_size = 10; ---Error ER_UNKNOWN_TABLE -SELECT local.key_buffer_size; ---Error ER_PARSE_ERROR -SET global.key_buffer_size = 10; ---Error ER_UNKNOWN_TABLE -SELECT global.key_buffer_size; ---Error ER_BAD_FIELD_ERROR -SELECT key_buffer_size = @@session.key_buffer_size; - - -############################## -# Restore initial value # -############################## - -SET @@global.key_buffer_size = @start_value; -SELECT @@global.key_buffer_size; - ---enable_warnings -####################################################################### -# END OF key_buffer_size TESTS # -####################################################################### diff --git a/mysql-test/include/key_cache_age_threshold_basic.inc b/mysql-test/include/key_cache_age_threshold_basic.inc deleted file mode 100644 index 7841ad2cedc..00000000000 --- a/mysql-test/include/key_cache_age_threshold_basic.inc +++ /dev/null @@ -1,180 +0,0 @@ -############## mysql-test\t\key_cache_age_threshold_basic.test ############### -# # -# Variable Name: key_cache_age_threshold # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 300 # -# Range: 100-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable key_cache_age_threshold # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF key_cache_age_threshold TESTS # -######################################################################## - - -############################################################################# -# Saving initial value of key_cache_age_threshold in a temporary variable # -############################################################################# - -SET @start_value = @@global.key_cache_age_threshold; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_056_01------------------------#' -################################################################################ -# Display the DEFAULT value of key_cache_age_threshold # -################################################################################ - -SET @@global.key_cache_age_threshold = 99; ---Error ER_NO_DEFAULT -SET @@global.key_cache_age_threshold = DEFAULT; ---echo 'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_cache_age_threshold; - - ---echo '#---------------------FN_DYNVARS_056_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.key_cache_age_threshold = @start_value; -SELECT @@global.key_cache_age_threshold = 300; - - ---echo '#--------------------FN_DYNVARS_056_03------------------------#' -############################################################################### -# Change the value of key_cache_age_threshold to a valid value # -############################################################################### - -SET @@global.key_cache_age_threshold = 100; -SELECT @@global.key_cache_age_threshold; -SET @@global.key_cache_age_threshold = 4294967295; -SELECT @@global.key_cache_age_threshold; -SET @@global.key_cache_age_threshold = 1800; -SELECT @@global.key_cache_age_threshold; -SET @@global.key_cache_age_threshold = 65535; -SELECT @@global.key_cache_age_threshold; ---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; - - ---echo '#--------------------FN_DYNVARS_056_04-------------------------#' -########################################################################### -# Change the value of key_cache_age_threshold to invalid value # -########################################################################### - -SET @@global.key_cache_age_threshold = -1; -SELECT @@global.key_cache_age_threshold; -SET @@global.key_cache_age_threshold = 42949672951; -SELECT @@global.key_cache_age_threshold; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_age_threshold = 10000.01; -SELECT @@global.key_cache_age_threshold; -SET @@global.key_cache_age_threshold = -1024; -SELECT @@global.key_cache_age_threshold; -SET @@global.key_cache_age_threshold = 99; -SELECT @@global.key_cache_age_threshold; - -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_age_threshold = ON; -SELECT @@global.key_cache_age_threshold; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_age_threshold = 'test'; -SELECT @@global.key_cache_age_threshold; - - ---echo '#-------------------FN_DYNVARS_056_05----------------------------#' -########################################################################### -# Test if accessing session key_cache_age_threshold gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.key_cache_age_threshold = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.key_cache_age_threshold; - - ---echo '#----------------------FN_DYNVARS_056_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_age_threshold'; - -SELECT @@key_cache_age_threshold = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_age_threshold'; - - ---echo '#---------------------FN_DYNVARS_056_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.key_cache_age_threshold = TRUE; -SELECT @@global.key_cache_age_threshold; -SET @@global.key_cache_age_threshold = FALSE; -SELECT @@global.key_cache_age_threshold; - - ---echo '#---------------------FN_DYNVARS_056_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.key_cache_age_threshold = 101; -SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold; - - ---echo '#---------------------FN_DYNVARS_056_09----------------------#' -########################################################################## ####### -# Check if key_cache_age_threshold can be accessed with and without @@ sign # -################################################################################## - ---Error ER_GLOBAL_VARIABLE -SET key_cache_age_threshold = 8000; -SELECT @@key_cache_age_threshold; ---Error ER_PARSE_ERROR -SET local.key_cache_age_threshold = 10; ---Error ER_UNKNOWN_TABLE -SELECT local.key_cache_age_threshold; ---Error ER_PARSE_ERROR -SET global.key_cache_age_threshold = 10; ---Error ER_UNKNOWN_TABLE -SELECT global.key_cache_age_threshold; ---Error ER_BAD_FIELD_ERROR -SELECT key_cache_age_threshold = @@session.key_cache_age_threshold; - - -############################## -# Restore initial value # -############################## - -SET @@global.key_cache_age_threshold = @start_value; -SELECT @@global.key_cache_age_threshold; - - -######################################################################## -# END OF key_cache_age_threshold TESTS # -######################################################################## diff --git a/mysql-test/include/key_cache_block_size_basic.inc b/mysql-test/include/key_cache_block_size_basic.inc deleted file mode 100644 index b12ea45b762..00000000000 --- a/mysql-test/include/key_cache_block_size_basic.inc +++ /dev/null @@ -1,185 +0,0 @@ -############## mysql-test\t\key_cache_block_size_basic.test ############### -# # -# Variable Name: key_cache_block_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric 1024 # -# Default Value: # -# Range: 512-16384 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable key_cache_block_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -##################################################################### -# START OF key_cache_block_size TESTS # -##################################################################### - - -########################################################################## -# Saving initial value of key_cache_block_size in a temporary variable # -########################################################################## - -SET @start_value = @@global.key_cache_block_size; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_057_01------------------------#' -################################################################################ -# Display the DEFAULT value of key_cache_block_size # -################################################################################ - -SET @@global.key_cache_block_size = 600; ---Error ER_NO_DEFAULT -SET @@global.key_cache_block_size = DEFAULT; ---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; -SELECT @@global.key_cache_block_size; - - ---echo '#---------------------FN_DYNVARS_057_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.key_cache_block_size = @start_value; -SELECT @@global.key_cache_block_size = 1024; - - ---echo '#--------------------FN_DYNVARS_057_03------------------------#' -############################################################################### -# Change the value of key_cache_block_size to a valid value # -############################################################################### - -SET @@global.key_cache_block_size = 1024; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = 16384; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = 1800; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = 16383; -SELECT @@global.key_cache_block_size; ---echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; - - ---echo '#--------------------FN_DYNVARS_057_04-------------------------#' -########################################################################### -# Change the value of key_cache_block_size to invalid value # -########################################################################### - -SET @@global.key_cache_block_size = -1; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = 42949672951; -SELECT @@global.key_cache_block_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_block_size = 10000.01; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = -1024; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = 256; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = 511; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = 16385; -SELECT @@global.key_cache_block_size; - -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_block_size = ON; -SELECT @@global.key_cache_block_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_block_size = 'test'; -SELECT @@global.key_cache_block_size; - - ---echo '#-------------------FN_DYNVARS_057_05----------------------------#' -########################################################################### -# Test if accessing session key_cache_block_size gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.key_cache_block_size = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.key_cache_block_size; - - ---echo '#----------------------FN_DYNVARS_057_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.key_cache_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_block_size'; - -SELECT @@key_cache_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_block_size'; - - ---echo '#---------------------FN_DYNVARS_057_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.key_cache_block_size = TRUE; -SELECT @@global.key_cache_block_size; -SET @@global.key_cache_block_size = FALSE; -SELECT @@global.key_cache_block_size; - - ---echo '#---------------------FN_DYNVARS_057_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.key_cache_block_size = 1024; -SELECT @@key_cache_block_size = @@global.key_cache_block_size; - - ---echo '#---------------------FN_DYNVARS_057_09----------------------#' -############################################################################### -# Check if key_cache_block_size can be accessed with and without @@ sign # -###############################################################################; - ---Error ER_GLOBAL_VARIABLE -SET key_cache_block_size = 8000; -SELECT @@key_cache_block_size; ---Error ER_PARSE_ERROR -SET local.key_cache_block_size = 10; ---Error ER_UNKNOWN_TABLE -SELECT local.key_cache_block_size; ---Error ER_PARSE_ERROR -SET global.key_cache_block_size = 10; ---Error ER_UNKNOWN_TABLE -SELECT global.key_cache_block_size; ---Error ER_BAD_FIELD_ERROR -SELECT key_cache_block_size = @@session.key_cache_block_size; - - -############################## -# Restore initial value # -############################## - -SET @@global.key_cache_block_size = @start_value; -SELECT @@global.key_cache_block_size; - - -##################################################################### -# END OF key_cache_block_size TESTS # -##################################################################### - diff --git a/mysql-test/include/key_cache_division_limit_basic.inc b/mysql-test/include/key_cache_division_limit_basic.inc deleted file mode 100644 index a2cc49a1f38..00000000000 --- a/mysql-test/include/key_cache_division_limit_basic.inc +++ /dev/null @@ -1,184 +0,0 @@ -############## mysql-test\t\key_cache_division_limit_basic.test ############### -# # -# Variable Name: key_cache_division_limit # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 100 # -# Range: 1-100 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable key_cache_division_limit # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -##################################################################### -# START OF key_cache_division_limit TESTS # -##################################################################### - - -############################################################################## -# Saving initial value of key_cache_division_limit in a temporary variable # -############################################################################## - -SET @start_value = @@global.key_cache_division_limit; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_058_01------------------------#' -################################################################################ -# Display the DEFAULT value of key_cache_division_limit # -################################################################################ - -SET @@global.key_cache_division_limit = 50; ---Error ER_NO_DEFAULT -SET @@global.key_cache_division_limit = DEFAULT; ---echo 'Bug# 34878: This variable has default value according to documentation'; -SELECT @@global.key_cache_division_limit; - - ---echo '#---------------------FN_DYNVARS_058_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.key_cache_division_limit = @start_value; -SELECT @@global.key_cache_division_limit = 100; - - ---echo '#--------------------FN_DYNVARS_058_03------------------------#' -############################################################################### -# Change the value of key_cache_division_limit to a valid value # -############################################################################### - -SET @@global.key_cache_division_limit = 1; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = 50; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = 99; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = 2; -SELECT @@global.key_cache_division_limit; - - ---echo '#--------------------FN_DYNVARS_058_04-------------------------#' -########################################################################### -# Change the value of key_cache_division_limit to invalid value # -########################################################################### - -SET @@global.key_cache_division_limit = -1; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = 101; -SELECT @@global.key_cache_division_limit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_division_limit = 10000.01; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = -1024; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = 0; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = 200; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = 65535; -SELECT @@global.key_cache_division_limit; - -echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_division_limit = ON; -SELECT @@global.key_cache_division_limit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.key_cache_division_limit = 'test'; -SELECT @@global.key_cache_division_limit; - - ---echo '#-------------------FN_DYNVARS_058_05----------------------------#' -########################################################################### -# Test if accessing session key_cache_division_limit gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.key_cache_division_limit = 0; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.key_cache_division_limit; - - ---echo '#----------------------FN_DYNVARS_058_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.key_cache_division_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='key_cache_division_limit'; - -SELECT @@key_cache_division_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='key_cache_division_limit'; - - ---echo '#---------------------FN_DYNVARS_058_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.key_cache_division_limit = TRUE; -SELECT @@global.key_cache_division_limit; -SET @@global.key_cache_division_limit = FALSE; -SELECT @@global.key_cache_division_limit; - - ---echo '#---------------------FN_DYNVARS_058_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.key_cache_division_limit = 90; -SELECT @@key_cache_division_limit = @@global.key_cache_division_limit; - - ---echo '#---------------------FN_DYNVARS_058_09----------------------#' -############################################################################### -# Check if key_cache_division_limit can be accessed with and without @@ sign # -###############################################################################; - ---Error ER_GLOBAL_VARIABLE -SET key_cache_division_limit = 80; -SELECT @@key_cache_division_limit; ---Error ER_PARSE_ERROR -SET local.key_cache_division_limit = 10; ---Error ER_UNKNOWN_TABLE -SELECT local.key_cache_division_limit; ---Error ER_PARSE_ERROR -SET global.key_cache_division_limit = 10; ---Error ER_UNKNOWN_TABLE -SELECT global.key_cache_division_limit; ---Error ER_BAD_FIELD_ERROR -SELECT key_cache_division_limit = @@session.key_cache_division_limit; - - -############################## -# Restore initial value # -############################## - -SET @@global.key_cache_division_limit = @start_value; -SELECT @@global.key_cache_division_limit; - - -##################################################################### -# END OF key_cache_division_limit TESTS # -##################################################################### - diff --git a/mysql-test/include/log_warnings_basic.inc b/mysql-test/include/log_warnings_basic.inc deleted file mode 100644 index cd7e1023649..00000000000 --- a/mysql-test/include/log_warnings_basic.inc +++ /dev/null @@ -1,210 +0,0 @@ -############## mysql-test\t\log_warnings_basic.test ############### -# # -# Variable Name: log_warnings # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1 # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable log_warnings # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -############################################################ -# START OF log_warnings TESTS # -############################################################ - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.log_warnings; -SELECT @start_global_value; -SET @start_session_value = @@session.log_warnings; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_067_01-------------------------#' -######################################################################## -# Display the DEFAULT value of log_warnings # -######################################################################## - -SET @@global.log_warnings = 100; -SET @@global.log_warnings = DEFAULT; -SELECT @@global.log_warnings; - -SET @@session.log_warnings = 200; -SET @@session.log_warnings = DEFAULT; -SELECT @@session.log_warnings; - - ---echo '#--------------------FN_DYNVARS_067_02-------------------------#' -######################################################################## -# Check the DEFAULT value of log_warnings # -######################################################################## - -SET @@global.log_warnings = DEFAULT; -SELECT @@global.log_warnings = 1; - -SET @@session.log_warnings = DEFAULT; -SELECT @@session.log_warnings = 1; - - ---echo '#--------------------FN_DYNVARS_067_03-------------------------#' -###################################################################### -# Change the value of log_warnings to a valid value for GLOBAL Scope # -###################################################################### - -SET @@global.log_warnings = 0; -SELECT @@global.log_warnings; -SET @@global.log_warnings = 1; -SELECT @@global.log_warnings; -SET @@global.log_warnings = 60020; -SELECT @@global.log_warnings; -SET @@global.log_warnings = 65535; -SELECT @@global.log_warnings; -SET @@global.log_warnings = 65536; -SELECT @@global.log_warnings; - - ---echo '#--------------------FN_DYNVARS_067_04-------------------------#' -####################################################################### -# Change the value of log_warnings to a valid value for SESSION Scope # -####################################################################### - -SET @@session.log_warnings = 0; -SELECT @@session.log_warnings; -SET @@session.log_warnings = 1; -SELECT @@session.log_warnings; -SET @@session.log_warnings = 50050; -SELECT @@session.log_warnings; -SET @@session.log_warnings = 65535; -SELECT @@session.log_warnings; -SET @@session.log_warnings = 65550; -SELECT @@session.log_warnings; - - ---echo '#------------------FN_DYNVARS_067_05-----------------------#' -######################################################## -# Change the value of log_warnings to an invalid value # -######################################################## - -SET @@global.log_warnings = 100000000000; -SELECT @@global.log_warnings; -SET @@global.log_warnings = -1024; -SELECT @@global.log_warnings; ---Error ER_PARSE_ERROR -SET @@global.log_warnings = 65530.34.; -SELECT @@global.log_warnings; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.log_warnings = test; -SELECT @@global.log_warnings; - -SET @@session.log_warnings = 100000000000; -SELECT @@session.log_warnings; -SET @@session.log_warnings = -2; -SELECT @@session.log_warnings; ---Error ER_PARSE_ERROR -SET @@session.log_warnings = 65530.34.; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.log_warnings = test; -SELECT @@session.log_warnings; - - ---echo '#------------------FN_DYNVARS_067_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.log_warnings = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='log_warnings'; - ---echo '#------------------FN_DYNVARS_067_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.log_warnings = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='log_warnings'; - - ---echo '#------------------FN_DYNVARS_067_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.log_warnings = TRUE; -SELECT @@global.log_warnings; -SET @@global.log_warnings = FALSE; -SELECT @@global.log_warnings; - - ---echo '#---------------------FN_DYNVARS_067_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.log_warnings = 10; -SELECT @@log_warnings = @@global.log_warnings; - - ---echo '#---------------------FN_DYNVARS_067_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@log_warnings = 100; -SELECT @@log_warnings = @@local.log_warnings; -SELECT @@local.log_warnings = @@session.log_warnings; - - ---echo '#---------------------FN_DYNVARS_067_11----------------------#' -####################################################################### -# Check if log_warnings can be accessed with and without @@ sign # -####################################################################### - -SET log_warnings = 1; -SELECT @@log_warnings; ---Error ER_UNKNOWN_TABLE -SELECT local.log_warnings; ---Error ER_UNKNOWN_TABLE -SELECT session.log_warnings; ---Error ER_BAD_FIELD_ERROR -SELECT log_warnings = @@session.log_warnings; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.log_warnings = @start_global_value; -SELECT @@global.log_warnings; -SET @@session.log_warnings = @start_session_value; -SELECT @@session.log_warnings; - - -############################################################# -# END OF log_warnings TESTS # -############################################################# - diff --git a/mysql-test/include/max_binlog_cache_size_basic.inc b/mysql-test/include/max_binlog_cache_size_basic.inc deleted file mode 100644 index 9f3416d2e31..00000000000 --- a/mysql-test/include/max_binlog_cache_size_basic.inc +++ /dev/null @@ -1,187 +0,0 @@ -############## mysql-test\t\max_binlog_cache_size_basic.test ############### -# # -# Variable Name: max_binlog_cache_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:4294967295 # -# Range: 4096-4294967295 # -# # -# # -# # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_binlog_cache_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF max_binlog_cache_size TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of max_binlog_cache_size in a temporary variable# -######################################################################## - -SET @start_value = @@global.max_binlog_cache_size; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_072_01------------------------#' -######################################################################## -# Display the DEFAULT value of max_binlog_cache_size # -######################################################################## - -SET @@global.max_binlog_cache_size = 5000; -SET @@global.max_binlog_cache_size = DEFAULT; -SELECT @@global.max_binlog_cache_size; - - ---echo '#---------------------FN_DYNVARS_072_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.max_binlog_cache_size = @start_value; -SELECT @@global.max_binlog_cache_size = 4294967295; ---echo 'Bug# 34876: Incorrect Default Value is assigned to variable'; - ---echo '#--------------------FN_DYNVARS_072_03------------------------#' -######################################################################## -# Change the value of max_binlog_cache_size to a valid value # -######################################################################## - -SET @@global.max_binlog_cache_size = 4096; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 4294967295; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 4294967294; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 4097; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 65535; -SELECT @@global.max_binlog_cache_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_072_04-------------------------#' -########################################################################### -# Change the value of max_binlog_cache_size to invalid value # -########################################################################### - -SET @@global.max_binlog_cache_size = -1; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 100000000000; -SELECT @@global.max_binlog_cache_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_binlog_cache_size = 10000.01; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = -1024; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 1024; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 4294967296; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = 4095; -SELECT @@global.max_binlog_cache_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_binlog_cache_size = ON; -SELECT @@global.max_binlog_cache_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_binlog_cache_size = 'test'; -SELECT @@global.max_binlog_cache_size; - - ---echo '#-------------------FN_DYNVARS_072_05----------------------------#' -########################################################################### -# Test if accessing session max_binlog_cache_size gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.max_binlog_cache_size = 4096; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.max_binlog_cache_size; - - ---echo '#----------------------FN_DYNVARS_072_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_binlog_cache_size'; - -SELECT @@max_binlog_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_binlog_cache_size'; - - ---echo '#---------------------FN_DYNVARS_072_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.max_binlog_cache_size = TRUE; -SELECT @@global.max_binlog_cache_size; -SET @@global.max_binlog_cache_size = FALSE; -SELECT @@global.max_binlog_cache_size; - - ---echo '#---------------------FN_DYNVARS_072_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.max_binlog_cache_size = 5000; -SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size; - - ---echo '#---------------------FN_DYNVARS_072_09----------------------#' -################################################################################ -# Check if max_binlog_cache_size can be accessed with and without @@ sign # -################################################################################ - ---Error ER_GLOBAL_VARIABLE -SET max_binlog_cache_size = 6000; -SELECT @@max_binlog_cache_size; ---Error ER_PARSE_ERROR -SET local.max_binlog_cache_size = 7000; ---Error ER_UNKNOWN_TABLE -SELECT local.max_binlog_cache_size; ---Error ER_PARSE_ERROR -SET global.max_binlog_cache_size = 8000; ---Error ER_UNKNOWN_TABLE -SELECT global.max_binlog_cache_size; ---Error ER_BAD_FIELD_ERROR -SELECT max_binlog_cache_size = @@session.max_binlog_cache_size; - - -############################## -# Restore initial value # -############################## - -SET @@global.max_binlog_cache_size = @start_value; -SELECT @@global.max_binlog_cache_size; - - -######################################################################## -# END OF max_binlog_cache_size TESTS # -######################################################################## diff --git a/mysql-test/include/max_connect_errors_basic.inc b/mysql-test/include/max_connect_errors_basic.inc deleted file mode 100644 index 530022652a1..00000000000 --- a/mysql-test/include/max_connect_errors_basic.inc +++ /dev/null @@ -1,182 +0,0 @@ -############## mysql-test\t\max_connect_errors_basic.test ############### -# # -# Variable Name: max_connect_errors # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 10 # -# Range: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_connect_errors # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################## -# START OF max_connect_errors TESTS # -################################################################## - - -###################################################################### -# Saving initial value of max_connect_errors in a temporary variable # -###################################################################### - -SET @start_value = @@global.max_connect_errors; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_073_01------------------------#' -################################################################## -# Display the DEFAULT value of max_connect_errors # -################################################################## - -SET @@global.max_connect_errors = 5000; -SET @@global.max_connect_errors = DEFAULT; -SELECT @@global.max_connect_errors; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - ---echo '#---------------------FN_DYNVARS_073_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.max_connect_errors = @start_value; -SELECT @@global.max_connect_errors = 10; - ---echo '#--------------------FN_DYNVARS_073_03------------------------#' -################################################################## -# Change the value of max_connect_errors to a valid value # -################################################################## - -SET @@global.max_connect_errors = 4096; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = 4294967294; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = 4294967295; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = 1; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = 2; -SELECT @@global.max_connect_errors; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_073_04-------------------------#' -##################################################################### -# Change the value of max_connect_errors to invalid value # -##################################################################### - -SET @@global.max_connect_errors = -1; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = 100000000000; -SELECT @@global.max_connect_errors; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_connect_errors = 10000.01; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = -1024; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = 0; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = 4294967296; -SELECT @@global.max_connect_errors; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_connect_errors = ON; -SELECT @@global.max_connect_errors; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_connect_errors = 'test'; -SELECT @@global.max_connect_errors; - - ---echo '#-------------------FN_DYNVARS_073_05----------------------------#' -##################################################################### -# Test if accessing session max_connect_errors gives error # -##################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.max_connect_errors = 4096; ---Error ER_INCORRECT_GLOBAL_LOCAL_VAR -SELECT @@session.max_connect_errors; - - ---echo '#----------------------FN_DYNVARS_073_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.max_connect_errors = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_connect_errors'; - -SELECT @@max_connect_errors = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_connect_errors'; - - ---echo '#---------------------FN_DYNVARS_073_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.max_connect_errors = TRUE; -SELECT @@global.max_connect_errors; -SET @@global.max_connect_errors = FALSE; -SELECT @@global.max_connect_errors; - - ---echo '#---------------------FN_DYNVARS_073_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.max_connect_errors = 5000; -SELECT @@max_connect_errors = @@global.max_connect_errors; - - ---echo '#---------------------FN_DYNVARS_073_09----------------------#' -########################################################################## -# Check if max_connect_errors can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET max_connect_errors = 6000; -SELECT @@max_connect_errors; ---Error ER_PARSE_ERROR -SET local.max_connect_errors = 7000; ---Error ER_UNKNOWN_TABLE -SELECT local.max_connect_errors; ---Error ER_PARSE_ERROR -SET global.max_connect_errors = 8000; ---Error ER_UNKNOWN_TABLE -SELECT global.max_connect_errors; ---Error ER_BAD_FIELD_ERROR -SELECT max_connect_errors = @@session.max_connect_errors; - - -############################## -# Restore initial value # -############################## - -SET @@global.max_connect_errors = @start_value; -SELECT @@global.max_connect_errors; - - -################################################################## -# END OF max_connect_errors TESTS # -################################################################## - diff --git a/mysql-test/include/max_heap_table_size_basic.inc b/mysql-test/include/max_heap_table_size_basic.inc deleted file mode 100644 index d07ae094cde..00000000000 --- a/mysql-test/include/max_heap_table_size_basic.inc +++ /dev/null @@ -1,222 +0,0 @@ -############## mysql-test\t\max_heap_table_size_basic.test ############### -# # -# Variable Name: max_heap_table_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 16777216 # -# Range: 16384-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_heap_table_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -############################################################### -# START OF max_heap_table_size TESTS # -############################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_heap_table_size; -SELECT @start_global_value; -SET @start_session_value = @@session.max_heap_table_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_077_01-------------------------#' -############################################################### -# Display the DEFAULT value of max_heap_table_size # -############################################################### - -SET @@global.max_heap_table_size = 1677721610; -SET @@global.max_heap_table_size = DEFAULT; -SELECT @@global.max_heap_table_size; - -SET @@session.max_heap_table_size = 1677721610; -SET @@session.max_heap_table_size = DEFAULT; -SELECT @@session.max_heap_table_size; - - ---echo '#--------------------FN_DYNVARS_077_02-------------------------#' -################################################################## -# Check the DEFAULT value of max_heap_table_size # -################################################################## - -SET @@global.max_heap_table_size = DEFAULT; -SELECT @@global.max_heap_table_size = 16777216; - -SET @@session.max_heap_table_size = DEFAULT; -SELECT @@session.max_heap_table_size = 16777216; - - ---echo '#--------------------FN_DYNVARS_077_03-------------------------#' -############################################################################ -# Change the value of max_heap_table_size to a valid value for GLOBAL Scope # -############################################################################ - -SET @@global.max_heap_table_size = 16384; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = 16385; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = 65535; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = 4294967294; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = 4294967295; -SELECT @@global.max_heap_table_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_077_04-------------------------#' -############################################################################# -# Change the value of max_heap_table_size to a valid value for SESSION Scope # -############################################################################# - -SET @@session.max_heap_table_size = 16384; -SELECT @@session.max_heap_table_size; -SET @@session.max_heap_table_size = 16385; -SELECT @@session.max_heap_table_size; -SET @@session.max_heap_table_size = 65535; -SELECT @@session.max_heap_table_size; -SET @@session.max_heap_table_size = 4294967294; -SELECT @@session.max_heap_table_size; -SET @@session.max_heap_table_size = 4294967295; -SELECT @@session.max_heap_table_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#------------------FN_DYNVARS_077_05-----------------------#' -############################################################## -# Change the value of max_heap_table_size to an invalid value # -############################################################## - -SET @@global.max_heap_table_size = -1; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = -1024; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = 1024; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = 16383; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = 4294967296; -SELECT @@global.max_heap_table_size; ---Error ER_PARSE_ERROR -SET @@global.max_heap_table_size = 65530.34.; -SELECT @@global.max_heap_table_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_heap_table_size = test; -SELECT @@global.max_heap_table_size; - -SET @@session.max_heap_table_size = -1; -SELECT @@session.max_heap_table_size; -SET @@session.max_heap_table_size = 16383; -SELECT @@session.max_heap_table_size; -SET @@session.max_heap_table_size = 4294967296; -SELECT @@session.max_heap_table_size; ---Error ER_PARSE_ERROR -SET @@session.max_heap_table_size = 65530.34.; -SET @@session.max_heap_table_size = 10737418241; -SELECT @@session.max_heap_table_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_heap_table_size = test; -SELECT @@session.max_heap_table_size; - - ---echo '#------------------FN_DYNVARS_077_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_heap_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_heap_table_size'; - ---echo '#------------------FN_DYNVARS_077_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_heap_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_heap_table_size'; - - ---echo '#------------------FN_DYNVARS_077_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_heap_table_size = TRUE; -SELECT @@global.max_heap_table_size; -SET @@global.max_heap_table_size = FALSE; -SELECT @@global.max_heap_table_size; - - ---echo '#---------------------FN_DYNVARS_077_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_heap_table_size = 163845; -SELECT @@max_heap_table_size = @@global.max_heap_table_size; - - ---echo '#---------------------FN_DYNVARS_077_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_heap_table_size = 16777216; -SELECT @@max_heap_table_size = @@local.max_heap_table_size; -SELECT @@local.max_heap_table_size = @@session.max_heap_table_size; - - ---echo '#---------------------FN_DYNVARS_077_11----------------------#' -############################################################################# -# Check if max_heap_table_size can be accessed with and without @@ sign # -############################################################################# - -SET max_heap_table_size = 316777216; -SELECT @@max_heap_table_size; ---Error ER_UNKNOWN_TABLE -SELECT local.max_heap_table_size; ---Error ER_UNKNOWN_TABLE -SELECT session.max_heap_table_size; ---Error ER_BAD_FIELD_ERROR -SELECT max_heap_table_size = @@session.max_heap_table_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_heap_table_size = @start_global_value; -SELECT @@global.max_heap_table_size; -SET @@session.max_heap_table_size = @start_session_value; -SELECT @@session.max_heap_table_size; - - -####################################################### -# END OF max_heap_table_size TESTS # -####################################################### - diff --git a/mysql-test/include/max_seeks_for_key_basic.inc b/mysql-test/include/max_seeks_for_key_basic.inc deleted file mode 100644 index 23c3c5b2a95..00000000000 --- a/mysql-test/include/max_seeks_for_key_basic.inc +++ /dev/null @@ -1,213 +0,0 @@ -############## mysql-test\t\max_seeks_for_key_basic.test ############### -# # -# Variable Name: max_seeks_for_key # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 4294967295 # -# Range: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_seeks_for_key # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################# -# START OF max_seeks_for_key TESTS # -################################################################# - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_seeks_for_key; -SELECT @start_global_value; -SET @start_session_value = @@session.max_seeks_for_key; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_083_01-------------------------#' -################################################################# -# Display the DEFAULT value of max_seeks_for_key # -################################################################# - -SET @@global.max_seeks_for_key = 100; -SET @@global.max_seeks_for_key = DEFAULT; -SELECT @@global.max_seeks_for_key; - -SET @@session.max_seeks_for_key = 200; -SET @@session.max_seeks_for_key = DEFAULT; -SELECT @@session.max_seeks_for_key; - - ---echo '#--------------------FN_DYNVARS_083_02-------------------------#' -################################################################# -# Check the DEFAULT value of max_seeks_for_key # -################################################################# - -SET @@global.max_seeks_for_key = DEFAULT; -SELECT @@global.max_seeks_for_key = 4294967295; - -SET @@session.max_seeks_for_key = DEFAULT; -SELECT @@session.max_seeks_for_key = 4294967295; - - ---echo '#--------------------FN_DYNVARS_083_03-------------------------#' -########################################################################### -# Change the value of max_seeks_for_key to a valid value for GLOBAL Scope # -########################################################################### - -SET @@global.max_seeks_for_key = 1; -SELECT @@global.max_seeks_for_key; -SET @@global.max_seeks_for_key = 2; -SELECT @@global.max_seeks_for_key; -SET @@global.max_seeks_for_key = 65536; -SELECT @@global.max_seeks_for_key; -SET @@global.max_seeks_for_key = 4294967295; -SELECT @@global.max_seeks_for_key; -SET @@global.max_seeks_for_key = 4294967294; -SELECT @@global.max_seeks_for_key; - - ---echo '#--------------------FN_DYNVARS_083_04-------------------------#' -############################################################################ -# Change the value of max_seeks_for_key to a valid value for SESSION Scope # -############################################################################ -SET @@session.max_seeks_for_key = 1; -SELECT @@session.max_seeks_for_key; -SET @@session.max_seeks_for_key = 2; -SELECT @@session.max_seeks_for_key; -SET @@session.max_seeks_for_key = 4294967295; -SELECT @@session.max_seeks_for_key; -SET @@session.max_seeks_for_key = 4294967294; -SELECT @@session.max_seeks_for_key; -SET @@session.max_seeks_for_key = 65535; -SELECT @@session.max_seeks_for_key; - - ---echo '#------------------FN_DYNVARS_083_05-----------------------#' -############################################################# -# Change the value of max_seeks_for_key to an invalid value # -############################################################# - -SET @@global.max_seeks_for_key = 0; -SELECT @@global.max_seeks_for_key; -SET @@global.max_seeks_for_key = -1024; -SELECT @@global.max_seeks_for_key; -SET @@global.max_seeks_for_key = 4294967296; -SELECT @@global.max_seeks_for_key; ---Error ER_PARSE_ERROR -SET @@global.max_seeks_for_key = 65530.34.; -SELECT @@global.max_seeks_for_key; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_seeks_for_key = test; -SELECT @@global.max_seeks_for_key; - -SET @@session.max_seeks_for_key = 0; -SELECT @@session.max_seeks_for_key; -SET @@session.max_seeks_for_key = -2; -SELECT @@session.max_seeks_for_key; ---Error ER_PARSE_ERROR -SET @@session.max_seeks_for_key = 65530.34.; -SET @@session.max_seeks_for_key = 4294967296; -SELECT @@session.max_seeks_for_key; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_seeks_for_key = test; -SELECT @@session.max_seeks_for_key; - - ---echo '#------------------FN_DYNVARS_083_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_seeks_for_key = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_seeks_for_key'; - ---echo '#------------------FN_DYNVARS_083_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_seeks_for_key = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_seeks_for_key'; - - ---echo '#------------------FN_DYNVARS_083_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_seeks_for_key = TRUE; -SELECT @@global.max_seeks_for_key; -SET @@global.max_seeks_for_key = FALSE; -SELECT @@global.max_seeks_for_key; - - ---echo '#---------------------FN_DYNVARS_083_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_seeks_for_key = 10; -SELECT @@max_seeks_for_key = @@global.max_seeks_for_key; - - ---echo '#---------------------FN_DYNVARS_083_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_seeks_for_key = 100; -SELECT @@max_seeks_for_key = @@local.max_seeks_for_key; -SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key; - - ---echo '#---------------------FN_DYNVARS_083_11----------------------#' -############################################################################ -# Check if max_seeks_for_key can be accessed with and without @@ sign # -############################################################################ - -SET max_seeks_for_key = 1; -SELECT @@max_seeks_for_key; ---Error ER_UNKNOWN_TABLE -SELECT local.max_seeks_for_key; ---Error ER_UNKNOWN_TABLE -SELECT session.max_seeks_for_key; ---Error ER_BAD_FIELD_ERROR -SELECT max_seeks_for_key = @@session.max_seeks_for_key; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_seeks_for_key = @start_global_value; -SELECT @@global.max_seeks_for_key; -SET @@session.max_seeks_for_key = @start_session_value; -SELECT @@session.max_seeks_for_key; - - -############################################################# -# END OF max_seeks_for_key TESTS # -############################################################# - diff --git a/mysql-test/include/max_tmp_tables_basic.inc b/mysql-test/include/max_tmp_tables_basic.inc deleted file mode 100644 index e24d97f47dd..00000000000 --- a/mysql-test/include/max_tmp_tables_basic.inc +++ /dev/null @@ -1,227 +0,0 @@ -############## mysql-test\t\max_tmp_tables_basic.test ############### -# # -# Variable Name: max_tmp_tables # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 32 # -# Range: 1-4294967295 # -# # -# # -# # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_tmp_tables # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -#################################### -# START OF max_tmp_tables TESTS # -#################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_tmp_tables; -SELECT @start_global_value; -SET @start_session_value = @@session.max_tmp_tables; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_086_01-------------------------#' -###################################################### -# Display the DEFAULT value of max_tmp_tables # -###################################################### - -SET @@global.max_tmp_tables = 1000; -SET @@global.max_tmp_tables = DEFAULT; -SELECT @@global.max_tmp_tables; - - -SET @@session.max_tmp_tables = 1000; -SET @@session.max_tmp_tables = DEFAULT; -SELECT @@session.max_tmp_tables; - - ---echo '#--------------------FN_DYNVARS_086_02-------------------------#' -###################################################### -# Check the DEFAULT value of max_tmp_tables # -###################################################### - -SET @@global.max_tmp_tables = DEFAULT; -SELECT @@global.max_tmp_tables = 32; - -SET @@session.max_tmp_tables = DEFAULT; -SELECT @@session.max_tmp_tables = 32; - - - ---echo '#--------------------FN_DYNVARS_086_03-------------------------#' -######################################################################## -# Change the value of max_tmp_tables to a valid value for GLOBAL Scope # -######################################################################## - -SET @@global.max_tmp_tables = 1; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = 2; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = 65536; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = 4294967295; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = 4294967294; -SELECT @@global.max_tmp_tables; - ---echo '#--------------------FN_DYNVARS_086_04-------------------------#' -######################################################################### -# Change the value of max_tmp_tables to a valid value for SESSION Scope # -######################################################################### - -SET @@session.max_tmp_tables = 1; -SELECT @@session.max_tmp_tables; - -SET @@session.max_tmp_tables = 2; -SELECT @@session.max_tmp_tables; - -SET @@session.max_tmp_tables = 65536; -SELECT @@session.max_tmp_tables; - -SET @@session.max_tmp_tables = 4294967295; -SELECT @@session.max_tmp_tables; - -SET @@session.max_tmp_tables = 4294967294; -SELECT @@session.max_tmp_tables; - - ---echo '#------------------FN_DYNVARS_086_05-----------------------#' -########################################################## -# Change the value of max_tmp_tables to an invalid value # -########################################################## - -SET @@global.max_tmp_tables = -1024; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = 4294967296; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = -1; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = 429496729500; -SELECT @@global.max_tmp_tables; ---Error ER_PARSE_ERROR -SET @@global.max_tmp_tables = 65530.34.; -SELECT @@global.max_tmp_tables; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_tmp_tables = test; -SELECT @@global.max_tmp_tables; - -SET @@session.max_tmp_tables = 4294967296; -SELECT @@session.max_tmp_tables; -SET @@session.max_tmp_tables = -1; -SELECT @@session.max_tmp_tables; -SET @@session.max_tmp_tables = 429496729500; -SELECT @@session.max_tmp_tables; -SET @@session.max_tmp_tables = -001; -SELECT @@session.max_tmp_tables; ---Error ER_PARSE_ERROR -SET @@session.max_tmp_tables = 65530.34.; -SET @@session.max_tmp_tables = 10737418241; -SELECT @@session.max_tmp_tables; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.max_tmp_tables = test; -SELECT @@session.max_tmp_tables; - - ---echo '#------------------FN_DYNVARS_086_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_tmp_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_tmp_tables'; - ---echo '#------------------FN_DYNVARS_086_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.max_tmp_tables = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='max_tmp_tables'; - - ---echo '#------------------FN_DYNVARS_086_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_tmp_tables = TRUE; -SELECT @@global.max_tmp_tables; -SET @@global.max_tmp_tables = FALSE; -SELECT @@global.max_tmp_tables; - - ---echo '#---------------------FN_DYNVARS_086_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_tmp_tables = 20; -SELECT @@max_tmp_tables = @@global.max_tmp_tables; - - ---echo '#---------------------FN_DYNVARS_086_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@max_tmp_tables = 255; -SELECT @@max_tmp_tables = @@local.max_tmp_tables; -SELECT @@local.max_tmp_tables = @@session.max_tmp_tables; - - ---echo '#---------------------FN_DYNVARS_086_11----------------------#' -######################################################################### -# Check if max_tmp_tables can be accessed with and without @@ sign # -######################################################################### - - -SET max_tmp_tables = 102; -SELECT @@max_tmp_tables; ---Error ER_UNKNOWN_TABLE -SELECT local.max_tmp_tables; ---Error ER_UNKNOWN_TABLE -SELECT session.max_tmp_tables; ---Error ER_BAD_FIELD_ERROR -SELECT max_tmp_tables = @@session.max_tmp_tables; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_tmp_tables = @start_global_value; -SELECT @@global.max_tmp_tables; -SET @@session.max_tmp_tables = @start_session_value; -SELECT @@session.max_tmp_tables; - - -################################################### -# END OF max_tmp_tables TESTS # -################################################### - diff --git a/mysql-test/include/max_write_lock_count_basic.inc b/mysql-test/include/max_write_lock_count_basic.inc deleted file mode 100644 index 80d5b7cc747..00000000000 --- a/mysql-test/include/max_write_lock_count_basic.inc +++ /dev/null @@ -1,158 +0,0 @@ -############## mysql-test\t\max_write_lock_count_basic.test ############### -# # -# Variable Name: max_write_lock_count # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 4294967295 # -# Range:1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable max_write_lock_count # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -########################################## -# START OF max_write_lock_count TESTS # -########################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.max_write_lock_count; -SELECT @start_global_value; - - ---echo '#--------------------FN_DYNVARS_088_01-------------------------#' -############################################################ -# Display the DEFAULT value of max_write_lock_count # -############################################################ - -SET @@global.max_write_lock_count = 1000; -SET @@global.max_write_lock_count = DEFAULT; -SELECT @@global.max_write_lock_count; - - ---echo '#--------------------FN_DYNVARS_088_02-------------------------#' -############################################################ -# Check the DEFAULT value of max_write_lock_count # -############################################################ - -SET @@global.max_write_lock_count = DEFAULT; -SELECT @@global.max_write_lock_count = 4294967295; - - ---echo '#--------------------FN_DYNVARS_088_03-------------------------#' -############################################################################## -# Change the value of max_write_lock_count to a valid value for GLOBAL Scope # -############################################################################## - -SET @@global.max_write_lock_count = 1; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = 2; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = 65536; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = 4294967295; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = 4294967294; -SELECT @@global.max_write_lock_count; - - - ---echo '#------------------FN_DYNVARS_088_04-----------------------#' -################################################################ -# Change the value of max_write_lock_count to an invalid value # -################################################################ - -SET @@global.max_write_lock_count = -1024; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = 4294967296; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = -1; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = 429496729500; -SELECT @@global.max_write_lock_count; ---Error ER_PARSE_ERROR -SET @@global.max_write_lock_count = 65530.34.; -SELECT @@global.max_write_lock_count; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.max_write_lock_count = test; -SELECT @@global.max_write_lock_count; - - - ---echo '#------------------FN_DYNVARS_088_05-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.max_write_lock_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='max_write_lock_count'; - - ---echo '#------------------FN_DYNVARS_088_06-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.max_write_lock_count = TRUE; -SELECT @@global.max_write_lock_count; -SET @@global.max_write_lock_count = FALSE; -SELECT @@global.max_write_lock_count; - - ---echo '#---------------------FN_DYNVARS_088_07----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.max_write_lock_count = 20; -SELECT @@max_write_lock_count = @@global.max_write_lock_count; - - ---echo '#---------------------FN_DYNVARS_088_08----------------------#' -############################################################################### -# Check if max_write_lock_count can be accessed with and without @@ sign # -############################################################################### - - -SET @@global.max_write_lock_count = 102; -SELECT @@max_write_lock_count; ---Error ER_UNKNOWN_TABLE -SELECT local.max_write_lock_count; ---Error ER_UNKNOWN_TABLE -SELECT global.max_write_lock_count; ---Error ER_BAD_FIELD_ERROR -SELECT max_write_lock_count = @@global.max_write_lock_count; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.max_write_lock_count = @start_global_value; -SELECT @@global.max_write_lock_count; - - -################################################### -# END OF max_write_lock_count TESTS # -################################################### - diff --git a/mysql-test/include/min_examined_row_limit_basic.inc b/mysql-test/include/min_examined_row_limit_basic.inc deleted file mode 100644 index c032d4a9d6d..00000000000 --- a/mysql-test/include/min_examined_row_limit_basic.inc +++ /dev/null @@ -1,219 +0,0 @@ -############## mysql-test\t\min_examined_row_limit_basic.test ############### -# # -# Variable Name: min_examined_row_limit # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 0 # -# Range:0-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable min_examined_row_limit # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -###################################################################### -# START OF min_examined_row_limit TESTS # -###################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.min_examined_row_limit; -SELECT @start_global_value; -SET @start_session_value = @@session.min_examined_row_limit; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_089_01-------------------------#' -###################################################################### -# Display the DEFAULT value of min_examined_row_limit # -###################################################################### - -SET @@global.min_examined_row_limit = 100; -SET @@global.min_examined_row_limit = DEFAULT; -SELECT @@global.min_examined_row_limit; - -SET @@session.min_examined_row_limit = 200; -SET @@session.min_examined_row_limit = DEFAULT; -SELECT @@session.min_examined_row_limit; - - ---echo '#--------------------FN_DYNVARS_089_02-------------------------#' -######################################################################## -# Check the DEFAULT value of min_examined_row_limit # -######################################################################## - -SET @@global.min_examined_row_limit = DEFAULT; -SELECT @@global.min_examined_row_limit = 0; - -SET @@session.min_examined_row_limit = DEFAULT; -SELECT @@session.min_examined_row_limit = 0; - - ---echo '#--------------------FN_DYNVARS_089_03-------------------------#' -################################################################################ -# Change the value of min_examined_row_limit to a valid value for GLOBAL Scope # -################################################################################ - -SET @@global.min_examined_row_limit = 0; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = 1; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = 60020; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = 65535; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = 4294967295; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = 4294967294; -SELECT @@global.min_examined_row_limit; - - - ---echo '#--------------------FN_DYNVARS_089_04-------------------------#' -################################################################################### -# Change the value of min_examined_row_limit to a valid value for SESSION Scope # -################################################################################### - -SET @@session.min_examined_row_limit = 0; -SELECT @@session.min_examined_row_limit; -SET @@session.min_examined_row_limit = 1; -SELECT @@session.min_examined_row_limit; -SET @@session.min_examined_row_limit = 50050; -SELECT @@session.min_examined_row_limit; -SET @@session.min_examined_row_limit = 65535; -SELECT @@session.min_examined_row_limit; -SET @@session.min_examined_row_limit = 4294967295; -SELECT @@session.min_examined_row_limit; -SET @@session.min_examined_row_limit = 4294967294; -SELECT @@session.min_examined_row_limit; - - ---echo '#------------------FN_DYNVARS_089_05-----------------------#' -#################################################################### -# Change the value of min_examined_row_limit to an invalid value # -#################################################################### - -SET @@global.min_examined_row_limit = 429496726; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = -1024; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = 429496729500; -SELECT @@global.min_examined_row_limit; ---Error ER_PARSE_ERROR -SET @@global.min_examined_row_limit = 65530.34.; -SELECT @@global.min_examined_row_limit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.min_examined_row_limit = test; -SELECT @@global.min_examined_row_limit; - -SET @@session.min_examined_row_limit = 4294967296; -SELECT @@session.min_examined_row_limit; -SET @@session.min_examined_row_limit = -1; -SELECT @@session.min_examined_row_limit; ---Error ER_PARSE_ERROR -SET @@session.min_examined_row_limit = 65530.34.; -SET @@session.min_examined_row_limit = 4294967295021; -SELECT @@session.min_examined_row_limit; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.min_examined_row_limit = test; -SELECT @@session.min_examined_row_limit; - - ---echo '#------------------FN_DYNVARS_089_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.min_examined_row_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='min_examined_row_limit'; - ---echo '#------------------FN_DYNVARS_089_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.min_examined_row_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='min_examined_row_limit'; - - ---echo '#------------------FN_DYNVARS_089_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.min_examined_row_limit = TRUE; -SELECT @@global.min_examined_row_limit; -SET @@global.min_examined_row_limit = FALSE; -SELECT @@global.min_examined_row_limit; - - ---echo '#---------------------FN_DYNVARS_089_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.min_examined_row_limit = 10; -SELECT @@min_examined_row_limit = @@global.min_examined_row_limit; - - ---echo '#---------------------FN_DYNVARS_089_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@min_examined_row_limit = 100; -SELECT @@min_examined_row_limit = @@local.min_examined_row_limit; -SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit; - - ---echo '#---------------------FN_DYNVARS_089_11----------------------#' -################################################################################### -# Check if min_examined_row_limit can be accessed with and without @@ sign # -################################################################################### - -SET min_examined_row_limit = 1; -SELECT @@min_examined_row_limit; ---Error ER_UNKNOWN_TABLE -SELECT local.min_examined_row_limit; ---Error ER_UNKNOWN_TABLE -SELECT session.min_examined_row_limit; ---Error ER_BAD_FIELD_ERROR -SELECT min_examined_row_limit = @@session.min_examined_row_limit; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.min_examined_row_limit = @start_global_value; -SELECT @@global.min_examined_row_limit; -SET @@session.min_examined_row_limit = @start_session_value; -SELECT @@session.min_examined_row_limit; - - -############################################################# -# END OF min_examined_row_limit TESTS # -############################################################# - diff --git a/mysql-test/include/multi_range_count_basic.inc b/mysql-test/include/multi_range_count_basic.inc deleted file mode 100644 index 47e8352196f..00000000000 --- a/mysql-test/include/multi_range_count_basic.inc +++ /dev/null @@ -1,219 +0,0 @@ -############## mysql-test\t\multi_range_count_basic.test ############### -# # -# Variable Name: multi_range_count # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 256 # -# Range:1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable multi_range_count # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################# -# START OF multi_range_count TESTS # -################################################################# - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.multi_range_count; -SELECT @start_global_value; -SET @start_session_value = @@session.multi_range_count; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_090_01-------------------------#' -################################################################# -# Display the DEFAULT value of multi_range_count # -################################################################# - -SET @@global.multi_range_count = 100; -SET @@global.multi_range_count = DEFAULT; -SELECT @@global.multi_range_count; - -SET @@session.multi_range_count = 200; -SET @@session.multi_range_count = DEFAULT; -SELECT @@session.multi_range_count; - - ---echo '#--------------------FN_DYNVARS_090_02-------------------------#' -################################################################# -# Check the DEFAULT value of multi_range_count # -################################################################# - -SET @@global.multi_range_count = DEFAULT; -SELECT @@global.multi_range_count = 256; - -SET @@session.multi_range_count = DEFAULT; -SELECT @@session.multi_range_count = 256; - - ---echo '#--------------------FN_DYNVARS_090_03-------------------------#' -########################################################################### -# Change the value of multi_range_count to a valid value for GLOBAL Scope # -########################################################################### - -SET @@global.multi_range_count = 1; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = 60020; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = 65535; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = 4294967295; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = 4294967294; -SELECT @@global.multi_range_count; - - - ---echo '#--------------------FN_DYNVARS_090_04-------------------------#' -############################################################################ -# Change the value of multi_range_count to a valid value for SESSION Scope # -############################################################################ - -SET @@session.multi_range_count = 1; -SELECT @@session.multi_range_count; -SET @@session.multi_range_count = 50050; -SELECT @@session.multi_range_count; -SET @@session.multi_range_count = 65535; -SELECT @@session.multi_range_count; -SET @@session.multi_range_count = 4294967295; -SELECT @@session.multi_range_count; -SET @@session.multi_range_count = 4294967294; -SELECT @@session.multi_range_count; - - ---echo '#------------------FN_DYNVARS_090_05-----------------------#' -############################################################# -# Change the value of multi_range_count to an invalid value # -############################################################# - -SET @@global.multi_range_count = 0; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = 4294967296; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = -1024; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = 429496729500; -SELECT @@global.multi_range_count; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.multi_range_count = 65530.34; -SELECT @@global.multi_range_count; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.multi_range_count = test; -SELECT @@global.multi_range_count; - -SET @@session.multi_range_count = 0; -SELECT @@session.multi_range_count; -SET @@session.multi_range_count = 4294967296; -SELECT @@session.multi_range_count; -SET @@session.multi_range_count = -1; -SELECT @@session.multi_range_count; ---Error ER_PARSE_ERROR -SET @@session.multi_range_count = 65530.34.; -SET @@session.multi_range_count = 4294967295021; -SELECT @@session.multi_range_count; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.multi_range_count = test; -SELECT @@session.multi_range_count; - - ---echo '#------------------FN_DYNVARS_090_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.multi_range_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='multi_range_count'; - ---echo '#------------------FN_DYNVARS_090_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.multi_range_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='multi_range_count'; - - ---echo '#------------------FN_DYNVARS_090_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.multi_range_count = TRUE; -SELECT @@global.multi_range_count; -SET @@global.multi_range_count = FALSE; -SELECT @@global.multi_range_count; - - ---echo '#---------------------FN_DYNVARS_090_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.multi_range_count = 10; -SELECT @@multi_range_count = @@global.multi_range_count; - - ---echo '#---------------------FN_DYNVARS_090_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@multi_range_count = 100; -SELECT @@multi_range_count = @@local.multi_range_count; -SELECT @@local.multi_range_count = @@session.multi_range_count; - - ---echo '#---------------------FN_DYNVARS_090_11----------------------#' -############################################################################ -# Check if multi_range_count can be accessed with and without @@ sign # -############################################################################ - -SET multi_range_count = 1; -SELECT @@multi_range_count; ---Error ER_UNKNOWN_TABLE -SELECT local.multi_range_count; ---Error ER_UNKNOWN_TABLE -SELECT session.multi_range_count; ---Error ER_BAD_FIELD_ERROR -SELECT multi_range_count = @@session.multi_range_count; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.multi_range_count = @start_global_value; -SELECT @@global.multi_range_count; -SET @@session.multi_range_count = @start_session_value; -SELECT @@session.multi_range_count; - - -###################################################### -# END OF multi_range_count TESTS # -###################################################### - diff --git a/mysql-test/include/myisam_max_sort_file_size_basic.inc b/mysql-test/include/myisam_max_sort_file_size_basic.inc deleted file mode 100644 index 23f0607b439..00000000000 --- a/mysql-test/include/myisam_max_sort_file_size_basic.inc +++ /dev/null @@ -1,184 +0,0 @@ - -############## mysql-test\t\myisam_max_sort_file_size_basic.test ################ -# # -# Variable Name: myisam_max_sort_file_size # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable myisam_max_sort_file_size # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################### -# START OF myisam_max_sort_file_size TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.myisam_max_sort_file_size; -SELECT @start_global_value; - ---echo '#--------------------FN_DYNVARS_094_01-------------------------#' -################################################################### -# Display the DEFAULT value of myisam_max_sort_file_size # -################################################################### - -SET @@global.myisam_max_sort_file_size = 500000; -SET @@global.myisam_max_sort_file_size = DEFAULT; -SELECT @@global.myisam_max_sort_file_size; - ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - ---echo '#--------------------FN_DYNVARS_094_02-------------------------#' -################################################################### -# Check the DEFAULT value of myisam_max_sort_file_size # -################################################################### - -SET @@global.myisam_max_sort_file_size = DEFAULT; -SELECT @@global.myisam_max_sort_file_size = 2147483648; - ---echo '#--------------------FN_DYNVARS_094_03-------------------------#' -################################################################################## -# Change the value of myisam_max_sort_file_size to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.myisam_max_sort_file_size = 0; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = 1024; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = 123456789; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = 2147483648*2; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = 2147483648*1024; -SELECT @@global.myisam_max_sort_file_size; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = 2147483648*2147483648; - ---echo '#--------------------FN_DYNVARS_094_04-------------------------#' -################################################################################# -# Check if variable can be access with session scope # -################################################################################# - ---Error ER_GLOBAL_VARIABLE -SET @@myisam_max_sort_file_size = 2; - ---Error ER_GLOBAL_VARIABLE -SET @@session.myisam_max_sort_file_size = 3; - ---Error ER_GLOBAL_VARIABLE -SET @@local.myisam_max_sort_file_size = 4; - - - ---echo '#------------------FN_DYNVARS_094_05-----------------------#' -#################################################################### -# Change the value of myisam_max_sort_file_size to an invalid value # -#################################################################### - -SET @@global.myisam_max_sort_file_size = -1; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = -2147483648; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = -2147483649; -SELECT @@global.myisam_max_sort_file_size; ---Error ER_PARSE_ERROR -SET @@global.myisam_max_sort_file_size = 65530.34.; -SELECT @@global.myisam_max_sort_file_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_max_sort_file_size = 2147483649.56; -SELECT @@global.myisam_max_sort_file_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_max_sort_file_size = 1G; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - ---echo '#------------------FN_DYNVARS_094_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SET @@global.myisam_max_sort_file_size = 3000; -SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_max_sort_file_size'; - - ---echo '#------------------FN_DYNVARS_094_07-----------------------#' -########################################################################### -# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # -########################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_max_sort_file_size'; - - ---echo '#------------------FN_DYNVARS_094_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.myisam_max_sort_file_size = TRUE; -SELECT @@global.myisam_max_sort_file_size; -SET @@global.myisam_max_sort_file_size = FALSE; -SELECT @@global.myisam_max_sort_file_size; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - - -SET @@global.myisam_max_sort_file_size = 512; -SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################################## -# Check if myisam_max_sort_file_size can be accessed without @@ sign and scope # -################################################################################## - ---Error ER_GLOBAL_VARIABLE -SET myisam_max_sort_file_size = 2048; ---Error ER_BAD_FIELD_ERROR -SELECT myisam_max_sort_file_size; - -SELECT @@myisam_max_sort_file_size; - -#verifying another syntax for setting value# -SET global myisam_max_sort_file_size = 64; - -#################################### -# Restore initial value # -#################################### - -SET @@global.myisam_max_sort_file_size = @start_global_value; -SELECT @@global.myisam_max_sort_file_size; - -######################################################## -# END OF myisam_max_sort_file_size TESTS # -######################################################## - diff --git a/mysql-test/include/myisam_repair_threads_basic.inc b/mysql-test/include/myisam_repair_threads_basic.inc deleted file mode 100644 index 8485e79ff03..00000000000 --- a/mysql-test/include/myisam_repair_threads_basic.inc +++ /dev/null @@ -1,242 +0,0 @@ -############## mysql-test\t\myisam_repair_threads_basic.test ################## -# # -# Variable Name: myisam_repair_threads # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1 # -# Range: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable myisam_repair_threads # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -###################################################################### -# START OF myisam_repair_threads TESTS # -###################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.myisam_repair_threads; -SELECT @start_global_value; -SET @start_session_value = @@session.myisam_repair_threads; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -################################################################# -# Display the DEFAULT value of myisam_block_size # -################################################################# - -SET @@global.myisam_repair_threads = 100; -SET @@global.myisam_repair_threads = DEFAULT; -SELECT @@global.myisam_repair_threads ; - -SET @@session.myisam_repair_threads = 200; -SET @@session.myisam_repair_threads = DEFAULT; -SELECT @@session.myisam_repair_threads ; - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -###################################################################### -# Check the DEFAULT value of myisam_repair_threads # -###################################################################### - -SET @@global.myisam_repair_threads = DEFAULT; -SELECT @@global.myisam_repair_threads = 1; - -SET @@session.myisam_repair_threads = DEFAULT; -SELECT @@session.myisam_repair_threads = 1; - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -############################################################################### -# Change the value of myisam_repair_threads to a valid value for GLOBAL Scope# -############################################################################### - -SET @@global.myisam_repair_threads = 1; -SELECT @@global.myisam_repair_threads ; - -SET @@global.myisam_repair_threads = 4294967295; -SELECT @@global.myisam_repair_threads ; - -SET @@global.myisam_repair_threads = 655354; -SELECT @@global.myisam_repair_threads ; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -############################################################################### -# Change the value of myisam_repair_threads to a valid value for SESSION -# Scope -############################################################################### - -SET @@session.myisam_repair_threads = 1; -SELECT @@session.myisam_repair_threads ; - -SET @@session.myisam_repair_threads = 4294967295; -SELECT @@session.myisam_repair_threads ; - -SET @@session.myisam_repair_threads = 655345; -SELECT @@session.myisam_repair_threads ; - - - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -################################################################## -# Change the value of myisam_repair_threads to an invalid value # -################################################################## - -SET @@global.myisam_repair_threads = 0; -SELECT @@global.myisam_repair_threads ; - -SET @@global.myisam_repair_threads = -1024; -SELECT @@global.myisam_repair_threads ; - -SET @@global.myisam_repair_threads = 429496729533; -SELECT @@global.myisam_repair_threads ; - - ---Error ER_PARSE_ERROR -SET @@global.myisam_repair_threads = 65530.34.; -SELECT @@global.myisam_repair_threads ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_repair_threads = test; -SELECT @@global.myisam_repair_threads ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_repair_threads = "test"; -SELECT @@global.myisam_repair_threads ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_repair_threads = 'test'; -SELECT @@global.myisam_repair_threads ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_repair_threads = ON; -SELECT @@global.myisam_repair_threads ; - - -SET @@session.myisam_repair_threads = 0; -SELECT @@session.myisam_repair_threads ; - -SET @@session.myisam_repair_threads = -2; -SELECT @@session.myisam_repair_threads ; - ---Error ER_PARSE_ERROR - -SET @@session.myisam_repair_threads = 65530.34.; -SELECT @@session.myisam_repair_threads ; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.myisam_repair_threads = test; -SELECT @@session.myisam_repair_threads ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.myisam_repair_threads = "test"; -SELECT @@session.myisam_repair_threads ; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.myisam_repair_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_repair_threads '; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.myisam_repair_threads = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_repair_threads '; - - ---echo '#------------------FN_DYNVARS_005_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.myisam_repair_threads = TRUE; -SELECT @@global.myisam_repair_threads ; -SET @@global.myisam_repair_threads = FALSE; -SELECT @@global.myisam_repair_threads ; - - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -############################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -############################################################################### - -SET @@global.myisam_repair_threads = 10; -SELECT @@myisam_repair_threads = @@global.myisam_repair_threads ; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to -# same session variable # -######################################################################################################## - -SET @@myisam_repair_threads = 100; -SELECT @@myisam_repair_threads = @@local.myisam_repair_threads ; -SELECT @@local.myisam_repair_threads = @@session.myisam_repair_threads ; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -################################################################################### -# Check if myisam_repair_threads can be accessed with and without @@ sign # -################################################################################### - -SET myisam_repair_threads = 1; -SELECT @@myisam_repair_threads ; ---Error ER_UNKNOWN_TABLE - -SELECT local.myisam_repair_threads ; - ---Error ER_UNKNOWN_TABLE -SELECT session.myisam_repair_threads ; - ---Error ER_BAD_FIELD_ERROR -SELECT myisam_repair_threads = @@session.myisam_repair_threads ; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.myisam_repair_threads = @start_global_value; -SELECT @@global.myisam_repair_threads ; -SET @@session.myisam_repair_threads = @start_session_value; -SELECT @@session.myisam_repair_threads ; - - -############################################################# -# END OF myisam_repair_threads TESTS # -############################################################# - diff --git a/mysql-test/include/myisam_sort_buffer_size_basic.inc b/mysql-test/include/myisam_sort_buffer_size_basic.inc deleted file mode 100644 index 8e36d8a2c70..00000000000 --- a/mysql-test/include/myisam_sort_buffer_size_basic.inc +++ /dev/null @@ -1,240 +0,0 @@ -############## mysql-test\t\myisam_sort_buffer_size_basic.test ############### -# # -# Variable Name: myisam_sort_buffer_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable myisam_sort_buffer_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF myisam_sort_buffer_size TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.myisam_sort_buffer_size ; -SELECT @start_global_value; -SET @start_session_value = @@session.myisam_sort_buffer_size ; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -######################################################################## -# Display the DEFAULT value of myisam_block_size # -######################################################################## - -SET @@global.myisam_sort_buffer_size = 100; -SET @@global.myisam_sort_buffer_size = DEFAULT; -SELECT @@global.myisam_sort_buffer_size ; - -SET @@session.myisam_sort_buffer_size = 200; -SET @@session.myisam_sort_buffer_size = DEFAULT; -SELECT @@session.myisam_sort_buffer_size ; - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of myisam_sort_buffer_size # -######################################################################## - -SET @@global.myisam_sort_buffer_size = DEFAULT; -SELECT @@global.myisam_sort_buffer_size = 8388608; - -SET @@session.myisam_sort_buffer_size = DEFAULT; -SELECT @@session.myisam_sort_buffer_size = 8388608; - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################################## -# Change the value of myisam_sort_buffer_size to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.myisam_sort_buffer_size = 4; -SELECT @@global.myisam_sort_buffer_size ; - -SET @@global.myisam_sort_buffer_size = 4294967295; -SELECT @@global.myisam_sort_buffer_size ; - -SET @@global.myisam_sort_buffer_size = 655354; -SELECT @@global.myisam_sort_buffer_size ; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################################### -# Change the value of myisam_sort_buffer_size to a valid value for SESSION Scope # -################################################################################### - -SET @@session.myisam_sort_buffer_size = 4; -SELECT @@session.myisam_sort_buffer_size ; - -SET @@session.myisam_sort_buffer_size = 4294967295; -SELECT @@session.myisam_sort_buffer_size ; - -SET @@session.myisam_sort_buffer_size = 655345; -SELECT @@session.myisam_sort_buffer_size ; - - - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -#################################################################### -# Change the value of myisam_sort_buffer_size to an invalid value # -#################################################################### - -SET @@global.myisam_sort_buffer_size = 0; -SELECT @@global.myisam_sort_buffer_size ; - -SET @@global.myisam_sort_buffer_size = -1024; -SELECT @@global.myisam_sort_buffer_size ; - -SET @@global.myisam_sort_buffer_size = 429496729533; -SELECT @@global.myisam_sort_buffer_size ; - - ---Error ER_PARSE_ERROR -SET @@global.myisam_sort_buffer_size = 65530.34.; -SELECT @@global.myisam_sort_buffer_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_sort_buffer_size = test; -SELECT @@global.myisam_sort_buffer_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_sort_buffer_size = "test"; -SELECT @@global.myisam_sort_buffer_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_sort_buffer_size = 'test'; -SELECT @@global.myisam_sort_buffer_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.myisam_sort_buffer_size = ON; -SELECT @@global.myisam_sort_buffer_size ; - - -SET @@session.myisam_sort_buffer_size = 0; -SELECT @@session.myisam_sort_buffer_size ; - -SET @@session.myisam_sort_buffer_size = -2; -SELECT @@session.myisam_sort_buffer_size ; - ---Error ER_PARSE_ERROR - -SET @@session.myisam_sort_buffer_size = 65530.34.; -SELECT @@session.myisam_sort_buffer_size ; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.myisam_sort_buffer_size = test; -SELECT @@session.myisam_sort_buffer_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.myisam_sort_buffer_size = "test"; -SELECT @@session.myisam_sort_buffer_size ; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='myisam_sort_buffer_size '; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='myisam_sort_buffer_size '; - - ---echo '#------------------FN_DYNVARS_005_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.myisam_sort_buffer_size = TRUE; -SELECT @@global.myisam_sort_buffer_size ; -SET @@global.myisam_sort_buffer_size = FALSE; -SELECT @@global.myisam_sort_buffer_size ; - - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.myisam_sort_buffer_size = 10; -SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@myisam_sort_buffer_size = 100; -SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; -SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -################################################################################### -# Check if myisam_sort_buffer_size can be accessed with and without @@ sign # -################################################################################### - -SET myisam_sort_buffer_size = 1; -SELECT @@myisam_sort_buffer_size ; ---Error ER_UNKNOWN_TABLE - -SELECT local.myisam_sort_buffer_size ; - ---Error ER_UNKNOWN_TABLE -SELECT session.myisam_sort_buffer_size ; - ---Error ER_BAD_FIELD_ERROR -SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.myisam_sort_buffer_size = @start_global_value; -SELECT @@global.myisam_sort_buffer_size ; -SET @@session.myisam_sort_buffer_size = @start_session_value; -SELECT @@session.myisam_sort_buffer_size ; - - -############################################################# -# END OF myisam_sort_buffer_size TESTS # -############################################################# - diff --git a/mysql-test/include/net_retry_count_basic.inc b/mysql-test/include/net_retry_count_basic.inc deleted file mode 100644 index 537d8eea6c6..00000000000 --- a/mysql-test/include/net_retry_count_basic.inc +++ /dev/null @@ -1,217 +0,0 @@ -############## mysql-test\t\net_retry_count_basic.test ############### -# # -# Variable Name: net_retry_count # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:10 # -# Range: 1-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable net_retry_count # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -############################################################### -# START OF net_retry_count TESTS # -############################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.net_retry_count; -SELECT @start_global_value; -SET @start_session_value = @@session.net_retry_count; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_111_01-------------------------#' -############################################################### -# Display the DEFAULT value of net_retry_count # -############################################################### - -SET @@global.net_retry_count = 100; -SET @@global.net_retry_count = DEFAULT; -SELECT @@global.net_retry_count; - -SET @@session.net_retry_count = 200; -SET @@session.net_retry_count = DEFAULT; -SELECT @@session.net_retry_count; - - ---echo '#--------------------FN_DYNVARS_111_02-------------------------#' -############################################################### -# Check the DEFAULT value of net_retry_count # -############################################################### - -SET @@global.net_retry_count = DEFAULT; -SELECT @@global.net_retry_count = 10; - -SET @@session.net_retry_count = DEFAULT; -SELECT @@session.net_retry_count = 10; - - ---echo '#--------------------FN_DYNVARS_111_03-------------------------#' -######################################################################### -# Change the value of net_retry_count to a valid value for GLOBAL Scope # -######################################################################### - -SET @@global.net_retry_count = 1; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = 2; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = 4294967295; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = 4294967294; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = 65536; -SELECT @@global.net_retry_count; - ---echo '#--------------------FN_DYNVARS_111_04-------------------------#' -########################################################################## -# Change the value of net_retry_count to a valid value for SESSION Scope # -########################################################################## - -SET @@session.net_retry_count = 1; -SELECT @@session.net_retry_count; -SET @@session.net_retry_count = 2; -SELECT @@session.net_retry_count; -SET @@session.net_retry_count = 65535; -SELECT @@session.net_retry_count; -SET @@session.net_retry_count = 4294967295; -SELECT @@session.net_retry_count; -SET @@session.net_retry_count = 4294967294; -SELECT @@session.net_retry_count; - ---echo '#------------------FN_DYNVARS_111_05-----------------------#' -########################################################### -# Change the value of net_retry_count to an invalid value # -########################################################### - -SET @@global.net_retry_count = 0; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = -1024; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = 4294967296; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = 429496729500; -SELECT @@global.net_retry_count; ---Error ER_PARSE_ERROR -SET @@global.net_retry_count = 65530.34.; -SELECT @@global.net_retry_count; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.net_retry_count = test; -SELECT @@global.net_retry_count; - -SET @@session.net_retry_count = 0; -SELECT @@session.net_retry_count; -SET @@session.net_retry_count = -2; -SELECT @@session.net_retry_count; ---Error ER_PARSE_ERROR -SET @@session.net_retry_count = 65530.34.; -SET @@session.net_retry_count = 6555015425; -SELECT @@session.net_retry_count; -SET @@session.net_retry_count = 4294967296; -SELECT @@session.net_retry_count; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.net_retry_count = test; -SELECT @@session.net_retry_count; - - ---echo '#------------------FN_DYNVARS_111_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.net_retry_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='net_retry_count'; - ---echo '#------------------FN_DYNVARS_111_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.net_retry_count = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='net_retry_count'; - - ---echo '#------------------FN_DYNVARS_111_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.net_retry_count = TRUE; -SELECT @@global.net_retry_count; -SET @@global.net_retry_count = FALSE; -SELECT @@global.net_retry_count; - - ---echo '#---------------------FN_DYNVARS_111_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.net_retry_count = 10; -SELECT @@net_retry_count = @@global.net_retry_count; - - ---echo '#---------------------FN_DYNVARS_111_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@net_retry_count = 100; -SELECT @@net_retry_count = @@local.net_retry_count; -SELECT @@local.net_retry_count = @@session.net_retry_count; - - ---echo '#---------------------FN_DYNVARS_111_11----------------------#' -########################################################################## -# Check if net_retry_count can be accessed with and without @@ sign # -########################################################################## - -SET net_retry_count = 1; -SELECT @@net_retry_count; ---Error ER_UNKNOWN_TABLE -SELECT local.net_retry_count; ---Error ER_UNKNOWN_TABLE -SELECT session.net_retry_count; ---Error ER_BAD_FIELD_ERROR -SELECT net_retry_count = @@session.net_retry_count; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.net_retry_count = @start_global_value; -SELECT @@global.net_retry_count; -SET @@session.net_retry_count = @start_session_value; -SELECT @@session.net_retry_count; - - -#################################################### -# END OF net_retry_count TESTS # -#################################################### - diff --git a/mysql-test/include/query_alloc_block_size_basic.inc b/mysql-test/include/query_alloc_block_size_basic.inc deleted file mode 100644 index 208fe6b3da4..00000000000 --- a/mysql-test/include/query_alloc_block_size_basic.inc +++ /dev/null @@ -1,225 +0,0 @@ -############## mysql-test\t\query_alloc_block_size_basic.test ############### -# # -# Variable Name: query_alloc_block_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 8192 # -# Range: 1024-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable query_alloc_block_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################### -# START OF query_alloc_block_size TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.query_alloc_block_size; -SELECT @start_global_value; -SET @start_session_value = @@session.query_alloc_block_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_130_01-------------------------#' -################################################################### -# Display the DEFAULT value of query_alloc_block_size # -################################################################### - -SET @@global.query_alloc_block_size = 10000; -SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size; - -SET @@session.query_alloc_block_size = 20000; -SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size; - - ---echo '#--------------------FN_DYNVARS_130_02-------------------------#' -################################################################### -# Check the DEFAULT value of query_alloc_block_size # -################################################################### - -SET @@global.query_alloc_block_size = DEFAULT; -SELECT @@global.query_alloc_block_size = 8192; - -SET @@session.query_alloc_block_size = DEFAULT; -SELECT @@session.query_alloc_block_size = 8192; - - ---echo '#--------------------FN_DYNVARS_130_03-------------------------#' -############################################################################# -# Change the value of query_alloc_block_size to a valid value for GLOBAL Scope # -############################################################################# - -SET @@global.query_alloc_block_size = 1024; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = 1025; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = 4294967295; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = 4294967294; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = 65536; -SELECT @@global.query_alloc_block_size; - ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_130_04-------------------------#' -################################################################################# -# Change the value of query_alloc_block_size to a valid value for SESSION Scope # -################################################################################# - -SET @@session.query_alloc_block_size = 1024; -SELECT @@session.query_alloc_block_size; -SET @@session.query_alloc_block_size = 1025; -SELECT @@session.query_alloc_block_size; -SET @@session.query_alloc_block_size = 4294967295; -SELECT @@session.query_alloc_block_size; -SET @@session.query_alloc_block_size = 4294967294; -SELECT @@session.query_alloc_block_size; -SET @@session.query_alloc_block_size = 655536; -SELECT @@session.query_alloc_block_size; - ---echo '#------------------FN_DYNVARS_130_05-----------------------#' -################################################################## -# Change the value of query_alloc_block_size to an invalid value # -################################################################## - -SET @@global.query_alloc_block_size = 64; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = -1; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = 1023; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = 4294967296; -SELECT @@global.query_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@global.query_alloc_block_size = 65530.34.; -SELECT @@global.query_alloc_block_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_alloc_block_size = test; -SELECT @@global.query_alloc_block_size; - -SET @@session.query_alloc_block_size = 64; -SELECT @@session.query_alloc_block_size; -SET @@session.query_alloc_block_size = -2; -SELECT @@session.query_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@session.query_alloc_block_size = 65530.34.; -SET @@session.query_alloc_block_size = 1023; -SELECT @@session.query_alloc_block_size; -SET @@session.query_alloc_block_size = 4294967296; -SELECT @@session.query_alloc_block_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.query_alloc_block_size = test; -SELECT @@session.query_alloc_block_size; - ---echo '#------------------FN_DYNVARS_130_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -#SET @@global.query_alloc_block_size = 1; -#SET @@session.query_alloc_block_size = 12; ---echo 'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement'; - -SET @@global.query_alloc_block_size = 1; -SET @@session.query_alloc_block_size = 12; - -SELECT @@global.query_alloc_block_size = -VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_alloc_block_size'; - - ---echo '#------------------FN_DYNVARS_130_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.query_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_alloc_block_size'; - - ---echo '#------------------FN_DYNVARS_130_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.query_alloc_block_size = TRUE; -SELECT @@global.query_alloc_block_size; -SET @@global.query_alloc_block_size = FALSE; -SELECT @@global.query_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_130_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - -SET @@global.query_alloc_block_size = 2048; -SELECT @@query_alloc_block_size = @@global.query_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_130_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@query_alloc_block_size = 5000; -SELECT @@query_alloc_block_size = @@local.query_alloc_block_size; -SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_130_11----------------------#' -############################################################################## -# Check if query_alloc_block_size can be accessed with and without @@ sign # -############################################################################## - -SET query_alloc_block_size = 1024; -SELECT @@query_alloc_block_size; ---Error ER_UNKNOWN_TABLE -SELECT local.query_alloc_block_size; ---Error ER_UNKNOWN_TABLE -SELECT session.query_alloc_block_size; ---Error ER_BAD_FIELD_ERROR -SELECT query_alloc_block_size = @@session.query_alloc_block_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.query_alloc_block_size = @start_global_value; -SELECT @@global.query_alloc_block_size; -SET @@session.query_alloc_block_size = @start_session_value; -SELECT @@session.query_alloc_block_size; - - -######################################################## -# END OF query_alloc_block_size TESTS # -######################################################## - diff --git a/mysql-test/include/query_cache_limit_basic.inc b/mysql-test/include/query_cache_limit_basic.inc deleted file mode 100644 index 2eb4a597eef..00000000000 --- a/mysql-test/include/query_cache_limit_basic.inc +++ /dev/null @@ -1,178 +0,0 @@ -############## mysql-test\t\query_cache_limit_basic.test ############### -# # -# Variable Name: query_cache_limit # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 1048576 # -# Min value: 0 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable query_cache_limit # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_query_cache.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF query_cache_limit TESTS # -######################################################################## - - -######################################################################## -# Saving initial value of query_cache_limit in a temporary variable # -######################################################################## - -SET @start_value = @@global.query_cache_limit; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_131_01------------------------#' -######################################################################## -# Display the DEFAULT value of query_cache_limit # -######################################################################## - -SET @@global.query_cache_limit = 99; -SET @@global.query_cache_limit = DEFAULT; -SELECT @@global.query_cache_limit; - - ---echo '#---------------------FN_DYNVARS_131_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.query_cache_limit = @start_value; -SELECT @@global.query_cache_limit = 1048576; - - ---echo '#--------------------FN_DYNVARS_131_03------------------------#' -######################################################################## -# Change the value of query_cache_limit to a valid value # -######################################################################## - -SET @@global.query_cache_limit = 0; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = 1; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = 1048576; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = 1048575; -SELECT @@global.query_cache_limit; - - ---echo '#--------------------FN_DYNVARS_131_04-------------------------#' -########################################################################### -# Change the value of query_cache_limit to invalid value # -########################################################################### - -SET @@global.query_cache_limit = -1; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = 4294967296; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = 10240022115; -SELECT @@global.query_cache_limit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_limit = 10000.01; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = -1024; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = 42949672950; -SELECT @@global.query_cache_limit; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_limit = ON; -SELECT @@global.query_cache_limit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_limit = 'test'; -SELECT @@global.query_cache_limit; - - ---echo '#-------------------FN_DYNVARS_131_05----------------------------#' -########################################################################### -# Test if accessing session query_cache_limit gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.query_cache_limit = 0; -SELECT @@query_cache_limit; - - ---echo '#----------------------FN_DYNVARS_131_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.query_cache_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_limit'; - -SELECT @@query_cache_limit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_limit'; - - ---echo '#---------------------FN_DYNVARS_131_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.query_cache_limit = TRUE; -SELECT @@global.query_cache_limit; -SET @@global.query_cache_limit = FALSE; -SELECT @@global.query_cache_limit; - - ---echo '#---------------------FN_DYNVARS_131_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.query_cache_limit = 1; -SELECT @@query_cache_limit = @@global.query_cache_limit; - - ---echo '#---------------------FN_DYNVARS_131_09----------------------#' -########################################################################## -# Check if query_cache_limit can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET query_cache_limit = 1; -SELECT @@query_cache_limit; ---Error ER_PARSE_ERROR -SET local.query_cache_limit = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.query_cache_limit; ---Error ER_PARSE_ERROR -SET global.query_cache_limit = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.query_cache_limit; ---Error ER_BAD_FIELD_ERROR -SELECT query_cache_limit = @@session.query_cache_limit; - - -############################## -# Restore initial value # -############################## - -SET @@global.query_cache_limit = @start_value; -SELECT @@global.query_cache_limit; - - -######################################################################## -# END OF query_cache_limit TESTS # -######################################################################## diff --git a/mysql-test/include/query_cache_min_res_unit_basic.inc b/mysql-test/include/query_cache_min_res_unit_basic.inc deleted file mode 100644 index 1b65e035b18..00000000000 --- a/mysql-test/include/query_cache_min_res_unit_basic.inc +++ /dev/null @@ -1,187 +0,0 @@ -############## mysql-test\t\query_cache_min_res_unit_basic.test ############### -# # -# Variable Name: query_cache_min_res_unit # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:1024 # -# Min Value:0 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable query_cache_min_res_unit # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_query_cache.inc ---source include/load_sysvars.inc - -######################################################################## - - -######################################################################## -# START OF query_cache_min_res_unit TESTS # -######################################################################## - - -############################################################################### -# Saving initial value of query_cache_min_res_unit in a temporary variable # -############################################################################### - -SET @start_value = @@global.query_cache_min_res_unit; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_132_01------------------------#' -############################################################################### -# Display the DEFAULT value of query_cache_min_res_unit # -############################################################################### - -SET @@global.query_cache_min_res_unit = 99; -SET @@global.query_cache_min_res_unit = DEFAULT; -SELECT @@global.query_cache_min_res_unit; - - ---echo '#---------------------FN_DYNVARS_132_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.query_cache_min_res_unit = @start_value; -SELECT @@global.query_cache_min_res_unit = 4096; - - ---echo '#--------------------FN_DYNVARS_132_03------------------------#' -################################################################################ -# Change the value of query_cache_min_res_unit to a valid value # -################################################################################ - -SET @@global.query_cache_min_res_unit = 0; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = 1; -SELECT @@global.query_cache_min_res_unit; ---echo 'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512'; -SET @@global.query_cache_min_res_unit = 512; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = 513; -SELECT @@global.query_cache_min_res_unit; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.query_cache_min_res_unit = 1048576; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = 1048575; -SELECT @@global.query_cache_min_res_unit; - - ---echo '#--------------------FN_DYNVARS_132_04-------------------------#' -################################################################################### -# Change the value of query_cache_min_res_unit to invalid value # -################################################################################### - -SET @@global.query_cache_min_res_unit = -1; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = 4294967296; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = 511; -SELECT @@global.query_cache_min_res_unit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_min_res_unit = 10000.01; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = -1024; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = 42949672950; -SELECT @@global.query_cache_min_res_unit; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_min_res_unit = ON; -SELECT @@global.query_cache_min_res_unit; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_min_res_unit = 'test'; -SELECT @@global.query_cache_min_res_unit; - - ---echo '#-------------------FN_DYNVARS_132_05----------------------------#' -################################################################################### -# Test if accessing session query_cache_min_res_unit gives error # -################################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.query_cache_min_res_unit = 0; -SELECT @@query_cache_min_res_unit; - - ---echo '#----------------------FN_DYNVARS_132_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_min_res_unit'; - -SELECT @@query_cache_min_res_unit = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_min_res_unit'; - - ---echo '#---------------------FN_DYNVARS_132_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.query_cache_min_res_unit = TRUE; -SELECT @@global.query_cache_min_res_unit; -SET @@global.query_cache_min_res_unit = FALSE; -SELECT @@global.query_cache_min_res_unit; - - ---echo '#---------------------FN_DYNVARS_132_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.query_cache_min_res_unit = 1; -SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit; - - ---echo '#---------------------FN_DYNVARS_132_09----------------------#' -################################################################################## -# Check if query_cache_min_res_unit can be accessed with and without @@ sign # -################################################################################## - ---Error ER_GLOBAL_VARIABLE -SET query_cache_min_res_unit = 1; -SELECT @@query_cache_min_res_unit; ---Error ER_PARSE_ERROR -SET local.query_cache_min_res_unit = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.query_cache_min_res_unit; ---Error ER_PARSE_ERROR -SET global.query_cache_min_res_unit = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.query_cache_min_res_unit; ---Error ER_BAD_FIELD_ERROR -SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit; - - -############################## -# Restore initial value # -############################## - -SET @@global.query_cache_min_res_unit = @start_value; -SELECT @@global.query_cache_min_res_unit; - - -######################################################################## -# END OF query_cache_min_res_unit TESTS # -######################################################################## diff --git a/mysql-test/include/query_cache_size_basic.inc b/mysql-test/include/query_cache_size_basic.inc deleted file mode 100644 index 1a3f9e1efe2..00000000000 --- a/mysql-test/include/query_cache_size_basic.inc +++ /dev/null @@ -1,175 +0,0 @@ -############## mysql-test\t\query_cache_size_basic.test ############### -# # -# Variable Name: query_cache_size # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 0 # -# Range: - # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable query_cache_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/have_query_cache.inc ---source include/load_sysvars.inc - -######################################################################## -# START OF query_cache_size TESTS # -######################################################################## - - -############################################################################### -# Saving initial value of query_cache_size in a temporary variable # -############################################################################### - -SET @start_value = @@global.query_cache_size; -SELECT @start_value; - ---echo '#--------------------FN_DYNVARS_133_01------------------------#' -############################################################################### -# Display the DEFAULT value of query_cache_size # -############################################################################### - -SET @@global.query_cache_size = 99; -SET @@global.query_cache_size = DEFAULT; -SELECT @@global.query_cache_size; - ---echo '#---------------------FN_DYNVARS_133_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.query_cache_size = @start_value; -SELECT @@global.query_cache_size = 0; - ---echo '#--------------------FN_DYNVARS_133_03------------------------#' -################################################################################ -# Change the value of query_cache_size to a valid value # -################################################################################ - -SET @@global.query_cache_size = 0; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = 1; -SELECT @@global.query_cache_size; - -SET @@global.query_cache_size = 512; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = 1024; -SELECT @@global.query_cache_size; ---echo : 'Bug#34880: Warnings are coming on assinging valid values to variable ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.query_cache_size = 1048576; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = 1048575; -SELECT @@global.query_cache_size; - ---echo '#--------------------FN_DYNVARS_133_04-------------------------#' -################################################################################### -# Change the value of query_cache_size to invalid value # -################################################################################### - -SET @@global.query_cache_size = -1; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = 4294967296; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = 511; -SELECT @@global.query_cache_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_size = 10000.01; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = -1024; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = 42949672950; -SELECT @@global.query_cache_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_size = ON; -SELECT @@global.query_cache_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_cache_size = 'test'; -SELECT @@global.query_cache_size; - ---echo '#-------------------FN_DYNVARS_133_05----------------------------#' -################################################################################### -# Test if accessing session query_cache_size gives error # -################################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.query_cache_size = 0; -SELECT @@query_cache_size; - ---echo '#----------------------FN_DYNVARS_133_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.query_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; - -SELECT @@query_cache_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_cache_size'; - ---echo '#---------------------FN_DYNVARS_133_07----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -SET @@global.query_cache_size = TRUE; -SELECT @@global.query_cache_size; -SET @@global.query_cache_size = FALSE; -SELECT @@global.query_cache_size; - ---echo '#---------------------FN_DYNVARS_133_08----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@global.query_cache_size = 1; -SELECT @@query_cache_size = @@global.query_cache_size; - ---echo '#---------------------FN_DYNVARS_133_09----------------------#' -################################################################################## -# Check if query_cache_size can be accessed with and without @@ sign # -################################################################################## - ---Error ER_GLOBAL_VARIABLE -SET query_cache_size = 1; -SELECT @@query_cache_size; ---Error ER_PARSE_ERROR -SET local.query_cache_size = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.query_cache_size; ---Error ER_PARSE_ERROR -SET global.query_cache_size = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.query_cache_size; ---Error ER_BAD_FIELD_ERROR -SELECT query_cache_size = @@session.query_cache_size; - -############################## -# Restore initial value # -############################## - -SET @@global.query_cache_size = @start_value; -SELECT @@global.query_cache_size; - -######################################################################## -# END OF query_cache_size TESTS # -######################################################################## - diff --git a/mysql-test/include/query_prealloc_size_basic.inc b/mysql-test/include/query_prealloc_size_basic.inc deleted file mode 100644 index ac005b696fa..00000000000 --- a/mysql-test/include/query_prealloc_size_basic.inc +++ /dev/null @@ -1,247 +0,0 @@ -################# mysql-test\t\query_prealloc_size_basic.test ################## -# # -# Variable Name: query_prealloc_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 8192 # -# Range: 8192-4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable query_prealloc_size # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: # -# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # -# # -# Last Modification: # -# 2008-07-14 hhunger removed values for 64 bit platforms. # -# # -################################################################################ - ---source include/load_sysvars.inc - -######################################################################## -# START OF query_prealloc_size TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.query_prealloc_size ; -SELECT @start_global_value; -SET @start_session_value = @@session.query_prealloc_size ; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -######################################################################## -# Display the DEFAULT value of myisam_block_size # -######################################################################## - -SET @@global.query_prealloc_size = 100; -SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size ; - -SET @@session.query_prealloc_size = 200; -SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size ; - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of query_prealloc_size # -######################################################################## - -SET @@global.query_prealloc_size = DEFAULT; -SELECT @@global.query_prealloc_size = 8192; - -SET @@session.query_prealloc_size = DEFAULT; -SELECT @@session.query_prealloc_size = 8192; - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################################ -# Change the value of query_prealloc_size to a valid value for GLOBAL Scope # -################################################################################ - -SET @@global.query_prealloc_size = 8192; -SELECT @@global.query_prealloc_size ; - -# Due to problems with 64 bit machines having less than 6 GB main memory. -#SET @@global.query_prealloc_size = 4294967295; -#SELECT @@global.query_prealloc_size ; - -SET @@global.query_prealloc_size = 655354; -SELECT @@global.query_prealloc_size ; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################################## -# Change the value of query_prealloc_size to a valid value for SESSION Scope # -################################################################################## - -SET @@session.query_prealloc_size = 8192; -SELECT @@session.query_prealloc_size ; - -# Due to problems with 64 bit machines having less than 6 GB main memory. -#SET @@session.query_prealloc_size = 4294967295; -#SELECT @@session.query_prealloc_size ; - -SET @@session.query_prealloc_size = 655345; -SELECT @@session.query_prealloc_size ; - - - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -#################################################################### -# Change the value of query_prealloc_size to an invalid value # -#################################################################### - -SET @@global.query_prealloc_size = 0; -SELECT @@global.query_prealloc_size ; - -SET @@global.query_prealloc_size = -1024; -SELECT @@global.query_prealloc_size ; - -# Due to problems with 64 bit machines having less than 6 GB main memory. -#SET @@global.query_prealloc_size = 429496729533; -#SELECT @@global.query_prealloc_size ; - - ---Error ER_PARSE_ERROR -SET @@global.query_prealloc_size = 65530.34.; -SELECT @@global.query_prealloc_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_prealloc_size = test; -SELECT @@global.query_prealloc_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_prealloc_size = "test"; -SELECT @@global.query_prealloc_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_prealloc_size = 'test'; -SELECT @@global.query_prealloc_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.query_prealloc_size = ON; -SELECT @@global.query_prealloc_size ; - - -SET @@session.query_prealloc_size = 0; -SELECT @@session.query_prealloc_size ; - -SET @@session.query_prealloc_size = -2; -SELECT @@session.query_prealloc_size ; - ---Error ER_PARSE_ERROR - -SET @@session.query_prealloc_size = 65530.34.; -SELECT @@session.query_prealloc_size ; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.query_prealloc_size = test; -SELECT @@session.query_prealloc_size ; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.query_prealloc_size = "test"; -SELECT @@session.query_prealloc_size ; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='query_prealloc_size '; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.query_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='query_prealloc_size '; - - ---echo '#------------------FN_DYNVARS_005_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.query_prealloc_size = TRUE; -SELECT @@global.query_prealloc_size ; -SET @@global.query_prealloc_size = FALSE; -SELECT @@global.query_prealloc_size ; - - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################ -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################ - -SET @@global.query_prealloc_size = 10; -SELECT @@query_prealloc_size = @@global.query_prealloc_size ; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to # -# to the same session variable # -############################################################################## - -SET @@query_prealloc_size = 100; -SELECT @@query_prealloc_size = @@local.query_prealloc_size ; -SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -################################################################################ -# Check if query_prealloc_size can be accessed with and without @@ sign # -################################################################################ - -SET query_prealloc_size = 1; -SELECT @@query_prealloc_size ; ---Error ER_UNKNOWN_TABLE - -SELECT local.query_prealloc_size ; - ---Error ER_UNKNOWN_TABLE -SELECT session.query_prealloc_size ; - ---Error ER_BAD_FIELD_ERROR -SELECT query_prealloc_size = @@session.query_prealloc_size ; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.query_prealloc_size = @start_global_value; -SELECT @@global.query_prealloc_size ; -SET @@session.query_prealloc_size = @start_session_value; -SELECT @@session.query_prealloc_size ; - - -############################################################# -# END OF query_prealloc_size TESTS # -############################################################# - diff --git a/mysql-test/include/range_alloc_block_size_basic.inc b/mysql-test/include/range_alloc_block_size_basic.inc deleted file mode 100644 index 37692cc8c35..00000000000 --- a/mysql-test/include/range_alloc_block_size_basic.inc +++ /dev/null @@ -1,208 +0,0 @@ -############## mysql-test\t\range_alloc_block_size_basic.test ############### -# # -# Variable Name: range_alloc_block_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value:2048 # -# Max value: 4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable range_alloc_block_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -###################################################################### -# START OF range_alloc_block_size TESTS # -###################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.range_alloc_block_size; -SELECT @start_global_value; -SET @start_session_value = @@session.range_alloc_block_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_137_01-------------------------#' -###################################################################### -# Display the DEFAULT value of range_alloc_block_size # -###################################################################### - -SET @@global.range_alloc_block_size = 100; -SET @@global.range_alloc_block_size = DEFAULT; -SELECT @@global.range_alloc_block_size; - -SET @@session.range_alloc_block_size = 200; -SET @@session.range_alloc_block_size = DEFAULT; -SELECT @@session.range_alloc_block_size; - - ---echo '#--------------------FN_DYNVARS_137_02-------------------------#' -###################################################################### -# Check the DEFAULT value of range_alloc_block_size # -###################################################################### - -SET @@global.range_alloc_block_size = DEFAULT; -SELECT @@global.range_alloc_block_size = 2048; - -SET @@session.range_alloc_block_size = DEFAULT; -SELECT @@session.range_alloc_block_size = 2048; - - ---echo '#--------------------FN_DYNVARS_137_03-------------------------#' -################################################################################ -# Change the value of range_alloc_block_size to a valid value for GLOBAL Scope # -################################################################################ - -SET @@global.range_alloc_block_size = 2048; -SELECT @@global.range_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; -SET @@global.range_alloc_block_size = 4294967295; -SELECT @@global.range_alloc_block_size; -SET @@global.range_alloc_block_size = 4294967294; -SELECT @@global.range_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#--------------------FN_DYNVARS_137_04-------------------------#' -################################################################################### -# Change the value of range_alloc_block_size to a valid value for SESSION Scope # -################################################################################### - -SET @@session.range_alloc_block_size = 2048; -SELECT @@session.range_alloc_block_size; -SET @@session.range_alloc_block_size = 4294967295; -SELECT @@session.range_alloc_block_size; -SET @@session.range_alloc_block_size = 4294967294; -SELECT @@session.range_alloc_block_size; - - ---echo '#------------------FN_DYNVARS_137_05-----------------------#' -################################################################## -# Change the value of range_alloc_block_size to an invalid value # -################################################################## - -SET @@global.range_alloc_block_size = 0; -SELECT @@global.range_alloc_block_size; -SET @@global.range_alloc_block_size = -1024; -SELECT @@global.range_alloc_block_size; -SET @@global.range_alloc_block_size = 42949672951; -SELECT @@global.range_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@global.range_alloc_block_size = 65530.34.; -SELECT @@global.range_alloc_block_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.range_alloc_block_size = test; -SELECT @@global.range_alloc_block_size; - -SET @@session.range_alloc_block_size = 0; -SELECT @@session.range_alloc_block_size; -SET @@session.range_alloc_block_size = -2; -SELECT @@session.range_alloc_block_size; ---Error ER_PARSE_ERROR -SET @@session.range_alloc_block_size = 65530.34.; -SET @@session.range_alloc_block_size = 4294967296; -SELECT @@session.range_alloc_block_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.range_alloc_block_size = test; -SELECT @@session.range_alloc_block_size; - - ---echo '#------------------FN_DYNVARS_137_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.range_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='range_alloc_block_size'; - ---echo '#------------------FN_DYNVARS_137_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.range_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='range_alloc_block_size'; - - ---echo '#------------------FN_DYNVARS_137_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.range_alloc_block_size = TRUE; -SELECT @@global.range_alloc_block_size; -SET @@global.range_alloc_block_size = FALSE; -SELECT @@global.range_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_137_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.range_alloc_block_size = 10; -SELECT @@range_alloc_block_size = @@global.range_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_137_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@range_alloc_block_size = 100; -SELECT @@range_alloc_block_size = @@local.range_alloc_block_size; -SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_137_11----------------------#' -################################################################################### -# Check if range_alloc_block_size can be accessed with and without @@ sign # -################################################################################### - -SET range_alloc_block_size = 1; -SELECT @@range_alloc_block_size; ---Error ER_UNKNOWN_TABLE -SELECT local.range_alloc_block_size; ---Error ER_UNKNOWN_TABLE -SELECT session.range_alloc_block_size; ---Error ER_BAD_FIELD_ERROR -SELECT range_alloc_block_size = @@session.range_alloc_block_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.range_alloc_block_size = @start_global_value; -SELECT @@global.range_alloc_block_size; -SET @@session.range_alloc_block_size = @start_session_value; -SELECT @@session.range_alloc_block_size; - - -############################################################# -# END OF range_alloc_block_size TESTS # -############################################################# - diff --git a/mysql-test/include/rpl_recovery_rank_basic.inc b/mysql-test/include/rpl_recovery_rank_basic.inc deleted file mode 100644 index f9ae3968b31..00000000000 --- a/mysql-test/include/rpl_recovery_rank_basic.inc +++ /dev/null @@ -1,171 +0,0 @@ -############## mysql-test\t\rpl_recovery_rank_basic.test ####################### -# # -# Variable Name: rpl_recovery_rank # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable rpl_recovery_rank # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################### -# START OF rpl_recovery_rank TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.rpl_recovery_rank; -SELECT @start_global_value; - ---echo '#--------------------FN_DYNVARS_142_01-------------------------#' -################################################################### -# Check the DEFAULT value of rpl_recovery_rank # -################################################################### - -SET @@global.rpl_recovery_rank = 500000; -SET @@global.rpl_recovery_rank = DEFAULT; -SELECT @@global.rpl_recovery_rank; - ---echo '#--------------------FN_DYNVARS_142_02-------------------------#' -################################################################################## -# Change the value of rpl_recovery_rank to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.rpl_recovery_rank = 0; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = 1024; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = 123456789; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = 2147483648*2; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = 2147483648*1024; -SELECT @@global.rpl_recovery_rank; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = 2147483648*2147483648; -SELECT @@global.rpl_recovery_rank; - - ---echo '#--------------------FN_DYNVARS_142_03-------------------------#' -################################################################################# -# Check if variable can be access with session scope # -################################################################################# - ---Error ER_GLOBAL_VARIABLE -SET @@rpl_recovery_rank = 2; - ---Error ER_GLOBAL_VARIABLE -SET @@session.rpl_recovery_rank = 3; - ---Error ER_GLOBAL_VARIABLE -SET @@local.rpl_recovery_rank = 4; - - - ---echo '#------------------FN_DYNVARS_142_04-----------------------#' -#################################################################### -# Change the value of rpl_recovery_rank to an invalid value # -#################################################################### - -SET @@global.rpl_recovery_rank = -1; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = -2147483648; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = -2147483649; -SELECT @@global.rpl_recovery_rank; ---Error ER_PARSE_ERROR -SET @@global.rpl_recovery_rank = 65530.34.; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.rpl_recovery_rank = 2147483649.56; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.rpl_recovery_rank = 1G; - - ---echo '#------------------FN_DYNVARS_142_05-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SET @@global.rpl_recovery_rank = 3000; -SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='rpl_recovery_rank'; - - ---echo '#------------------FN_DYNVARS_142_06-----------------------#' -########################################################################### -# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # -########################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='rpl_recovery_rank'; - - ---echo '#------------------FN_DYNVARS_142_07-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.rpl_recovery_rank = TRUE; -SELECT @@global.rpl_recovery_rank; -SET @@global.rpl_recovery_rank = FALSE; -SELECT @@global.rpl_recovery_rank; - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - - -SET @@global.rpl_recovery_rank = 512; -SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################## -# Check if rpl_recovery_rank can be accessed without @@ sign and scope # -################################################################################## - ---Error ER_GLOBAL_VARIABLE -SET rpl_recovery_rank = 2048; ---Error ER_BAD_FIELD_ERROR -SELECT rpl_recovery_rank; - -SELECT @@rpl_recovery_rank; - -#verifying another another syntax for setting value -SET global rpl_recovery_rank = 64; - -#################################### -# Restore initial value # -#################################### - -SET @@global.rpl_recovery_rank = @start_global_value; -SELECT @@global.rpl_recovery_rank; - -######################################################## -# END OF rpl_recovery_rank TESTS # -######################################################## - diff --git a/mysql-test/include/server_id_basic.inc b/mysql-test/include/server_id_basic.inc deleted file mode 100644 index 47afadb5016..00000000000 --- a/mysql-test/include/server_id_basic.inc +++ /dev/null @@ -1,190 +0,0 @@ -############## mysql-test\t\server_id_basic.test ################ -# # -# Variable Name: server_id # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable server_id # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ - ---source include/load_sysvars.inc - -################################################################### -# START OF server_id TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -let $save_general_log= `SELECT @@global.general_log`; -SET @@global.general_log= 0; -SET @start_global_value = @@global.server_id; -SELECT @start_global_value; - ---echo '#--------------------FN_DYNVARS_144_01-------------------------#' -################################################################### -# Display the DEFAULT value of server_id # -################################################################### - -SET @@global.server_id = 500000; -SET @@global.server_id = DEFAULT; -SELECT @@global.server_id; - ---echo '#--------------------FN_DYNVARS_144_02-------------------------#' -################################################################### -# Check the DEFAULT value of server_id # -################################################################### - -SET @@global.server_id = DEFAULT; -SELECT @@global.server_id = 0; - ---echo '#--------------------FN_DYNVARS_144_03-------------------------#' -################################################################################## -# Change the value of server_id to a valid value for GLOBAL Scope # -################################################################################## - -SET @@global.server_id = 0; -SELECT @@global.server_id; -SET @@global.server_id = 1; -SELECT @@global.server_id; -SET @@global.server_id = 15; -SELECT @@global.server_id; -SET @@global.server_id = 1024; -SELECT @@global.server_id; -SET @@global.server_id = 123456789; -SELECT @@global.server_id; -SET @@global.server_id = 2147483648; -SELECT @@global.server_id; -SET @@global.server_id = 2147483648*2-1; -SELECT @@global.server_id; - - ---echo '#--------------------FN_DYNVARS_144_04-------------------------#' -################################################################################# -# Check if variable can be access with session scope # -################################################################################# - ---Error ER_GLOBAL_VARIABLE -SET @@server_id = 2; - ---Error ER_GLOBAL_VARIABLE -SET @@session.server_id = 3; - ---Error ER_GLOBAL_VARIABLE -SET @@local.server_id = 4; - - - ---echo '#------------------FN_DYNVARS_144_05-----------------------#' -#################################################################### -# Change the value of server_id to an invalid value # -#################################################################### - -SET @@global.server_id = -1; -SELECT @@global.server_id; - -SET @@global.server_id = -2147483648; -SELECT @@global.server_id; - -SET @@global.server_id = 2147483649*2; -SELECT @@global.server_id; - ---Error ER_PARSE_ERROR -SET @@global.server_id = 65530.34.; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.server_id = '125'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.server_id = 7483649.56; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.server_id = 1G; - ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#------------------FN_DYNVARS_144_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SET @@global.server_id = 3000; -SELECT @@global.server_id = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='server_id'; - - ---echo '#------------------FN_DYNVARS_144_07-----------------------#' -########################################################################### -# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # -########################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='server_id'; - - ---echo '#------------------FN_DYNVARS_144_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.server_id = TRUE; -SELECT @@global.server_id; -SET @@global.server_id = FALSE; -SELECT @@global.server_id; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -################################################################################# -# Check if accessing variable with and without GLOBAL point to same variable # -################################################################################# - - -SET @@global.server_id = 512; -SELECT @@server_id = @@global.server_id; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################################## -# Check if server_id can be accessed without @@ sign and scope # -################################################################################## - ---Error ER_GLOBAL_VARIABLE -SET server_id = 2048; ---Error ER_BAD_FIELD_ERROR -SELECT server_id; - -SELECT @@server_id; - -#verifying another another syntax for setting value -SET global server_id = 99; - -#################################### -# Restore initial value # -#################################### - -SET @@global.server_id = @start_global_value; -SELECT @@global.server_id; - -eval SET @@global.general_log= $save_general_log; -######################################################## -# END OF server_id TESTS # -######################################################## - diff --git a/mysql-test/include/slave_transaction_retries_basic.inc b/mysql-test/include/slave_transaction_retries_basic.inc deleted file mode 100644 index 6bbed3b1982..00000000000 --- a/mysql-test/include/slave_transaction_retries_basic.inc +++ /dev/null @@ -1,188 +0,0 @@ -############# mysql-test\t\slave_transaction_retries_basic.test ############### -# # -# Variable Name: slave_transaction_retries # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 10 # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable slave_transaction_retries# -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################### -# START OF slave_transaction_retries TESTS # -################################################################### - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.slave_transaction_retries; -SELECT @start_global_value; - ---echo '#--------------------FN_DYNVARS_149_01-------------------------#' -################################################################### -# Display the DEFAULT value of slave_transaction_retries # -################################################################### - -SET @@global.slave_transaction_retries = 50; -SET @@global.slave_transaction_retries = DEFAULT; -SELECT @@global.slave_transaction_retries; - ---echo '#--------------------FN_DYNVARS_149_02-------------------------#' -################################################################### -# Check the DEFAULT value of slave_transaction_retries # -################################################################### - -SET @@global.slave_transaction_retries = DEFAULT; -SELECT @@global.slave_transaction_retries = 10; - ---echo '#--------------------FN_DYNVARS_149_03-------------------------#' -################################################################################ -# Change the value of slave_transaction_retries to a valid value for -# GLOBAL Scope -################################################################################ - -SET @@global.slave_transaction_retries = 0; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = 1; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = 15; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = 1024; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = 2147483648; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = 2147483648*2-1; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = 2147483649*2; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = 4294967295; -SELECT @@global.slave_transaction_retries; - ---echo '#--------------------FN_DYNVARS_149_04-------------------------#' -############################################################################### -# Check if variable can be access with session scope # -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@slave_transaction_retries = 2; - ---Error ER_GLOBAL_VARIABLE -SET @@session.slave_transaction_retries = 3; - ---Error ER_GLOBAL_VARIABLE -SET @@local.slave_transaction_retries = 4; - - - ---echo '#------------------FN_DYNVARS_149_05-----------------------#' -#################################################################### -# Change the value of slave_transaction_retries to an invalid value# -#################################################################### - -SET @@global.slave_transaction_retries = -1; -SELECT @@global.slave_transaction_retries; - -SET @@global.slave_transaction_retries = 2147483649*2147483649; -SELECT @@global.slave_transaction_retries; - ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - ---Error ER_PARSE_ERROR -SET @@global.slave_transaction_retries = 65530.34.; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slave_transaction_retries = '100'; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slave_transaction_retries = 7483649.56; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slave_transaction_retries = ON; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.slave_transaction_retries = OFF; - ---echo '#------------------FN_DYNVARS_149_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SET @@global.slave_transaction_retries = 3000; -SELECT @@global.slave_transaction_retries = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='slave_transaction_retries'; - - ---echo '#------------------FN_DYNVARS_149_07-----------------------#' -########################################################################### -# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # -########################################################################### - -SELECT count(VARIABLE_VALUE) -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='slave_transaction_retries'; - - ---echo '#------------------FN_DYNVARS_149_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.slave_transaction_retries = TRUE; -SELECT @@global.slave_transaction_retries; -SET @@global.slave_transaction_retries = FALSE; -SELECT @@global.slave_transaction_retries; - - ---echo '#---------------------FN_DYNVARS_149_09----------------------#' -############################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -############################################################################### - - -SET @@global.slave_transaction_retries = 60*60; -SELECT @@slave_transaction_retries = @@global.slave_transaction_retries; - - ---echo '#---------------------FN_DYNVARS_149_10----------------------#' -############################################################################### -# Check if slave_transaction_retries can be accessed without @@ sign -# and scope -############################################################################### - ---Error ER_GLOBAL_VARIABLE -SET slave_transaction_retries = 2048; ---Error ER_BAD_FIELD_ERROR -SELECT slave_transaction_retries; - -SELECT @@slave_transaction_retries; - -#verifying another another syntax for setting value -SET global slave_transaction_retries = 99; - -#################################### -# Restore initial value # -#################################### - -SET @@global.slave_transaction_retries = @start_global_value; -SELECT @@global.slave_transaction_retries; - -######################################################## -# END OF slave_transaction_retries TESTS # -######################################################## - diff --git a/mysql-test/include/sort_buffer_size_basic.inc b/mysql-test/include/sort_buffer_size_basic.inc deleted file mode 100644 index 4dbae7c8847..00000000000 --- a/mysql-test/include/sort_buffer_size_basic.inc +++ /dev/null @@ -1,213 +0,0 @@ -############## mysql-test\t\sort_buffer_size_basic.test ####################### -# # -# Variable Name: sort_buffer_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 2097144 # -# Range:max value:4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable sort_buffer_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## - - -###################################################################### -# START OF sort_buffer_size TESTS # -###################################################################### - - -############################################################# -# Save initial value # -############################################################# - -# due to difference when running on Windows (bug filed) ---source include/not_windows.inc - -SET @start_global_value = @@global.sort_buffer_size; -SELECT @start_global_value; -SET @start_session_value = @@session.sort_buffer_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_151_01-------------------------#' -###################################################################### -# Display the DEFAULT value of sort_buffer_size # -###################################################################### - -SET @@global.sort_buffer_size = 1000; -SET @@global.sort_buffer_size = DEFAULT; -SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116; - -SET @@session.sort_buffer_size = 2000; -SET @@session.sort_buffer_size = DEFAULT; -SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116; - - ---echo '#--------------------FN_DYNVARS_151_02-------------------------#' -###################################################################### -# Check the DEFAULT value of sort_buffer_size # -###################################################################### - -SET @@global.sort_buffer_size = DEFAULT; -SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116; - -SET @@session.sort_buffer_size = DEFAULT; -SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116; - - ---echo '#--------------------FN_DYNVARS_151_03-------------------------#' -################################################################################ -# Change the value of sort_buffer_size to a valid value for GLOBAL Scope # -################################################################################ - -SET @@global.sort_buffer_size = 32776; -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -SET @@global.sort_buffer_size = 32777; -SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804; -SET @@global.sort_buffer_size = 4294967295; -SELECT @@global.sort_buffer_size; -SET @@global.sort_buffer_size = 4294967294; -SELECT @@global.sort_buffer_size; ---echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.'; - ---echo '#--------------------FN_DYNVARS_151_04-------------------------#' -################################################################################### -# Change the value of sort_buffer_size to a valid value for SESSION Scope # -################################################################################### - -SET @@session.sort_buffer_size = 32776; -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -SET @@session.sort_buffer_size = 32777; -SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804; -SET @@session.sort_buffer_size = 4294967295; -SELECT @@session.sort_buffer_size; -SET @@session.sort_buffer_size = 4294967294; -SELECT @@session.sort_buffer_size; - - ---echo '#------------------FN_DYNVARS_151_05-----------------------#' -################################################################## -# Change the value of sort_buffer_size to an invalid value # -################################################################## - -SET @@global.sort_buffer_size = 32775; -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -SET @@global.sort_buffer_size = -1024; -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -SET @@global.sort_buffer_size = 4294967296; -SELECT @@global.sort_buffer_size; ---Error ER_PARSE_ERROR -SET @@global.sort_buffer_size = 65530.34.; -SELECT @@global.sort_buffer_size; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sort_buffer_size = test; -SELECT @@global.sort_buffer_size; - -SET @@session.sort_buffer_size = 32775; -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; -SET @@session.sort_buffer_size = -2; -SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; ---Error ER_PARSE_ERROR -SET @@session.sort_buffer_size = 65530.34.; -SET @@session.sort_buffer_size = 4294967296; -SELECT @@session.sort_buffer_size; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.sort_buffer_size = test; -SELECT @@session.sort_buffer_size; - - ---echo '#------------------FN_DYNVARS_151_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; - ---echo '#------------------FN_DYNVARS_151_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; - - ---echo '#------------------FN_DYNVARS_151_08-----------------------#' -#################################################################### -# Check if TRUE and FALSE values can be used on variable # -#################################################################### - -SET @@global.sort_buffer_size = TRUE; -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -SET @@global.sort_buffer_size = FALSE; -SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; -echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'; - - ---echo '#---------------------FN_DYNVARS_151_09----------------------#' -#################################################################################### -# Check if accessing variable with and without GLOBAL point to same variable # -#################################################################################### - -SET @@global.sort_buffer_size = 9000; -SELECT @@sort_buffer_size = @@global.sort_buffer_size; - - ---echo '#---------------------FN_DYNVARS_151_10----------------------#' -######################################################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # -######################################################################################################## - -SET @@sort_buffer_size = 9000; -SELECT @@sort_buffer_size = @@local.sort_buffer_size; -SELECT @@local.sort_buffer_size = @@session.sort_buffer_size; - - ---echo '#---------------------FN_DYNVARS_151_11----------------------#' -################################################################################### -# Check if sort_buffer_size can be accessed with and without @@ sign # -################################################################################### - -SET sort_buffer_size = 9100; -SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804; -SELECT @@sort_buffer_size; ---Error ER_UNKNOWN_TABLE -SELECT local.sort_buffer_size; ---Error ER_UNKNOWN_TABLE -SELECT session.sort_buffer_size; ---Error ER_BAD_FIELD_ERROR -SELECT sort_buffer_size = @@session.sort_buffer_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.sort_buffer_size = @start_global_value; -SELECT @@global.sort_buffer_size; -SET @@session.sort_buffer_size = @start_session_value; -SELECT @@session.sort_buffer_size; - - -############################################################# -# END OF sort_buffer_size TESTS # -############################################################# diff --git a/mysql-test/include/sync_binlog_basic.inc b/mysql-test/include/sync_binlog_basic.inc deleted file mode 100644 index b66509bbb5e..00000000000 --- a/mysql-test/include/sync_binlog_basic.inc +++ /dev/null @@ -1,156 +0,0 @@ -#################### mysql-test\t\sync_binlog_basic.test ###################### -# # -# Variable Name: sync_binlog # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 0 # -# Range: 0 - 4294967295 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Salman Rawala # -# # -# Description: Test Cases of Dynamic System Variable sync_binlog # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -################################################################## -# START OF sync_binlog TESTS # -################################################################## - - -################################################################## -# Saving initial value of sync_binlog in a temporary variable # -################################################################## - -SET @start_value = @@global.sync_binlog; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_168_01------------------------#' -################################################################## -# Display the DEFAULT value of sync_binlog # -################################################################## - -SET @@global.sync_binlog = 99; -SET @@global.sync_binlog = DEFAULT; -SELECT @@global.sync_binlog; - - ---echo '#---------------------FN_DYNVARS_168_02-------------------------#' -############################################### -# Verify default value of variable # -############################################### - -SET @@global.sync_binlog = @start_value; -SELECT @@global.sync_binlog = 0; - - ---echo '#--------------------FN_DYNVARS_168_03------------------------#' -################################################################### -# Change the value of sync_binlog to a valid value # -################################################################### - -SET @@global.sync_binlog = 0; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = 1; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = 4294967295; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = 4294967294; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = 65536; -SELECT @@global.sync_binlog; - - ---echo '#--------------------FN_DYNVARS_168_04-------------------------#' -###################################################################### -# Change the value of sync_binlog to invalid value # -###################################################################### - -SET @@global.sync_binlog = -1; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = 4294967296; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = 10240022115; -SELECT @@global.sync_binlog; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sync_binlog = 10000.01; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = -1024; -SELECT @@global.sync_binlog; -SET @@global.sync_binlog = 42949672950; -SELECT @@global.sync_binlog; ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sync_binlog = ON; -SELECT @@global.sync_binlog; ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.sync_binlog = 'test'; -SELECT @@global.sync_binlog; - - ---echo '#-------------------FN_DYNVARS_168_05----------------------------#' -########################################################################### -# Test if accessing session sync_binlog gives error # -########################################################################### - ---Error ER_GLOBAL_VARIABLE -SET @@session.sync_binlog = 0; -SELECT @@sync_binlog; - - ---echo '#----------------------FN_DYNVARS_168_06------------------------#' -############################################################################## -# Check if the value in GLOBAL & SESSION Tables matches values in variable # -############################################################################## - -SELECT @@global.sync_binlog = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='sync_binlog'; - - - ---echo '#---------------------FN_DYNVARS_168_07----------------------#' -########################################################################## -# Check if sync_binlog can be accessed with and without @@ sign # -########################################################################## - ---Error ER_GLOBAL_VARIABLE -SET sync_binlog = 1; -SELECT @@sync_binlog; ---Error ER_PARSE_ERROR -SET local.sync_binlog = 1; ---Error ER_UNKNOWN_TABLE -SELECT local.sync_binlog; ---Error ER_PARSE_ERROR -SET global.sync_binlog = 1; ---Error ER_UNKNOWN_TABLE -SELECT global.sync_binlog; ---Error ER_BAD_FIELD_ERROR -SELECT sync_binlog = @@session.sync_binlog; - - -############################## -# Restore initial value # -############################## - -SET @@global.sync_binlog = @start_value; -SELECT @@global.sync_binlog; - - -######################################################################## -# END OF sync_binlog TESTS # -######################################################################## diff --git a/mysql-test/include/timestamp_basic.inc b/mysql-test/include/timestamp_basic.inc deleted file mode 100644 index d7ad620ec26..00000000000 --- a/mysql-test/include/timestamp_basic.inc +++ /dev/null @@ -1,162 +0,0 @@ -################## mysql-test\t\timestamp_basic.test ########################## -# # -# Variable Name: timestamp # -# Scope: SESSION # -# Access Type: Dynamic # -# Data Type: string # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable timestamp # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -####################################################################### -# START OF timestamp TESTS # -####################################################################### - - -####################################################################### -# Saving initial value of timestamp in a temporary variable # -####################################################################### - -SET @session_start_value = @@session.timestamp; - ---echo '#--------------------FN_DYNVARS_001_01------------------------#' -######################################################################## -# Display the DEFAULT value of timestamp # -######################################################################## - - -SET @@timestamp = DEFAULT; -#SELECT @@timestamp; - ---echo 'timestamp does not have any DEFAULT value' - ---echo '#---------------------FN_DYNVARS_001_02-------------------------#' -############################################################## -# see if accessable using global scope # -############################################################## - ---Error ER_LOCAL_VARIABLE -SET @@global.timestamp = "1000"; - - ---echo '#--------------------FN_DYNVARS_001_03------------------------#' -######################################################################## -# Change the value of timestamp to a valid value # -######################################################################## - -SET @@timestamp = 0; -#SELECT @@timestamp; - ---echo 'Setting 0 resets timestamp to session default timestamp' - -SET @@timestamp = 123456789123456; -SELECT @@timestamp; -SET @@timestamp = 60*60*60*60*365; -SELECT @@timestamp; -SET @@timestamp = -1000000000; -SELECT @@timestamp; - -SET @temp_ts = @@timestamp - @@timestamp; -SELECT @temp_ts; - ---echo '#--------------------FN_DYNVARS_001_04-------------------------#' -########################################################################### -# Change the value of timestamp to invalid value # -########################################################################### - -# for session scope ---Error ER_WRONG_TYPE_FOR_VAR -SET @@timestamp = "100"; ---echo 'Bug# 34836: Documentation says its a string variable but infact its numeric' - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@timestamp = " "; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@timestamp = 1.1; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@timestamp = 9999999999999999999999; - - - ---echo '#----------------------FN_DYNVARS_001_06------------------------#' -######################################################################### -# Check if the value in SESSION Table matches value in variable # -######################################################################### - -SELECT @@timestamp = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='timestamp'; - ---echo '#---------------------FN_DYNVARS_001_08-------------------------#' -############################################################################# -# Check if ON, OFF, TRUE and FALSE values can be used on variable # -############################################################################# ---Error ER_WRONG_TYPE_FOR_VAR -SET @@timestamp = OFF; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@timestamp = ON; - -SET @@timestamp = TRUE; -SELECT @@timestamp; - -SET @@timestamp = FALSE; -#SELECT @@timestamp; - - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -############################################################################# -# Check if accessing variable with SESSION,LOCAL and without SCOPE points -# to same session variable -############################################################################# - -SET @@timestamp = 123456; -SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; -SET @@timestamp = 654321; -SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -##################################################################### -# Check if timestamp can be accessed with and without @@ sign # -##################################################################### - -SET timestamp = 1; -SELECT @@timestamp; ---Error ER_UNKNOWN_TABLE -SELECT local.timestamp; ---Error ER_UNKNOWN_TABLE -SELECT session.timestamp; ---Error ER_BAD_FIELD_ERROR -SELECT timestamp = @@session.timestamp; - -############################## -# Restore initial value # -############################## - -SET @@timestamp = @session_start_value; - -####################################################################### -# END OF timestamp TESTS # -####################################################################### - diff --git a/mysql-test/include/tmp_table_size_basic.inc b/mysql-test/include/tmp_table_size_basic.inc deleted file mode 100644 index 7f69bcd1f8c..00000000000 --- a/mysql-test/include/tmp_table_size_basic.inc +++ /dev/null @@ -1,233 +0,0 @@ -############## mysql-test\t\tmp_table_size_basic.test ######################### -# # -# Variable Name: tmp_table_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 33554432 # -# Range: 1024-4294967295 # -# # -# # -# Creation Date: 2008-02-13 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable tmp_table_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_tmp_table_size # -# # -############################################################################### - ---source include/load_sysvars.inc - -############################################################## -# START OF tmp_table_size TESTS # -############################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.tmp_table_size; -SELECT @start_global_value; -SET @start_session_value = @@session.tmp_table_size; -SELECT @start_session_value; - ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -############################################################## -# Display the DEFAULT value of tmp_table_size # -############################################################## - -SET @@global.tmp_table_size = 100; -SET @@global.tmp_table_size = DEFAULT; -SELECT @@global.tmp_table_size; - ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; -SET @@session.tmp_table_size = 200; -SET @@session.tmp_table_size = DEFAULT; -SELECT @@session.tmp_table_size; ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of tmp_table_size # -######################################################################## - -SET @@global.tmp_table_size = DEFAULT; -SELECT @@global.tmp_table_size = 33554432; - -SET @@session.tmp_table_size = DEFAULT; -SELECT @@session.tmp_table_size = 33554432; - ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -######################################################################## -# Change the value of tmp_table_size to a valid value for GLOBAL Scope # -######################################################################## - -SET @@global.tmp_table_size = 1024; -SELECT @@global.tmp_table_size; -SET @@global.tmp_table_size = 60020; -SELECT @@global.tmp_table_size; -SET @@global.tmp_table_size = 4294967295; -SELECT @@global.tmp_table_size; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -######################################################################### -# Change the value of tmp_table_size to a valid value for SESSION Scope # -######################################################################### - -SET @@session.tmp_table_size = 1024; -SELECT @@session.tmp_table_size; - -SET @@session.tmp_table_size =4294967295; -SELECT @@session.tmp_table_size; -SET @@session.tmp_table_size = 65535; -SELECT @@session.tmp_table_size; - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -########################################################## -# Change the value of tmp_table_size to an invalid value # -########################################################## - -SET @@global.tmp_table_size = 0; -SELECT @@global.tmp_table_size; - -SET @@global.tmp_table_size = -1024; -SELECT @@global.tmp_table_size; - -SET @@global.tmp_table_size = 1000; -SELECT @@global.tmp_table_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.tmp_table_size = ON; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.tmp_table_size = OFF; - - -SET @@global.tmp_table_size = True; -SELECT @@global.tmp_table_size; - -SET @@global.tmp_table_size = False; -SELECT @@global.tmp_table_size; ---echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value'; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.tmp_table_size = 65530.34; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.tmp_table_size ="Test"; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.tmp_table_size = ON; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.tmp_table_size = OFF; - -SET @@session.tmp_table_size = True; -SELECT @@session.tmp_table_size; - -SET @@session.tmp_table_size = False; -SELECT @@session.tmp_table_size; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.tmp_table_size = "Test"; - -SET @@session.tmp_table_size = 12345678901; -SELECT @@session.tmp_table_size; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.tmp_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='tmp_table_size'; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.tmp_table_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='tmp_table_size'; - - - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -######################################################################## -# Check if global and session variables are independent of each other # -######################################################################## - -SET @@global.tmp_table_size = 1024; -SET @@tmp_table_size = 4294967295; -SELECT @@tmp_table_size = @@global.tmp_table_size; - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################## -# Check if accessing variable with SESSION,LOCAL and without # -# SCOPE points to same session variable # -################################################################## - -SET @@tmp_table_size = 100; -SELECT @@tmp_table_size = @@local.tmp_table_size; -SELECT @@local.tmp_table_size = @@session.tmp_table_size; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -######################################################################### -# Check if tmp_table_size can be accessed with and without @@ sign # -######################################################################### - -SET tmp_table_size = 1027; -SELECT @@tmp_table_size; - ---Error ER_UNKNOWN_TABLE -SELECT local.tmp_table_size; - ---Error ER_UNKNOWN_TABLE -SELECT global.tmp_table_size; - ---Error ER_BAD_FIELD_ERROR -SELECT tmp_table_size = @@session.tmp_table_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.tmp_table_size = @start_global_value; -SELECT @@global.tmp_table_size; -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.tmp_table_size; - - -################################################### -# END OF tmp_table_size TESTS # -################################################### - diff --git a/mysql-test/include/transaction_alloc_block_size_basic.inc b/mysql-test/include/transaction_alloc_block_size_basic.inc deleted file mode 100644 index c14383b86c6..00000000000 --- a/mysql-test/include/transaction_alloc_block_size_basic.inc +++ /dev/null @@ -1,240 +0,0 @@ -############## mysql-test\t\transaction_alloc_block_size_basic.test ########### -# # -# Variable Name: transaction_alloc_block_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 8192 # -# Range: 1024-4294967295 # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Salman # -# # -# Description: Test Cases of Dynamic System Variable # -# transaction_alloc_block_size # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF transaction_alloc_block_size TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.transaction_alloc_block_size; -SELECT @start_global_value; -SET @start_session_value = @@session.transaction_alloc_block_size; -SELECT @start_session_value; - - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -######################################################################## -# Display the DEFAULT value of transaction_alloc_block_size # -######################################################################## - -SET @@global.transaction_alloc_block_size = 100; -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size; - - -SET @@session.transaction_alloc_block_size = 200; -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size; - - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of transaction_alloc_block_size # -######################################################################## - -SET @@global.transaction_alloc_block_size = DEFAULT; -SELECT @@global.transaction_alloc_block_size = 8192; - -SET @@session.transaction_alloc_block_size = DEFAULT; -SELECT @@session.transaction_alloc_block_size = 8192; - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.transaction_alloc_block_size = 1024; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = 60020; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@global.transaction_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################### -# Change the value of variable to a valid value for SESSION Scope # -################################################################### - -SET @@session.transaction_alloc_block_size = 1024; -SELECT @@session.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size =4294967295; -SELECT @@session.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size = 65535; -SELECT @@session.transaction_alloc_block_size; ---echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -######################################################################## -# Change the value of transaction_alloc_block_size to an invalid value # -######################################################################## - -SET @@global.transaction_alloc_block_size = 0; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = -1024; -SELECT @@global.transaction_alloc_block_size; - - -SET @@global.transaction_alloc_block_size = 123456789201; -SELECT @@global.transaction_alloc_block_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size = ON; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size = OFF; - - -SET @@global.transaction_alloc_block_size = True; -SELECT @@global.transaction_alloc_block_size; - -SET @@global.transaction_alloc_block_size = False; -SELECT @@global.transaction_alloc_block_size; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size = 65530.34; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_alloc_block_size ="Test"; - -SET @@global.transaction_alloc_block_size = 1000; -SELECT @@global.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size = 12345678901; -SELECT @@session.transaction_alloc_block_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = ON; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = OFF; - -SET @@session.transaction_alloc_block_size = True; -SELECT @@session.transaction_alloc_block_size; - -SET @@session.transaction_alloc_block_size = False; -SELECT @@session.transaction_alloc_block_size; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = "Test"; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_alloc_block_size = 'test'; - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_alloc_block_size'; - - ---echo '#---------------------FN_DYNVARS_001_08----------------------#' -########################################################################### -# Check if global and session variable are independent of each other # -########################################################################### - -SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## - -SET @@transaction_alloc_block_size = 100; -SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; -SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -################################################################ -# Check if variable can be accessed with and without @@ sign # -################################################################ - -SET transaction_alloc_block_size = 1027; -SELECT @@transaction_alloc_block_size; - ---Error ER_UNKNOWN_TABLE -SELECT local.transaction_alloc_block_size; - ---Error ER_UNKNOWN_TABLE -SELECT session.transaction_alloc_block_size; - ---Error ER_BAD_FIELD_ERROR -SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.transaction_alloc_block_size = @start_global_value; -SELECT @@global.transaction_alloc_block_size; -SET @@session.tmp_table_size = @start_session_value; -SELECT @@session.transaction_alloc_block_size; - - -############################################################# -# END OF transaction_alloc_block_size TESTS # -############################################################# - diff --git a/mysql-test/include/transaction_prealloc_size_basic.inc b/mysql-test/include/transaction_prealloc_size_basic.inc deleted file mode 100644 index 1ca302a19e0..00000000000 --- a/mysql-test/include/transaction_prealloc_size_basic.inc +++ /dev/null @@ -1,229 +0,0 @@ -############## mysql-test\t\transaction_prealloc_size_basic.test ############## -# # -# Variable Name: transaction_prealloc_size # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: 4096 # -# Range: # -# # -# # -# Creation Date: 2008-02-14 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable transaction_prealloc_size# -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_transaction_prealloc_size # -# # -############################################################################### - ---source include/load_sysvars.inc - -######################################################################## -# START OF transaction_prealloc_size TESTS # -######################################################################## - - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.transaction_prealloc_size; -SELECT @start_global_value; -SET @start_session_value = @@session.transaction_prealloc_size; -SELECT @start_session_value; - ---echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -######################################################################## -# Display the DEFAULT value of transaction_prealloc_size # -######################################################################## - -SET @@global.transaction_prealloc_size = 100; -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size; - - -SET @@session.transaction_prealloc_size = 200; -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size; - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -######################################################################## -# Check the DEFAULT value of transaction_prealloc_size # -######################################################################## - -SET @@global.transaction_prealloc_size = DEFAULT; -SELECT @@global.transaction_prealloc_size = 4096; - -SET @@session.transaction_prealloc_size = DEFAULT; -SELECT @@session.transaction_prealloc_size = 4096; - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -################################################################## -# Change the value of variable to a valid value for GLOBAL Scope # -################################################################## - -SET @@global.transaction_prealloc_size = 1024; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = 60020; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = 4294966272; -SELECT @@global.transaction_prealloc_size; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -################################################################### -# Change the value of variable to a valid value for SESSION Scope # -################################################################### - -SET @@session.transaction_prealloc_size = 1024; -SELECT @@session.transaction_prealloc_size; - -SET @@session.transaction_prealloc_size =4294966272; -SELECT @@session.transaction_prealloc_size; -SET @@session.transaction_prealloc_size = 65535; -SELECT @@session.transaction_prealloc_size; - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -##################################################################### -# Change the value of transaction_prealloc_size to an invalid value # -##################################################################### - -SET @@global.transaction_prealloc_size = 0; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = -1024; -SELECT @@global.transaction_prealloc_size; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size = ON; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size = OFF; - - -SET @@global.transaction_prealloc_size = True; -SELECT @@global.transaction_prealloc_size; - -SET @@global.transaction_prealloc_size = False; -SELECT @@global.transaction_prealloc_size; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size = 65530.34; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@global.transaction_prealloc_size ="Test"; - -SET @@global.transaction_prealloc_size = 1000; -SELECT @@global.transaction_prealloc_size; - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_prealloc_size = ON; - - --- Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_prealloc_size = OFF; - -SET @@session.transaction_prealloc_size = True; -SELECT @@session.transaction_prealloc_size; - -SET @@session.transaction_prealloc_size = False; -SELECT @@session.transaction_prealloc_size; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.transaction_prealloc_size = "Test"; - -SET @@session.transaction_prealloc_size = 123456789031; -SELECT @@session.transaction_prealloc_size; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - - -SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='transaction_prealloc_size'; - - - - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -########################################################################### -# Check if global and session variable are independent of each other # -########################################################################### - -SET @@global.transaction_prealloc_size = 1024; -SET @@global.transaction_prealloc_size = 10; - -SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; - - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## - -SET @@transaction_prealloc_size = 100; -SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; -SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; - - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -############################################################################### -# Check if transaction_prealloc_size can be accessed with and without @@ sign # -############################################################################### - -SET transaction_prealloc_size = 1027; -SELECT @@transaction_prealloc_size; - ---Error ER_UNKNOWN_TABLE -SELECT local.transaction_prealloc_size; - ---Error ER_UNKNOWN_TABLE -SELECT session.transaction_prealloc_size; - ---Error ER_BAD_FIELD_ERROR -SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; - -#################################### -# Restore initial value # -#################################### - -SET @@global.transaction_prealloc_size = @start_global_value; -SELECT @@global.transaction_prealloc_size; -SET @@session.transaction_prealloc_size = @start_session_value; -SELECT @@session.transaction_prealloc_size; - - -############################################################# -# END OF transaction_prealloc_size TESTS # -############################################################# - From 7a6d7491b5cc0eced2f769d4683f4a9f2461dd82 Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Tue, 22 Jul 2008 19:00:27 +0200 Subject: [PATCH 123/352] Fix for bug#37708: Deleted the removed tests. --- mysql-test/t/disabled.def | 82 --------------------------------------- 1 file changed, 82 deletions(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index c058992d795..ada7cb3aa97 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -12,88 +12,6 @@ federated_transactions : Bug#29523 Transactions do not work csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables thread_cache_size_func : Bug#36733 main.thread_cache_size_func fails randomly -binlog_cache_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -bulk_insert_buffer_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -delayed_insert_limit_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -delayed_queue_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -innodb_concurrency_tickets_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -innodb_max_purge_lag_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -innodb_sync_spin_loops_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -join_buffer_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_buffer_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_cache_age_threshold_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_cache_block_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_cache_division_limit_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -log_warnings_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_binlog_cache_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_connect_errors_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_heap_table_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_seeks_for_key_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_tmp_tables_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_write_lock_count_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -min_examined_row_limit_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -multi_range_count_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -myisam_max_sort_file_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -myisam_repair_threads_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -myisam_sort_buffer_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -net_retry_count_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_alloc_block_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_cache_limit_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_cache_min_res_unit_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_cache_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_prealloc_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -range_alloc_block_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -rpl_recovery_rank_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -server_id_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -slave_transaction_retries_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -sort_buffer_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -sync_binlog_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -timestamp_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -tmp_table_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -transaction_alloc_block_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -transaction_prealloc_size_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -wait_timeout_basic_32 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -binlog_cache_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -bulk_insert_buffer_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -delayed_insert_limit_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -delayed_queue_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -innodb_concurrency_tickets_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -innodb_max_purge_lag_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -innodb_sync_spin_loops_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -join_buffer_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_buffer_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_cache_age_threshold_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_cache_block_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -key_cache_division_limit_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -log_warnings_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_binlog_cache_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_connect_errors_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_heap_table_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_seeks_for_key_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_tmp_tables_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -max_write_lock_count_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -min_examined_row_limit_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -multi_range_count_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -myisam_max_sort_file_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -myisam_repair_threads_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -myisam_sort_buffer_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -net_retry_count_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_cache_limit_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_cache_min_res_unit_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_cache_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -query_prealloc_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -range_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -rpl_recovery_rank_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -server_id_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -slave_transaction_retries_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -sort_buffer_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -sync_binlog_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -timestamp_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -tmp_table_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -transaction_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -transaction_prealloc_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms -wait_timeout_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions From 58daa8d50a05e863ed6f24646b05d600070646af Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 22 Jul 2008 14:53:36 -0300 Subject: [PATCH 124/352] Silence warning due to unused function. --- sql/field.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/field.cc b/sql/field.cc index 21e26b518e8..70cc14bda5f 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6644,6 +6644,7 @@ struct Check_field_param { Field *field; }; +#ifdef HAVE_REPLICATION static bool check_field_for_37426(const void *param_arg) { @@ -6655,7 +6656,7 @@ check_field_for_37426(const void *param_arg) param->field->row_pack_length())); return param->field->row_pack_length() > 255; } - +#endif int Field_string::compatible_field_size(uint field_metadata, const Relay_log_info *rli_arg) From 223c0177e71c4d586d36f1e595dfe7145b28df3d Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Wed, 23 Jul 2008 12:03:27 +0530 Subject: [PATCH 125/352] WL#4380 fixed the abi_check rule to handle failure in the diff command on the solaris platform. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 222785ea3b1..77318baf07e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -306,7 +306,7 @@ do_abi_check: -e '/^[ ]*$$/d' \ -e '/^#pragma GCC set_debug_pwd/d' > \ $(top_builddir)/abi_check.out; \ - @DIFF@ -wB $$file.pp $(top_builddir)/abi_check.out; \ + @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \ @RM@ $(top_builddir)/abi_check.out; \ done From 62b41dddd9ec15478b29c1b4c52cf9baedb85ef2 Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Wed, 23 Jul 2008 08:51:04 +0200 Subject: [PATCH 126/352] fix of bug#37708: removed a forgotten include file. --- mysql-test/include/wait_timeout_basic.inc | 218 ---------------------- 1 file changed, 218 deletions(-) delete mode 100644 mysql-test/include/wait_timeout_basic.inc diff --git a/mysql-test/include/wait_timeout_basic.inc b/mysql-test/include/wait_timeout_basic.inc deleted file mode 100644 index b6e19e235ba..00000000000 --- a/mysql-test/include/wait_timeout_basic.inc +++ /dev/null @@ -1,218 +0,0 @@ -############## mysql-test\t\wait_timeout_basic.test ########################### -# # -# Variable Name: wait_timeout # -# Scope: GLOBAL | SESSION # -# Access Type: Dynamic # -# Data Type: numeric # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Sharique Abdullah # -# # -# Description: Test Cases of Dynamic System Variable wait_timeout # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html#option_mysqld_wait_timeouts # -# # -############################################################################### -# Due to differnces between linux and windows in the results - ---source include/not_windows.inc ---source include/load_sysvars.inc - -############################################################ -# START OF wait_timeout TESTS # -############################################################ - -############################################################# -# Save initial value # -############################################################# - -SET @start_global_value = @@global.wait_timeout; -SET @start_session_value = @@session.wait_timeout; - ---echo '#--------------------FN_DYNVARS_005_01-------------------------#' -############################################################ -# Display the DEFAULT value of wait_timeout # -############################################################ - -SET @@global.wait_timeout = 100; -SET @@global.wait_timeout = DEFAULT; -SELECT @@global.wait_timeout; - -SET @@session.wait_timeout = 200; -SET @@session.wait_timeout = DEFAULT; -SELECT @@session.wait_timeout; - - ---echo '#--------------------FN_DYNVARS_005_02-------------------------#' -############################################################ -# Check the DEFAULT value of wait_timeout # -############################################################ - -SET @@global.wait_timeout = DEFAULT; -SELECT @@global.wait_timeout = @default_wait_timeout; - -SET @@session.wait_timeout = DEFAULT; -SELECT @@session.wait_timeout = @default_wait_timeout; - - - ---echo '#--------------------FN_DYNVARS_005_03-------------------------#' -###################################################################### -# Change the value of wait_timeout to a valid value for GLOBAL Scope # -###################################################################### - -#SET @@global.wait_timeout= @min_wait_timeout; -SET @@global.wait_timeout= 1; -SELECT @@global.wait_timeout; - -SET @@global.wait_timeout = 60020; -SELECT @@global.wait_timeout; - -#SET @@global.wait_timeout = @max_wait_timeout; -SET @@global.wait_timeout = 31536000; -SELECT @@global.wait_timeout = @max_wait_timeout; - - ---echo '#--------------------FN_DYNVARS_005_04-------------------------#' -####################################################################### -# Change the value of wait_timeout to a valid value for SESSION Scope # -####################################################################### -#SET @@session.wait_timeout = @min_wait_timeout; -#SELECT @@session.wait_timeout; - -SET @@session.wait_timeout =6000; -SELECT @@session.wait_timeout; - -#SET @@session.wait_timeout = @max_wait_timeout; -#SELECT @@session.wait_timeout = @max_wait_timeout; - - ---echo '#------------------FN_DYNVARS_005_05-----------------------#' -######################################################## -# Change the value of wait_timeout to an invalid value # -######################################################## - -SET @@global.wait_timeout = 0; -SET @@global.wait_timeout = -1024; - ---echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.wait_timeout = ON; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.wait_timeout = OFF; - -SET @@global.wait_timeout = True; -SELECT @@global.wait_timeout; - -SET @@global.wait_timeout = False; -SELECT @@global.wait_timeout; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.wait_timeout = 65530.34; - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@global.wait_timeout ="Test"; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.wait_timeout = ON; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.wait_timeout = OFF; - -SET @@session.wait_timeout = True; -SELECT @@session.wait_timeout; - -SET @@session.wait_timeout = False; -SELECT @@session.wait_timeout; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.wait_timeout = "Test"; - - ---Error ER_WRONG_TYPE_FOR_VAR -SET @@session.wait_timeout = 'test'; - -SET @@session.wait_timeout = 123456789031; -SELECT @@session.wait_timeout = @max_wait_timeout; - - ---echo '#------------------FN_DYNVARS_005_06-----------------------#' -#################################################################### -# Check if the value in GLOBAL Table matches value in variable # -#################################################################### - -SELECT @@global.wait_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -WHERE VARIABLE_NAME='wait_timeout'; - ---echo '#------------------FN_DYNVARS_005_07-----------------------#' -#################################################################### -# Check if the value in SESSION Table matches value in variable # -#################################################################### - -SELECT @@session.wait_timeout = VARIABLE_VALUE -FROM INFORMATION_SCHEMA.SESSION_VARIABLES -WHERE VARIABLE_NAME='wait_timeout'; - ---echo '#---------------------FN_DYNVARS_001_09----------------------#' -########################################################################### -# Check if global and session variable are independent of each other # -########################################################################### - -SET @@global.wait_timeout = 30000; -SET @@global.wait_timeout = 40000; -SELECT @@wait_timeout = @@global.wait_timeout; - ---echo '#---------------------FN_DYNVARS_001_10----------------------#' -######################################################################## -# Check if accessing variable with SESSION,LOCAL and without SCOPE # -# points to same session variable # -######################################################################## - -SET @@wait_timeout = 100; -SELECT @@wait_timeout = @@local.wait_timeout; -SELECT @@local.wait_timeout = @@session.wait_timeout; - ---echo '#---------------------FN_DYNVARS_001_11----------------------#' -####################################################################### -# Check if wait_timeout can be accessed with and without @@ sign # -####################################################################### - -SET wait_timeout = 1027; -SELECT @@wait_timeout; - - ---Error ER_UNKNOWN_TABLE -SELECT local.wait_timeout; - ---Error ER_UNKNOWN_TABLE -SELECT session.wait_timeout; - ---Error ER_BAD_FIELD_ERROR -SELECT wait_timeout = @@session.wait_timeout; - - -#################################### -# Restore initial value # -#################################### - -SET @@global.wait_timeout = @start_global_value; -SET @@session.wait_timeout = @start_session_value; - -################################################# -# END OF wait_timeout TESTS # -################################################# From bb945f70a1204990e6bd56554a1d17dfebff26fe Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 23 Jul 2008 12:13:55 +0200 Subject: [PATCH 127/352] BUG#37493: rpl_trunc_temp.test nondeterministic Problem: the test waits for a 'DROP TEMPORARY TABLE' event to appear in the master's binlog, then checks on the slave whether the number of temporary tables has decreased. The slave does not sync, causing a race. Fix: check for the 'DROP TEMPORARY TABLE' event on slave instead of on master. --- mysql-test/suite/rpl/t/rpl_trunc_temp.test | 38 +++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test index 93308e3eb3f..88ecb7c18b0 100644 --- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test +++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test @@ -1,13 +1,30 @@ -# Requires statement logging +# ==== Purpose ==== +# +# Verify that Slave_open_temp_tables is increased when a temporary +# table is opened on the slave, and decreased when a temporary table +# is closed on the slave, and that it is preserved during 'DELETE FROM +# table' and 'TRUNCATE table'. +# +# ==== Method ==== +# +# Create a temporary table on master, insert rows, and try: +# - delete rows from the table +# - truncate the table +# - drop the table +# +# ==== Related bugs ==== +# +# BUG#17137 Running "truncate table" on temporary table leaves the table open on a slave +# +# Bug in this test: BUG#37493: rpl_trunc_temp.test nondeterministic + + +# Requires statement-based logging since temporary tables are not +# logged in row-based logging -- source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; -# -# Bug#17137 Running "truncate table" on temporary table -# leaves the table open on a slave -# - create temporary table t1 (n int); insert into t1 values(1); sync_slave_with_master; @@ -28,13 +45,10 @@ show status like 'Slave_open_temp_tables'; # Disconnect the master, temp table on slave should dissapear disconnect master; -connection master1; -# Wait until drop of temp tables appers in binlog +connection slave; + +# Wait until drop of temp tables appers in slave's binlog let $wait_binlog_event= DROP; source include/wait_for_binlog_event.inc; -connection slave; show status like 'Slave_open_temp_tables'; - - -# End of 4.1 tests From 436f1dc49cbb635e5b44ab1d625e3ef6d8d3e4e6 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 23 Jul 2008 14:25:00 +0300 Subject: [PATCH 128/352] Bug#37830 : ORDER BY ASC/DESC - no difference Range scan in descending order for c <= <= c type of ranges was ignoring the DESC flag. However some engines like InnoDB have the primary key parts as a suffix for every secondary key. When such primary key suffix is used for ordering ignoring the DESC is not valid. But we generally would like to do this because it's faster. Fixed by performing only reverse scan if the primary key is used. Removed some dead code in the process. --- mysql-test/r/innodb_mysql.result | 15 ++++++++ mysql-test/t/innodb_mysql.test | 18 +++++++++ sql/opt_range.cc | 66 ++++++-------------------------- sql/opt_range.h | 4 +- sql/sql_select.cc | 59 +++++++++++++++++----------- 5 files changed, 83 insertions(+), 79 deletions(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index b487cfd9a4b..47fa331c9ab 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1246,4 +1246,19 @@ set global innodb_autoextend_increment=@my_innodb_autoextend_increment; set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; +CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) +ENGINE=InnoDB; +INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); +INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; +EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range t1_b t1_b 5 NULL 4 Using where +SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; +a b c +8 1 1 +7 1 1 +6 1 1 +5 1 1 +4 1 1 +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 59ee7c274bb..e15d1aee08a 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -996,4 +996,22 @@ set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency; set global innodb_commit_concurrency=0; set global innodb_commit_concurrency=@my_innodb_commit_concurrency; +# +# Bug #37830: ORDER BY ASC/DESC - no difference +# + +CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b)) + ENGINE=InnoDB; + +INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1); +INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1; + +# should be range access +EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; + +# should produce '8 7 6 5 4' for a +SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; + +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 95cda371673..7587db4e329 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7099,7 +7099,8 @@ bool QUICK_RANGE_SELECT::row_in_ranges() QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint used_key_parts_arg) - : QUICK_RANGE_SELECT(*q), rev_it(rev_ranges) + : QUICK_RANGE_SELECT(*q), rev_it(rev_ranges), + used_key_parts (used_key_parts_arg) { QUICK_RANGE *r; @@ -7141,10 +7142,11 @@ int QUICK_SELECT_DESC::get_next() int result; if (last_range) { // Already read through key - result = ((last_range->flag & EQ_RANGE) - ? file->index_next_same(record, (byte*) last_range->min_key, - last_range->min_length) : - file->index_prev(record)); + result = ((last_range->flag & EQ_RANGE && + used_key_parts <= head->key_info[index].key_parts) ? + file->index_next_same(record, (byte*) last_range->min_key, + last_range->min_length) : + file->index_prev(record)); if (!result) { if (cmp_prev(*rev_it.ref()) == 0) @@ -7168,7 +7170,9 @@ int QUICK_SELECT_DESC::get_next() continue; } - if (last_range->flag & EQ_RANGE) + if (last_range->flag & EQ_RANGE && + used_key_parts <= head->key_info[index].key_parts) + { result= file->index_read(record, (byte*) last_range->max_key, last_range->max_length, HA_READ_KEY_EXACT); @@ -7176,6 +7180,8 @@ int QUICK_SELECT_DESC::get_next() else { DBUG_ASSERT(last_range->flag & NEAR_MAX || + (last_range->flag & EQ_RANGE && + used_key_parts > head->key_info[index].key_parts) || range_reads_after_key(last_range)); result=file->index_read(record, (byte*) last_range->max_key, last_range->max_length, @@ -7273,54 +7279,6 @@ bool QUICK_SELECT_DESC::range_reads_after_key(QUICK_RANGE *range_arg) } -/* TRUE if we are reading over a key that may have a NULL value */ - -#ifdef NOT_USED -bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg, - uint used_key_parts) -{ - uint offset, end; - KEY_PART *key_part = key_parts, - *key_part_end= key_part+used_key_parts; - - for (offset= 0, end = min(range_arg->min_length, range_arg->max_length) ; - offset < end && key_part != key_part_end ; - offset+= key_part++->store_length) - { - if (!memcmp((char*) range_arg->min_key+offset, - (char*) range_arg->max_key+offset, - key_part->store_length)) - continue; - - if (key_part->null_bit && range_arg->min_key[offset]) - return 1; // min_key is null and max_key isn't - // Range doesn't cover NULL. This is ok if there is no more null parts - break; - } - /* - If the next min_range is > NULL, then we can use this, even if - it's a NULL key - Example: SELECT * FROM t1 WHERE a = 2 AND b >0 ORDER BY a DESC,b DESC; - - */ - if (key_part != key_part_end && key_part->null_bit) - { - if (offset >= range_arg->min_length || range_arg->min_key[offset]) - return 1; // Could be null - key_part++; - } - /* - If any of the key parts used in the ORDER BY could be NULL, we can't - use the key to sort the data. - */ - for (; key_part != key_part_end ; key_part++) - if (key_part->null_bit) - return 1; // Covers null part - return 0; -} -#endif - - void QUICK_RANGE_SELECT::add_info_string(String *str) { KEY *key_info= head->key_info + index; diff --git a/sql/opt_range.h b/sql/opt_range.h index 3a737323eb7..8856223b371 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -667,12 +667,10 @@ public: int get_type() { return QS_TYPE_RANGE_DESC; } private: bool range_reads_after_key(QUICK_RANGE *range); -#ifdef NOT_USED - bool test_if_null_range(QUICK_RANGE *range, uint used_key_parts); -#endif int reset(void) { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); } List rev_ranges; List_iterator rev_it; + uint used_key_parts; }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 60ba7591726..bcc5f30180f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -12088,26 +12088,25 @@ part_of_refkey(TABLE *table,Field *field) } -/***************************************************************************** - Test if one can use the key to resolve ORDER BY +/** + Test if a key can be used to resolve ORDER BY - SYNOPSIS - test_if_order_by_key() - order Sort order - table Table to sort - idx Index to check - used_key_parts Return value for used key parts. + used_key_parts is set to correct key parts used if return value != 0 + (On other cases, used_key_part may be changed). + Note that the value may actually be greater than the number of index + key parts. This can happen for storage engines that have the primary + key parts as a suffix for every secondary key. + @param order Sort order + @param table Table to sort + @param idx Index to check + @param[out] used_key_parts Return value for used key parts. - NOTES - used_key_parts is set to correct key parts used if return value != 0 - (On other cases, used_key_part may be changed) - - RETURN - 1 key is ok. - 0 Key can't be used - -1 Reverse key can be used -*****************************************************************************/ + @return indication if the key can be used for sorting + @retval 1 key can be used for reading data in order. + @retval 0 Key can't be used + @retval -1 Reverse read on the key can be used +*/ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, uint *used_key_parts) @@ -12172,11 +12171,27 @@ static int test_if_order_by_key(ORDER *order, TABLE *table, uint idx, reverse=flag; // Remember if reverse key_part++; } - *used_key_parts= on_primary_key ? table->key_info[idx].key_parts : - (uint) (key_part - table->key_info[idx].key_part); - if (reverse == -1 && !(table->file->index_flags(idx, *used_key_parts-1, 1) & - HA_READ_PREV)) - reverse= 0; // Index can't be used + if (on_primary_key) + { + uint used_key_parts_secondary= table->key_info[idx].key_parts; + uint used_key_parts_pk= + (uint) (key_part - table->key_info[table->s->primary_key].key_part); + *used_key_parts= used_key_parts_pk + used_key_parts_secondary; + + if (reverse == -1 && + (!(table->file->index_flags(idx, used_key_parts_secondary - 1, 1) & + HA_READ_PREV) || + !(table->file->index_flags(table->s->primary_key, + used_key_parts_pk - 1, 1) & HA_READ_PREV))) + reverse= 0; // Index can't be used + } + else + { + *used_key_parts= (uint) (key_part - table->key_info[idx].key_part); + if (reverse == -1 && + !(table->file->index_flags(idx, *used_key_parts-1, 1) & HA_READ_PREV)) + reverse= 0; // Index can't be used + } DBUG_RETURN(reverse); } From c199b9d51dbc72d0590a9d76dfc5113e01650b49 Mon Sep 17 00:00:00 2001 From: Horst Hunger Date: Wed, 23 Jul 2008 16:06:44 +0200 Subject: [PATCH 129/352] Final fix for bug#36522 in 5.1. This new fix was necessary due to fix of bug 37708. --- mysql-test/suite/sys_vars/README | 3 + .../sys_vars/inc/binlog_cache_size_basic.inc | 154 +++++++++++ .../inc/bulk_insert_buffer_size_basic.inc | 203 +++++++++++++++ .../inc/delayed_insert_limit_basic.inc | 167 ++++++++++++ .../sys_vars/inc/delayed_queue_size_basic.inc | 163 ++++++++++++ .../inc/innodb_concurrency_tickets_basic.inc | 147 +++++++++++ .../inc/innodb_max_purge_lag_basic.inc | 147 +++++++++++ .../inc/innodb_sync_spin_loops_basic.inc | 142 ++++++++++ .../sys_vars/inc/join_buffer_size_basic.inc | 216 ++++++++++++++++ .../sys_vars/inc/key_buffer_size_basic.inc | 187 ++++++++++++++ .../inc/key_cache_age_threshold_basic.inc | 180 +++++++++++++ .../inc/key_cache_block_size_basic.inc | 185 +++++++++++++ .../inc/key_cache_division_limit_basic.inc | 184 +++++++++++++ .../suite/sys_vars/inc/log_warnings_basic.inc | 210 +++++++++++++++ .../inc/max_binlog_cache_size_basic.inc | 187 ++++++++++++++ .../sys_vars/inc/max_connect_errors_basic.inc | 182 +++++++++++++ .../inc/max_heap_table_size_basic.inc | 222 ++++++++++++++++ .../sys_vars/inc/max_seeks_for_key_basic.inc | 213 +++++++++++++++ .../sys_vars/inc/max_tmp_tables_basic.inc | 227 ++++++++++++++++ .../inc/max_write_lock_count_basic.inc | 158 ++++++++++++ .../inc/min_examined_row_limit_basic.inc | 219 ++++++++++++++++ .../sys_vars/inc/multi_range_count_basic.inc | 219 ++++++++++++++++ .../inc/myisam_max_sort_file_size_basic.inc | 184 +++++++++++++ .../inc/myisam_repair_threads_basic.inc | 242 ++++++++++++++++++ .../inc/myisam_sort_buffer_size_basic.inc | 240 +++++++++++++++++ .../sys_vars/inc/net_retry_count_basic.inc | 217 ++++++++++++++++ .../inc/query_alloc_block_size_basic.inc | 225 ++++++++++++++++ .../sys_vars/inc/query_cache_limit_basic.inc | 178 +++++++++++++ .../inc/query_cache_min_res_unit_basic.inc | 187 ++++++++++++++ .../sys_vars/inc/query_cache_size_basic.inc | 175 +++++++++++++ .../inc/query_prealloc_size_basic.inc | 241 +++++++++++++++++ .../inc/range_alloc_block_size_basic.inc | 208 +++++++++++++++ .../sys_vars/inc/rpl_recovery_rank_basic.inc | 171 +++++++++++++ .../suite/sys_vars/inc/server_id_basic.inc | 190 ++++++++++++++ .../inc/slave_transaction_retries_basic.inc | 188 ++++++++++++++ .../sys_vars/inc/sort_buffer_size_basic.inc | 213 +++++++++++++++ .../suite/sys_vars/inc/sync_binlog_basic.inc | 156 +++++++++++ .../suite/sys_vars/inc/timestamp_basic.inc | 162 ++++++++++++ .../sys_vars/inc/tmp_table_size_basic.inc | 233 +++++++++++++++++ .../transaction_alloc_block_size_basic.inc | 240 +++++++++++++++++ .../inc/transaction_prealloc_size_basic.inc | 229 +++++++++++++++++ .../suite/sys_vars/inc/wait_timeout_basic.inc | 218 ++++++++++++++++ .../r/binlog_cache_size_basic_32.result | 102 ++++++++ .../r/binlog_cache_size_basic_64.result | 100 ++++++++ .../r/bulk_insert_buffer_size_basic_32.result | 154 +++++++++++ .../r/bulk_insert_buffer_size_basic_64.result | 150 +++++++++++ .../r/delayed_insert_limit_basic_32.result | 112 ++++++++ .../r/delayed_insert_limit_basic_64.result | 110 ++++++++ .../r/delayed_queue_size_basic_32.result | 110 ++++++++ .../r/delayed_queue_size_basic_64.result | 108 ++++++++ ...innodb_concurrency_tickets_basic_32.result | 100 ++++++++ ...innodb_concurrency_tickets_basic_64.result | 98 +++++++ .../r/innodb_max_purge_lag_basic_32.result | 94 +++++++ .../r/innodb_max_purge_lag_basic_64.result | 92 +++++++ .../r/innodb_sync_spin_loops_basic_32.result | 94 +++++++ .../r/innodb_sync_spin_loops_basic_64.result | 92 +++++++ .../r/join_buffer_size_basic_32.result | 198 ++++++++++++++ .../r/join_buffer_size_basic_64.result | 194 ++++++++++++++ .../r/key_buffer_size_basic_32.result | 111 ++++++++ .../r/key_buffer_size_basic_64.result | 111 ++++++++ .../r/key_cache_age_threshold_basic_32.result | 126 +++++++++ .../r/key_cache_age_threshold_basic_64.result | 126 +++++++++ .../r/key_cache_block_size_basic_32.result | 142 ++++++++++ .../r/key_cache_block_size_basic_64.result | 142 ++++++++++ .../key_cache_division_limit_basic_32.result | 139 ++++++++++ .../key_cache_division_limit_basic_64.result | 139 ++++++++++ .../sys_vars/r/log_warnings_basic_32.result | 162 ++++++++++++ .../sys_vars/r/log_warnings_basic_64.result | 158 ++++++++++++ .../r/max_binlog_cache_size_basic_32.result | 145 +++++++++++ .../r/max_binlog_cache_size_basic_64.result | 141 ++++++++++ .../r/max_connect_errors_basic_32.result | 137 ++++++++++ .../r/max_connect_errors_basic_64.result | 133 ++++++++++ .../r/max_heap_table_size_basic_32.result | 196 ++++++++++++++ .../r/max_heap_table_size_basic_64.result | 196 ++++++++++++++ .../r/max_seeks_for_key_basic_32.result | 180 +++++++++++++ .../r/max_seeks_for_key_basic_64.result | 176 +++++++++++++ .../sys_vars/r/max_tmp_tables_basic_32.result | 197 ++++++++++++++ .../sys_vars/r/max_tmp_tables_basic_64.result | 187 ++++++++++++++ .../r/max_write_lock_count_basic_32.result | 108 ++++++++ .../r/max_write_lock_count_basic_64.result | 104 ++++++++ .../r/min_examined_row_limit_basic_32.result | 180 +++++++++++++ .../r/min_examined_row_limit_basic_64.result | 174 +++++++++++++ .../r/multi_range_count_basic_32.result | 192 ++++++++++++++ .../r/multi_range_count_basic_64.result | 184 +++++++++++++ .../myisam_max_sort_file_size_basic_32.result | 114 +++++++++ .../myisam_max_sort_file_size_basic_64.result | 114 +++++++++ .../r/myisam_repair_threads_basic_32.result | 180 +++++++++++++ .../r/myisam_repair_threads_basic_64.result | 178 +++++++++++++ .../r/myisam_sort_buffer_size_basic_32.result | 184 +++++++++++++ .../r/myisam_sort_buffer_size_basic_64.result | 182 +++++++++++++ .../r/net_retry_count_basic_32.result | 192 ++++++++++++++ .../r/net_retry_count_basic_64.result | 184 +++++++++++++ .../r/query_alloc_block_size_basic_32.result | 203 +++++++++++++++ .../r/query_alloc_block_size_basic_64.result | 199 ++++++++++++++ .../r/query_cache_limit_basic_32.result | 126 +++++++++ .../r/query_cache_limit_basic_64.result | 120 +++++++++ .../query_cache_min_res_unit_basic_32.result | 134 ++++++++++ .../query_cache_min_res_unit_basic_64.result | 130 ++++++++++ .../r/query_cache_size_basic_32.result | 138 ++++++++++ .../r/query_cache_size_basic_64.result | 134 ++++++++++ .../r/query_prealloc_size_basic_32.result | 192 ++++++++++++++ .../r/query_prealloc_size_basic_64.result | 190 ++++++++++++++ .../r/range_alloc_block_size_basic_32.result | 182 +++++++++++++ .../r/range_alloc_block_size_basic_64.result | 178 +++++++++++++ .../r/rpl_recovery_rank_basic_32.result | 110 ++++++++ .../r/rpl_recovery_rank_basic_64.result | 104 ++++++++ .../sys_vars/r/server_id_basic_32.result | 117 +++++++++ .../sys_vars/r/server_id_basic_64.result | 115 +++++++++ .../slave_transaction_retries_basic_32.result | 119 +++++++++ .../slave_transaction_retries_basic_64.result | 115 +++++++++ .../r/sort_buffer_size_basic_32.result | 193 ++++++++++++++ .../r/sort_buffer_size_basic_64.result | 189 ++++++++++++++ .../sys_vars/r/sync_binlog_basic_32.result | 105 ++++++++ .../sys_vars/r/sync_binlog_basic_64.result | 105 ++++++++ .../sys_vars/r/timestamp_basic_32.result | 73 ++++++ .../sys_vars/r/timestamp_basic_64.result | 73 ++++++ .../sys_vars/r/tmp_table_size_basic_32.result | 172 +++++++++++++ .../sys_vars/r/tmp_table_size_basic_64.result | 172 +++++++++++++ ...ansaction_alloc_block_size_basic_32.result | 180 +++++++++++++ ...ansaction_alloc_block_size_basic_64.result | 176 +++++++++++++ .../transaction_prealloc_size_basic_32.result | 172 +++++++++++++ .../transaction_prealloc_size_basic_64.result | 170 ++++++++++++ .../sys_vars/r/wait_timeout_basic_32.result | 129 ++++++++++ .../sys_vars/r/wait_timeout_basic_64.result | 129 ++++++++++ .../t/binlog_cache_size_basic_32.test | 9 + .../t/binlog_cache_size_basic_64.test | 9 + .../t/bulk_insert_buffer_size_basic_32.test | 9 + .../t/bulk_insert_buffer_size_basic_64.test | 9 + .../t/delayed_insert_limit_basic_32.test | 9 + .../t/delayed_insert_limit_basic_64.test | 9 + .../t/delayed_queue_size_basic_32.test | 9 + .../t/delayed_queue_size_basic_64.test | 9 + .../innodb_concurrency_tickets_basic_32.test | 9 + .../innodb_concurrency_tickets_basic_64.test | 9 + .../t/innodb_max_purge_lag_basic_32.test | 9 + .../t/innodb_max_purge_lag_basic_64.test | 9 + .../t/innodb_sync_spin_loops_basic_32.test | 9 + .../t/innodb_sync_spin_loops_basic_64.test | 9 + .../sys_vars/t/join_buffer_size_basic_32.test | 9 + .../sys_vars/t/join_buffer_size_basic_64.test | 9 + .../sys_vars/t/key_buffer_size_basic_32.test | 9 + .../sys_vars/t/key_buffer_size_basic_64.test | 9 + .../t/key_cache_age_threshold_basic_32.test | 9 + .../t/key_cache_age_threshold_basic_64.test | 9 + .../t/key_cache_block_size_basic_32.test | 9 + .../t/key_cache_block_size_basic_64.test | 9 + .../t/key_cache_division_limit_basic_32.test | 9 + .../t/key_cache_division_limit_basic_64.test | 9 + .../sys_vars/t/log_warnings_basic_32.test | 9 + .../sys_vars/t/log_warnings_basic_64.test | 9 + .../t/max_binlog_cache_size_basic_32.test | 9 + .../t/max_binlog_cache_size_basic_64.test | 9 + .../t/max_connect_errors_basic_32.test | 9 + .../t/max_connect_errors_basic_64.test | 9 + .../t/max_heap_table_size_basic_32.test | 9 + .../t/max_heap_table_size_basic_64.test | 9 + .../t/max_seeks_for_key_basic_32.test | 9 + .../t/max_seeks_for_key_basic_64.test | 9 + .../sys_vars/t/max_tmp_tables_basic_32.test | 9 + .../sys_vars/t/max_tmp_tables_basic_64.test | 9 + .../t/max_write_lock_count_basic_32.test | 9 + .../t/max_write_lock_count_basic_64.test | 9 + .../t/min_examined_row_limit_basic_32.test | 9 + .../t/min_examined_row_limit_basic_64.test | 9 + .../t/multi_range_count_basic_32.test | 9 + .../t/multi_range_count_basic_64.test | 9 + .../t/myisam_max_sort_file_size_basic_32.test | 9 + .../t/myisam_max_sort_file_size_basic_64.test | 9 + .../t/myisam_repair_threads_basic_32.test | 9 + .../t/myisam_repair_threads_basic_64.test | 9 + .../t/myisam_sort_buffer_size_basic_32.test | 9 + .../t/myisam_sort_buffer_size_basic_64.test | 9 + .../sys_vars/t/net_retry_count_basic_32.test | 9 + .../sys_vars/t/net_retry_count_basic_64.test | 9 + .../t/query_alloc_block_size_basic_32.test | 9 + .../t/query_alloc_block_size_basic_64.test | 9 + .../t/query_cache_limit_basic_32.test | 9 + .../t/query_cache_limit_basic_64.test | 9 + .../t/query_cache_min_res_unit_basic_32.test | 9 + .../t/query_cache_min_res_unit_basic_64.test | 9 + .../sys_vars/t/query_cache_size_basic_32.test | 9 + .../sys_vars/t/query_cache_size_basic_64.test | 9 + .../t/query_prealloc_size_basic_32.test | 9 + .../t/query_prealloc_size_basic_64.test | 9 + .../t/range_alloc_block_size_basic_32.test | 9 + .../t/range_alloc_block_size_basic_64.test | 9 + .../t/rpl_recovery_rank_basic_32.test | 9 + .../t/rpl_recovery_rank_basic_64.test | 9 + .../suite/sys_vars/t/server_id_basic_32.test | 9 + .../suite/sys_vars/t/server_id_basic_64.test | 9 + .../t/slave_transaction_retries_basic_32.test | 9 + .../t/slave_transaction_retries_basic_64.test | 9 + .../sys_vars/t/sort_buffer_size_basic_32.test | 9 + .../sys_vars/t/sort_buffer_size_basic_64.test | 9 + .../sys_vars/t/sync_binlog_basic_32.test | 9 + .../sys_vars/t/sync_binlog_basic_64.test | 9 + .../suite/sys_vars/t/timestamp_basic_32.test | 9 + .../suite/sys_vars/t/timestamp_basic_64.test | 9 + .../sys_vars/t/tmp_table_size_basic_32.test | 9 + .../sys_vars/t/tmp_table_size_basic_64.test | 9 + ...transaction_alloc_block_size_basic_32.test | 9 + ...transaction_alloc_block_size_basic_64.test | 9 + .../t/transaction_prealloc_size_basic_32.test | 9 + .../t/transaction_prealloc_size_basic_64.test | 9 + .../sys_vars/t/wait_timeout_basic_32.test | 9 + .../sys_vars/t/wait_timeout_basic_64.test | 9 + 206 files changed, 20616 insertions(+) create mode 100644 mysql-test/suite/sys_vars/README create mode 100644 mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/log_warnings_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/server_id_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/timestamp_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc create mode 100644 mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc create mode 100644 mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/log_warnings_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/log_warnings_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/server_id_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/server_id_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/timestamp_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/timestamp_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result create mode 100644 mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result create mode 100644 mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result create mode 100644 mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/log_warnings_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/log_warnings_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/server_id_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/server_id_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/timestamp_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/timestamp_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test create mode 100644 mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test create mode 100644 mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test diff --git a/mysql-test/suite/sys_vars/README b/mysql-test/suite/sys_vars/README new file mode 100644 index 00000000000..a84f00f1f62 --- /dev/null +++ b/mysql-test/suite/sys_vars/README @@ -0,0 +1,3 @@ +Some of these tests allocate more than 4GB RAM. +So, assure that the machine on which the suite will be executed has more than 4GB RAM. + diff --git a/mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc new file mode 100644 index 00000000000..323e19c4d66 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/binlog_cache_size_basic.inc @@ -0,0 +1,154 @@ +################# mysql-test\t\binlog_cache_size_basic.test #################### +# # +# Variable Name: binlog_cache_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 32768 # +# Range: 4096 - 4294967295 # +# # +# # +# Creation Date: 2008-04-28 # +# Author: Salman Rawala/Horst Hunger # +# # +# Description: Test Cases of Dynamic System Variable "binlog_cache_size" # +# that checks behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity . # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_binlog_cache_size # +# # +################################################################################ + +################################################################# +# START OF binlog_cache_size TESTS # +################################################################# + +######################################################################### +# Saving initial value of binlog_cache_size in a temporary variable # +######################################################################### + +SET @start_value = @@global.binlog_cache_size; +SELECT @start_value; + +--echo '#--------------------FN_DYNVARS_006_01------------------------#' +######################################################################### +# Display the DEFAULT value of binlog_cache_size # +######################################################################### + +SET @@global.binlog_cache_size = 100; +SET @@global.binlog_cache_size = DEFAULT; +SELECT @@global.binlog_cache_size; + + +--echo '#---------------------FN_DYNVARS_006_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.binlog_cache_size = @start_value; +SELECT @@global.binlog_cache_size = 32768; + + +--echo '#--------------------FN_DYNVARS_006_03------------------------#' +######################################################################### +# Change the value of binlog_cache_size to a valid value # +######################################################################### + +SET @@global.binlog_cache_size = 4096; +SELECT @@global.binlog_cache_size; +SET @@global.binlog_cache_size = 4294967295; +SELECT @@global.binlog_cache_size; +SET @@global.binlog_cache_size = 10000; +SELECT @@global.binlog_cache_size; +SET @@global.binlog_cache_size = 21221204; +SELECT @@global.binlog_cache_size; +echo 'Bug: Invalid values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_006_04-------------------------#' +############################################################################ +# Change the value of binlog_cache_size to invalid value # +############################################################################ + +SET @@global.binlog_cache_size = 1024; +SELECT @@global.binlog_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.binlog_cache_size = 10000.01; +SET @@global.binlog_cache_size = -1024; +SELECT @@global.binlog_cache_size; +SET @@global.binlog_cache_size = 42949672950; +SELECT @@global.binlog_cache_size; +echo 'Bug: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.binlog_cache_size = ON; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.binlog_cache_size = 'test'; + + +--echo '#-------------------FN_DYNVARS_006_05----------------------------#' +############################################################################ +# Test if accessing session binlog_cache_size gives error # +############################################################################ + +--Error ER_GLOBAL_VARIABLE +SET @@session.binlog_cache_size = 0; + + +--echo '#----------------------FN_DYNVARS_006_06------------------------#' +############################################################################## +# Check if the value in GLOBAL Tables matches values in variable # +############################################################################## + +SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size'; + +--echo '#---------------------FN_DYNVARS_006_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.binlog_cache_size = TRUE; +SELECT @@global.binlog_cache_size; +SET @@global.binlog_cache_size = FALSE; +SELECT @@global.binlog_cache_size; +echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; + +--echo '#---------------------FN_DYNVARS_006_08----------------------#' +############################################################################### +# Check if accessing variable without SCOPE points to same global variable # +############################################################################### + +SET @@global.binlog_cache_size = 1; +SELECT @@binlog_cache_size = @@global.binlog_cache_size; + +--echo '#---------------------FN_DYNVARS_006_09----------------------#' +########################################################################### +# Check if binlog_cache_size can be accessed with and without @@ sign # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET binlog_cache_size = 1; +--Error ER_PARSE_ERROR +SET global.binlog_cache_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.binlog_cache_size; +--Error ER_BAD_FIELD_ERROR +SELECT binlog_cache_size = @@session.binlog_cache_size; + + +############################## +# Restore initial value # +############################## + +SET @@global.binlog_cache_size = @start_value; +SELECT @@global.binlog_cache_size; + + +########################################################### +# END OF binlog_cache_size TESTS # +########################################################### diff --git a/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc new file mode 100644 index 00000000000..56ffbace173 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc @@ -0,0 +1,203 @@ +############## mysql-test\t\bulk_insert_buffer_size_basic.test ################# +# # +# Variable Name: bulk_insert_buffer_size # +# Scope: GLOBAL & SESSION # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 8388608 # +# Range: 0 - 4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman Rawala # +# # +# Description: Test Cases of Dynamic System Variable "bulk_insert_buffer_size" # +# that checks behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity . # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_bulk_insert_buffer_size # +# # +################################################################################ + +--source include/load_sysvars.inc + +####################################################################### +# START OF bulk_insert_buffer_size TESTS # +####################################################################### + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.bulk_insert_buffer_size; +SELECT @start_global_value; +SET @start_session_value = @@session.bulk_insert_buffer_size; +SELECT @start_session_value; + +--echo '#--------------------FN_DYNVARS_007_01-------------------------#' +####################################################################### +# Display the DEFAULT value of bulk_insert_buffer_size # +####################################################################### + +SET @@global.bulk_insert_buffer_size = 100; +SET @@global.bulk_insert_buffer_size = DEFAULT; +SELECT @@global.bulk_insert_buffer_size; + +SET @@session.bulk_insert_buffer_size = 200; +SET @@session.bulk_insert_buffer_size = DEFAULT; +SELECT @@session.bulk_insert_buffer_size; + + +--echo '#--------------------FN_DYNVARS_007_02-------------------------#' +####################################################################### +# Check the DEFAULT value of bulk_insert_buffer_size # +####################################################################### + +SET @@global.bulk_insert_buffer_size = @start_global_value; +SELECT @@global.bulk_insert_buffer_size = 8388608; + +SET @@session.bulk_insert_buffer_size = @start_session_value; +SELECT @@session.bulk_insert_buffer_size = 8388608; + + +--echo '#--------------------FN_DYNVARS_007_03-------------------------#' +############################################################################### +#Change the value of bulk_insert_buffer_size to valid values for GLOBAL Scope # +############################################################################### + +SET @@global.bulk_insert_buffer_size = 0; +SELECT @@global.bulk_insert_buffer_size; +SET @@global.bulk_insert_buffer_size = 1; +SELECT @@global.bulk_insert_buffer_size; +SET @@global.bulk_insert_buffer_size = 4294967295; +SELECT @@global.bulk_insert_buffer_size; +SET @@global.bulk_insert_buffer_size = 429496; +SELECT @@global.bulk_insert_buffer_size; + + +--echo '#--------------------FN_DYNVARS_007_04-------------------------#' +############################################################################### +#Change the value of bulk_insert_buffer_size to valid values for SESSION Scope# +############################################################################### + +SET @@session.bulk_insert_buffer_size = 0; +SELECT @@session.bulk_insert_buffer_size; +SET @@session.bulk_insert_buffer_size = 1; +SELECT @@session.bulk_insert_buffer_size; +SET @@session.bulk_insert_buffer_size = 4294967295; +SELECT @@session.bulk_insert_buffer_size; +SET @@session.bulk_insert_buffer_size = 429496; +SELECT @@session.bulk_insert_buffer_size; + + +--echo '#------------------FN_DYNVARS_007_05-----------------------#' +################################################################### +# Change the value of bulk_insert_buffer_size to an invalid value # +################################################################### + +SET @@global.bulk_insert_buffer_size = 42949672950; +SELECT @@global.bulk_insert_buffer_size; +SET @@global.bulk_insert_buffer_size = -1024; +SELECT @@global.bulk_insert_buffer_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.bulk_insert_buffer_size = test; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.bulk_insert_buffer_size = ON; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.bulk_insert_buffer_size = 429496.10; + +SET @@session.bulk_insert_buffer_size = 42949672950; +SELECT @@session.bulk_insert_buffer_size; +SET @@session.bulk_insert_buffer_size = -2; +SELECT @@session.bulk_insert_buffer_size; +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.bulk_insert_buffer_size = test; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.bulk_insert_buffer_size = 429496.10; + + +--echo '#------------------FN_DYNVARS_007_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='bulk_insert_buffer_size'; + +--echo '#------------------FN_DYNVARS_007_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='bulk_insert_buffer_size'; + + +--echo '#------------------FN_DYNVARS_007_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.bulk_insert_buffer_size = TRUE; +SELECT @@global.bulk_insert_buffer_size; +SET @@global.bulk_insert_buffer_size = FALSE; +SELECT @@global.bulk_insert_buffer_size; + +SET @@session.bulk_insert_buffer_size = TRUE; +SELECT @@session.bulk_insert_buffer_size; +SET @@session.bulk_insert_buffer_size = FALSE; +SELECT @@session.bulk_insert_buffer_size; + + +--echo '#---------------------FN_DYNVARS_007_09----------------------#' +############################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points # +# to same session variable # +############################################################################## + +SET @@bulk_insert_buffer_size = 100; +SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size; +SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; + + +--echo '#---------------------FN_DYNVARS_007_10----------------------#' +############################################################################### +# Check if bulk_insert_buffer_size can be accessed with and without @@ sign # +############################################################################### + +SET bulk_insert_buffer_size = 1; +SELECT @@bulk_insert_buffer_size; +--Error ER_PARSE_ERROR +SET local.bulk_insert_buffer_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT local.bulk_insert_buffer_size; +--Error ER_PARSE_ERROR +SET session.bulk_insert_buffer_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT session.bulk_insert_buffer_size; +--Error ER_BAD_FIELD_ERROR +SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.bulk_insert_buffer_size = @start_global_value; +SELECT @@global.bulk_insert_buffer_size; +SET @@session.bulk_insert_buffer_size = @start_session_value; +SELECT @@session.bulk_insert_buffer_size; + + +#################################################### +# END OF bulk_insert_buffer_size TESTS # +#################################################### diff --git a/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc new file mode 100644 index 00000000000..ab158bc593e --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/delayed_insert_limit_basic.inc @@ -0,0 +1,167 @@ +############### mysql-test\t\delayed_insert_limit_basic.test ################### +# # +# Variable Name: delayed_insert_limit # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 100 # +# Range: 1 - 4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman Rawala # +# # +# Description: Test Cases of Dynamic System Variable "delayed_insert_limit" # +# that checks behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_delayed_insert_limit # +# # +################################################################################ + +--source include/load_sysvars.inc + +################################################################# +# START OF delayed_insert_limit TESTS # +################################################################# + +######################################################################### +# Saving initial value of delayed_insert_limit in a temporary variable # +######################################################################### + +SET @start_value = @@global.delayed_insert_limit; +SELECT @start_value; + +--echo '#--------------------FN_DYNVARS_024_01------------------------#' +######################################################################### +# Display the DEFAULT value of delayed_insert_limit # +######################################################################### + +SET @@global.delayed_insert_limit = 100; +SET @@global.delayed_insert_limit = DEFAULT; +SELECT @@global.delayed_insert_limit; + + +--echo '#---------------------FN_DYNVARS_024_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.delayed_insert_limit = @start_value; +SELECT @@global.delayed_insert_limit = 100; + + +--echo '#--------------------FN_DYNVARS_024_03------------------------#' +######################################################################### +# Change the value of delayed_insert_limit to a valid value # +######################################################################### + +SET @@global.delayed_insert_limit = 10000; +SELECT @@global.delayed_insert_limit; +SET @@global.delayed_insert_limit = 4294967295; +SELECT @@global.delayed_insert_limit; +SET @@global.delayed_insert_limit = 1; +SELECT @@global.delayed_insert_limit; + + +--echo '#--------------------FN_DYNVARS_024_04-------------------------#' +############################################################################ +# Change the value of delayed_insert_limit to invalid value # +############################################################################ + +SET @@global.delayed_insert_limit = 0; +SELECT @@global.delayed_insert_limit; +SET @@global.delayed_insert_limit = -1024; +SELECT @@global.delayed_insert_limit; +SET @@global.delayed_insert_limit = 42949672950; +SELECT @@global.delayed_insert_limit; +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.delayed_insert_limit = 429496729.5; +SELECT @@global.delayed_insert_limit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.delayed_insert_limit = ON; +SELECT @@global.delayed_insert_limit; + + + +--echo '#-------------------FN_DYNVARS_024_05----------------------------#' +############################################################################ +# Test if accessing session delayed_insert_limit gives error # +############################################################################ + +--Error ER_GLOBAL_VARIABLE +SET @@session.delayed_insert_limit = 0; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@Session.delayed_insert_limit; + + +--echo '#----------------------FN_DYNVARS_024_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.delayed_insert_limit = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='delayed_insert_limit'; + +SELECT @@delayed_insert_limit = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES + WHERE VARIABLE_NAME='delayed_insert_limit'; + + +--echo '#---------------------FN_DYNVARS_024_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.delayed_insert_limit = TRUE; +SELECT @@global.delayed_insert_limit; +SET @@global.delayed_insert_limit = FALSE; +SELECT @@global.delayed_insert_limit; + +--echo '#---------------------FN_DYNVARS_024_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.delayed_insert_limit = 1; +SELECT @@delayed_insert_limit = @@global.delayed_insert_limit; + + +--echo '#---------------------FN_DYNVARS_024_09----------------------#' +############################################################################## +# Check if delayed_insert_limit can be accessed with and without @@ sign # +############################################################################## + +--Error ER_GLOBAL_VARIABLE +SET delayed_insert_limit = 1; +SELECT @@delayed_insert_limit; +--Error ER_PARSE_ERROR +SET local.delayed_insert_limit = 1; +--Error ER_UNKNOWN_TABLE +SELECT local.delayed_insert_limit; +--Error ER_PARSE_ERROR +SET global.delayed_insert_limit = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.delayed_insert_limit; +--Error ER_BAD_FIELD_ERROR +SELECT delayed_insert_limit = @@session.delayed_insert_limit; + +############################## +# Restore initial value # +############################## + +SET @@global.delayed_insert_limit = @start_value; +SELECT @@global.delayed_insert_limit; + + +########################################################### +# END OF delayed_insert_limit TESTS # +########################################################### + diff --git a/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc new file mode 100644 index 00000000000..2d16f75d4e1 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/delayed_queue_size_basic.inc @@ -0,0 +1,163 @@ +################# mysql-test\t\delayed_queue_size_basic.test ################### +# # +# Variable Name: delayed_queue_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 1000 # +# Range: 1 - 4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman Rawala # +# # +# Description: Test Cases of Dynamic System Variable "delayed_queue_size" # +# that checks behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity . # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_delayed_queue_size # +# # +################################################################################ + +--source include/load_sysvars.inc + +################################################################# +# START OF delayed_queue_size TESTS # +################################################################# + +######################################################################### +# Saving initial value of delayed_queue_size in a temporary variable # +######################################################################### + +SET @start_value = @@global.delayed_queue_size; +SELECT @start_value; + +--echo '#--------------------FN_DYNVARS_026_01------------------------#' +######################################################################### +# Display the DEFAULT value of delayed_queue_size # +######################################################################### + +SET @@global.delayed_queue_size = 100; +SET @@global.delayed_queue_size = DEFAULT; +SELECT @@global.delayed_queue_size; + +--echo '#---------------------FN_DYNVARS_026_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.delayed_queue_size = @start_value; +SELECT @@global.delayed_queue_size = 1000; + +--echo '#--------------------FN_DYNVARS_026_03------------------------#' +######################################################################### +# Change the value of delayed_queue_size to a valid value # +######################################################################### + +SET @@global.delayed_queue_size = 10000; +SELECT @@global.delayed_queue_size; +SET @@global.delayed_queue_size = 4294967295; +SELECT @@global.delayed_queue_size; +SET @@global.delayed_queue_size = 1; +SELECT @@global.delayed_queue_size; + + +--echo '#--------------------FN_DYNVARS_026_04-------------------------#' +############################################################################ +# Change the value of delayed_queue_size to invalid value # +############################################################################ + +SET @@global.delayed_queue_size = 0; +SELECT @@global.delayed_queue_size; +SET @@global.delayed_queue_size = -1024; +SELECT @@global.delayed_queue_size; +SET @@global.delayed_queue_size = 42949672950; +SELECT @@global.delayed_queue_size; +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.delayed_queue_size = 429496729.5; +SELECT @@global.delayed_queue_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.delayed_queue_size = ON; +SELECT @@delayed_queue_size; + +--echo '#-------------------FN_DYNVARS_026_05----------------------------#' +############################################################################ +# Test if accessing session delayed_queue_size gives error # +############################################################################ + +--Error 1229 +SET @@session.delayed_queue_size = 0; +--Error 1238 +SELECT @@session.delayed_queue_size; + +--echo '#----------------------FN_DYNVARS_026_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.delayed_queue_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='delayed_queue_size'; + +SELECT @@delayed_queue_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='delayed_queue_size'; + + +--echo '#---------------------FN_DYNVARS_026_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.delayed_queue_size = TRUE; +SELECT @@global.delayed_queue_size; +SET @@global.delayed_queue_size = FALSE; +SELECT @@global.delayed_queue_size; + +--echo '#---------------------FN_DYNVARS_026_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.delayed_queue_size = 1; +SELECT @@delayed_queue_size = @@global.delayed_queue_size; + + +--echo '#---------------------FN_DYNVARS_026_09----------------------#' +########################################################################### +# Check if delayed_queue_size can be accessed with and without @@ sign # +########################################################################### + +--Error 1229 +SET delayed_queue_size = 1; +SELECT @@delayed_queue_size; +--Error ER_PARSE_ERROR +SET local.delayed_queue_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT local.delayed_queue_size; +--Error ER_PARSE_ERROR +SET global.delayed_queue_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.delayed_queue_size; +--Error ER_BAD_FIELD_ERROR +SELECT delayed_queue_size = @@session.delayed_queue_size; + + +############################## +# Restore initial value # +############################## + +SET @@global.delayed_queue_size = @start_value; +SELECT @@global.delayed_queue_size; + + +########################################################### +# END OF delayed_queue_size TESTS # +########################################################### + diff --git a/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc b/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc new file mode 100644 index 00000000000..67b0247d169 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc @@ -0,0 +1,147 @@ +################# mysql-test\t\innodb_concurrency_tickets_basic.test ########## +# # +# Variable Name: innodb_concurrency_tickets # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 500 # +# Range: 1-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +#Description:Test Cases of Dynamic System Variable innodb_concurrency_tickets # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_innodb.inc +--source include/load_sysvars.inc + +######################################################################## +# START OF innodb_concurrency_tickets TESTS # +######################################################################## + + +################################################################################ +# Saving initial value of innodb_concurrency_tickets in a temporary variable # +################################################################################ + +SET @global_start_value = @@global.innodb_concurrency_tickets; +SELECT @global_start_value; + +--echo '#--------------------FN_DYNVARS_046_01------------------------#' +######################################################################## +# Display the DEFAULT value of innodb_concurrency_tickets # +######################################################################## + +SET @@global.innodb_concurrency_tickets = 0; +SET @@global.innodb_concurrency_tickets = DEFAULT; +SELECT @@global.innodb_concurrency_tickets; + +--echo '#---------------------FN_DYNVARS_046_02-------------------------#' +################################################################################ +# Check if innodb_concurrency_tickets can be accessed with and without @@ sign # +################################################################################ + +--Error ER_GLOBAL_VARIABLE +SET innodb_concurrency_tickets = 1; +SELECT @@innodb_concurrency_tickets; + +--Error ER_UNKNOWN_TABLE +SELECT local.innodb_concurrency_tickets; + + +SET global innodb_concurrency_tickets = 0; +SELECT @@global.innodb_concurrency_tickets; + + +--echo '#--------------------FN_DYNVARS_046_03------------------------#' +########################################################################## +# change the value of innodb_concurrency_tickets to a valid value # +########################################################################## + + +SET @@global.innodb_concurrency_tickets = 1; +SELECT @@global.innodb_concurrency_tickets; + +SET @@global.innodb_concurrency_tickets = 1000; +SELECT @@global.innodb_concurrency_tickets; + +SET @@global.innodb_concurrency_tickets = 4294967295; +SELECT @@global.innodb_concurrency_tickets; + + +--echo '#--------------------FN_DYNVARS_046_04-------------------------#' +########################################################################### +# Change the value of innodb_concurrency_tickets to invalid value # +########################################################################### + +SET @@global.innodb_concurrency_tickets = -1; +SELECT @@global.innodb_concurrency_tickets; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_concurrency_tickets = "T"; +SELECT @@global.innodb_concurrency_tickets; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_concurrency_tickets = "Y"; +SELECT @@global.innodb_concurrency_tickets; + +SET @@global.innodb_concurrency_tickets = 1001; +SELECT @@global.innodb_concurrency_tickets; + +--echo '#----------------------FN_DYNVARS_046_05------------------------#' +######################################################################### +# Check if the value in GLOBAL Table matches value in variable # +######################################################################### + +SELECT @@global.innodb_concurrency_tickets = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_concurrency_tickets'; +SELECT @@global.innodb_concurrency_tickets; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_concurrency_tickets'; + +--echo '#---------------------FN_DYNVARS_046_06-------------------------#' +################################################################### +# Check if ON and OFF values can be used on variable # +################################################################### + +--ERROR ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_concurrency_tickets = OFF; +SELECT @@global.innodb_concurrency_tickets; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_concurrency_tickets = ON; +SELECT @@global.innodb_concurrency_tickets; + +--echo '#---------------------FN_DYNVARS_046_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.innodb_concurrency_tickets = TRUE; +SELECT @@global.innodb_concurrency_tickets; +SET @@global.innodb_concurrency_tickets = FALSE; +SELECT @@global.innodb_concurrency_tickets; + +############################## +# Restore initial value # +############################## + +SET @@global.innodb_concurrency_tickets = @global_start_value; +SELECT @@global.innodb_concurrency_tickets; + +############################################################### +# END OF innodb_concurrency_tickets TESTS # +############################################################### + diff --git a/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc b/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc new file mode 100644 index 00000000000..9e6b8201e3d --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/innodb_max_purge_lag_basic.inc @@ -0,0 +1,147 @@ +################# mysql-test\t\innodb_max_purge_lag_basic.test ################ +# # +# Variable Name: innodb_max_purge_lag # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 0 # +# Range: 0-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +#Description:Test Cases of Dynamic System Variable innodb_max_purge_lag # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_innodb.inc +--source include/load_sysvars.inc + +######################################################################## +# START OF innodb_max_purge_lag TESTS # +######################################################################## + +################################################################################ +# Saving initial value of innodb_max_purge_lag in a temporary variable # +################################################################################ + +SET @global_start_value = @@global.innodb_max_purge_lag; +SELECT @global_start_value; + +--echo '#--------------------FN_DYNVARS_046_01------------------------#' +######################################################################## +# Display the DEFAULT value of innodb_max_purge_lag # +######################################################################## + +SET @@global.innodb_max_purge_lag = 0; +SET @@global.innodb_max_purge_lag = DEFAULT; +SELECT @@global.innodb_max_purge_lag; + +--echo '#---------------------FN_DYNVARS_046_02-------------------------#' +############################################################################ +# Check if innodb_max_purge_lag can be accessed with and without @@ sign # +############################################################################ + +--Error ER_GLOBAL_VARIABLE +SET innodb_max_purge_lag = 1; +SELECT @@innodb_max_purge_lag; + +--Error ER_UNKNOWN_TABLE +SELECT local.innodb_max_purge_lag; + +SET global innodb_max_purge_lag = 0; +SELECT @@global.innodb_max_purge_lag; + +--echo '#--------------------FN_DYNVARS_046_03------------------------#' +########################################################################## +# change the value of innodb_max_purge_lag to a valid value # +########################################################################## + + +SET @@global.innodb_max_purge_lag = 0; +SELECT @@global.innodb_max_purge_lag; + +SET @@global.innodb_max_purge_lag = 1; +SELECT @@global.innodb_max_purge_lag; +SET @@global.innodb_max_purge_lag = 4294967295; +SELECT @@global.innodb_max_purge_lag; + +--echo '#--------------------FN_DYNVARS_046_04-------------------------#' +########################################################################### +# Change the value of innodb_max_purge_lag to invalid value # +########################################################################### + +SET @@global.innodb_max_purge_lag = -1; +SELECT @@global.innodb_max_purge_lag; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_max_purge_lag = "T"; +SELECT @@global.innodb_max_purge_lag; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_max_purge_lag = "Y"; +SELECT @@global.innodb_max_purge_lag; + + +SET @@global.innodb_max_purge_lag = 1001; +SELECT @@global.innodb_max_purge_lag; + +--echo '#----------------------FN_DYNVARS_046_05------------------------#' +######################################################################### +# Check if the value in GLOBAL Table matches value in variable # +######################################################################### + +SELECT @@global.innodb_max_purge_lag = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_max_purge_lag'; +SELECT @@global.innodb_max_purge_lag; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_max_purge_lag'; + + + + +--echo '#---------------------FN_DYNVARS_046_06-------------------------#' +################################################################### +# Check if ON and OFF values can be used on variable # +################################################################### + +--ERROR ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_max_purge_lag = OFF; +SELECT @@global.innodb_max_purge_lag; + +--ERROR ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_max_purge_lag = ON; +SELECT @@global.innodb_max_purge_lag; + +--echo '#---------------------FN_DYNVARS_046_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + + +SET @@global.innodb_max_purge_lag = TRUE; +SELECT @@global.innodb_max_purge_lag; +SET @@global.innodb_max_purge_lag = FALSE; +SELECT @@global.innodb_max_purge_lag; + +############################## +# Restore initial value # +############################## + + +SET @@global.innodb_max_purge_lag = @global_start_value; +SELECT @@global.innodb_max_purge_lag; + +############################################################### +# END OF innodb_max_purge_lag TESTS # +############################################################### diff --git a/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc b/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc new file mode 100644 index 00000000000..35460fe47f2 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc @@ -0,0 +1,142 @@ +################# mysql-test\t\innodb_sync_spin_loops_basic.test ############## +# # +# Variable Name: innodb_sync_spin_loops # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 20 # +# Range: 0-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +#Description:Test Cases of Dynamic System Variable innodb_sync_spin_loops # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_innodb.inc +--source include/load_sysvars.inc + +######################################################################## +# START OF innodb_sync_spin_loops TESTS # +######################################################################## + + +############################################################################ +# Saving initial value of innodb_sync_spin_loops in a temporary variable # +############################################################################ + +SET @global_start_value = @@global.innodb_sync_spin_loops; +SELECT @global_start_value; + +--echo '#--------------------FN_DYNVARS_046_01------------------------#' +######################################################################## +# Display the DEFAULT value of innodb_sync_spin_loops # +######################################################################## + +SET @@global.innodb_sync_spin_loops = 0; +SET @@global.innodb_sync_spin_loops = DEFAULT; +SELECT @@global.innodb_sync_spin_loops; + +--echo '#---------------------FN_DYNVARS_046_02-------------------------#' +############################################################################## +# Check if innodb_sync_spin_loops can be accessed with and without @@ sign # +############################################################################## + +--Error ER_GLOBAL_VARIABLE +SET innodb_sync_spin_loops = 1; +SELECT @@innodb_sync_spin_loops; + +--Error ER_UNKNOWN_TABLE +SELECT local.innodb_sync_spin_loops; + +SET global innodb_sync_spin_loops = 0; +SELECT @@global.innodb_sync_spin_loops; + +--echo '#--------------------FN_DYNVARS_046_03------------------------#' +########################################################################## +# change the value of innodb_sync_spin_loops to a valid value # +########################################################################## + +SET @@global.innodb_sync_spin_loops = 0; +SELECT @@global.innodb_sync_spin_loops; + +SET @@global.innodb_sync_spin_loops = 1; +SELECT @@global.innodb_sync_spin_loops; +SET @@global.innodb_sync_spin_loops = 1000; +SELECT @@global.innodb_sync_spin_loops; + +--echo '#--------------------FN_DYNVARS_046_04-------------------------#' +########################################################################### +# Change the value of innodb_sync_spin_loops to invalid value # +########################################################################### + +SET @@global.innodb_sync_spin_loops = -1; +SELECT @@global.innodb_sync_spin_loops; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_sync_spin_loops = "T"; +SELECT @@global.innodb_sync_spin_loops; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_sync_spin_loops = "Y"; +SELECT @@global.innodb_sync_spin_loops; + +SET @@global.innodb_sync_spin_loops = 1001; +SELECT @@global.innodb_sync_spin_loops; + +--echo '#----------------------FN_DYNVARS_046_05------------------------#' +######################################################################### +# Check if the value in GLOBAL Table matches value in variable # +######################################################################### + +SELECT @@global.innodb_sync_spin_loops = + VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_sync_spin_loops'; +SELECT @@global.innodb_sync_spin_loops; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_sync_spin_loops'; + +--echo '#---------------------FN_DYNVARS_046_06-------------------------#' +################################################################### +# Check if ON and OFF values can be used on variable # +################################################################### + +--ERROR ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_sync_spin_loops = OFF; +SELECT @@global.innodb_sync_spin_loops; + +--ERROR ER_WRONG_TYPE_FOR_VAR +SET @@global.innodb_sync_spin_loops = ON; +SELECT @@global.innodb_sync_spin_loops; + +--echo '#---------------------FN_DYNVARS_046_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + + +SET @@global.innodb_sync_spin_loops = TRUE; +SELECT @@global.innodb_sync_spin_loops; +SET @@global.innodb_sync_spin_loops = FALSE; +SELECT @@global.innodb_sync_spin_loops; + +############################## +# Restore initial value # +############################## + +SET @@global.innodb_sync_spin_loops = @global_start_value; +SELECT @@global.innodb_sync_spin_loops; + +############################################################### +# END OF innodb_sync_spin_loops TESTS # +############################################################### diff --git a/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc new file mode 100644 index 00000000000..880dac4cac4 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/join_buffer_size_basic.inc @@ -0,0 +1,216 @@ +############## mysql-test\t\join_buffer_size_basic.test ############### +# # +# Variable Name: join_buffer_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 131072 # +# Range: 8200-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable join_buffer_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +################################################################ +# START OF join_buffer_size TESTS # +################################################################ + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.join_buffer_size; +SELECT @start_global_value; +SET @start_session_value = @@session.join_buffer_size; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_053_01-------------------------#' +################################################################ +# Display the DEFAULT value of join_buffer_size # +################################################################ + +SET @@global.join_buffer_size = 8200; +SET @@global.join_buffer_size = DEFAULT; +SELECT @@global.join_buffer_size; + +SET @@session.join_buffer_size = 8200; +SET @@session.join_buffer_size = DEFAULT; +SELECT @@session.join_buffer_size; + + +--echo '#--------------------FN_DYNVARS_053_02-------------------------#' +################################################################### +# Check the DEFAULT value of join_buffer_size # +################################################################### + +SET @@global.join_buffer_size = DEFAULT; +SELECT @@global.join_buffer_size = 131072; + +SET @@session.join_buffer_size = DEFAULT; +SELECT @@session.join_buffer_size = 131072; + + +--echo '#--------------------FN_DYNVARS_053_03-------------------------#' +########################################################################## +# Change the value of join_buffer_size to a valid value for GLOBAL Scope # +########################################################################## + +SET @@global.join_buffer_size = 8200; +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SET @@global.join_buffer_size = 65536; +SELECT @@global.join_buffer_size; +SET @@global.join_buffer_size = 4294967295; +SELECT @@global.join_buffer_size; +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + + +--echo '#--------------------FN_DYNVARS_053_04-------------------------#' +########################################################################### +# Change the value of join_buffer_size to a valid value for SESSION Scope # +########################################################################### + +SET @@session.join_buffer_size = 8200; +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +SET @@session.join_buffer_size = 65536; +SELECT @@session.join_buffer_size; +SET @@session.join_buffer_size = 4294967295; +SELECT @@session.join_buffer_size; +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + + +--echo '#------------------FN_DYNVARS_053_05-----------------------#' +############################################################ +# Change the value of join_buffer_size to an invalid value # +############################################################ + +SET @@global.join_buffer_size = 0; +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SET @@global.join_buffer_size = -1024; +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SET @@global.join_buffer_size = 8199; +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SET @@global.join_buffer_size = 42949672951; +SELECT @@global.join_buffer_size; + +--Error ER_PARSE_ERROR +SET @@global.join_buffer_size = 65530.34.; +SELECT @@global.join_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.join_buffer_size = test; +SELECT @@global.join_buffer_size; + +SET @@session.join_buffer_size = 0; +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +SET @@session.join_buffer_size = -2; +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +SET @@session.join_buffer_size = 8199; +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +SET @@session.join_buffer_size = 42949672951; +SELECT @@session.join_buffer_size; + +--Error ER_PARSE_ERROR +SET @@session.join_buffer_size = 65530.34.; +SELECT @@session.join_buffer_size; +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.join_buffer_size = test; +SELECT @@session.join_buffer_size; + + +--echo '#------------------FN_DYNVARS_053_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.join_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='join_buffer_size'; + +--echo '#------------------FN_DYNVARS_053_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.join_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='join_buffer_size'; + + +--echo '#------------------FN_DYNVARS_053_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.join_buffer_size = TRUE; +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +SET @@global.join_buffer_size = FALSE; +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +--echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.join_buffer_size = 10; +SELECT @@join_buffer_size = @@global.join_buffer_size; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@join_buffer_size = 100; +SELECT @@join_buffer_size = @@local.join_buffer_size; +SELECT @@local.join_buffer_size = @@session.join_buffer_size; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +############################################################################## +# Check if join_buffer_size can be accessed with and without @@ sign # +############################################################################## + +SET join_buffer_size = 1; +SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228; +--Error ER_UNKNOWN_TABLE +SELECT local.join_buffer_size; +--Error ER_UNKNOWN_TABLE +SELECT session.join_buffer_size; +--Error ER_BAD_FIELD_ERROR +SELECT join_buffer_size = @@session.join_buffer_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.join_buffer_size = @start_global_value; +SELECT @@global.join_buffer_size; +SET @@session.join_buffer_size = @start_session_value; +SELECT @@session.join_buffer_size; + + +######################################################## +# END OF join_buffer_size TESTS # +######################################################## + diff --git a/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc new file mode 100644 index 00000000000..996a9e712f9 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/key_buffer_size_basic.inc @@ -0,0 +1,187 @@ +############## mysql-test\t\key_buffer_size_basic.test ######################## +# # +# Variable Name: key_buffer_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 131072 # +# Range:8-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable key_buffer_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### +# Changes: # +# 2008-03-06 hhunger Got "lost connections with 5.1.24 # +######################################################################## + +--source include/load_sysvars.inc + +######################################################################## +# START OF key_buffer_size TESTS # +######################################################################## + +--disable_warnings +######################################################################## +# Saving initial value of key_buffer_size in a temporary variable # +######################################################################## + +SET @start_value = @@global.key_buffer_size; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_055_01------------------------#' +######################################################################## +# Display the DEFAULT value of key_buffer_size # +######################################################################## + +SET @@global.key_buffer_size = 99; +--Error ER_NO_DEFAULT +SET @@global.key_buffer_size = DEFAULT; +--echo 'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_buffer_size = @min_key_buffer_size; + + +--echo '#---------------------FN_DYNVARS_055_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.key_buffer_size = @start_value; +SELECT @@global.key_buffer_size = @start_value; + +--echo '#--------------------FN_DYNVARS_055_03------------------------#' +######################################################################## +# Change the value of key_buffer_size to a valid value # +######################################################################## + +SET @@global.key_buffer_size = @min_key_buffer_size; +SELECT @@global.key_buffer_size= @min_key_buffer_size; +--disable_warnings +#Due to "lost connection" +#SET @@global.key_buffer_size = 4294967295; +--enable_warnings +#SELECT @@global.key_buffer_size; +SET @@global.key_buffer_size = 1800; +SELECT @@global.key_buffer_size = @min_key_buffer_size; +SET @@global.key_buffer_size = 65535; +SELECT @@global.key_buffer_size; +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + + +--echo '#--------------------FN_DYNVARS_055_04-------------------------#' +########################################################################### +# Change the value of key_buffer_size to invalid value # +########################################################################### + +# Due to "lost connection" +#SET @@global.key_buffer_size = -1; +#SELECT @@global.key_buffer_size; +#SET @@global.key_buffer_size = 100000000000; +#SELECT @@global.key_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_buffer_size = 10000.01; +SELECT @@global.key_buffer_size; +#SET @@global.key_buffer_size = -1024; +#SELECT @@global.key_buffer_size; +SET @@global.key_buffer_size = 4; +SELECT @@global.key_buffer_size = @min_key_buffer_size; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_buffer_size = ON; +SELECT @@global.key_buffer_size = @min_key_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_buffer_size = 'test'; +SELECT @@global.key_buffer_size = @min_key_buffer_size; + + +--echo '#-------------------FN_DYNVARS_055_05----------------------------#' +########################################################################### +# Test if accessing session key_buffer_size gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.key_buffer_size = 0; +SELECT @@key_buffer_size = @min_key_buffer_size; + + +--echo '#----------------------FN_DYNVARS_055_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.key_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_buffer_size'; + +SELECT @@key_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_buffer_size'; + + +--echo '#---------------------FN_DYNVARS_055_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.key_buffer_size = TRUE; +SELECT @@global.key_buffer_size = @min_key_buffer_size; +SET @@global.key_buffer_size = FALSE; +SELECT @@global.key_buffer_size = @min_key_buffer_size; + + +--echo '#---------------------FN_DYNVARS_055_08----------------------#' +##################################################################### +# Check if accessing variable with SESSION,LOCAL and without SCOPE # +# points to same session variable # +##################################################################### + +# due to differences in contents of the warnings +--disable_warnings +SET @@global.key_buffer_size = @min_key_buffer_size; +SELECT @@key_buffer_size = @@global.key_buffer_size; +--enable_warnings + +--echo '#---------------------FN_DYNVARS_055_09----------------------#' +########################################################################## +# Check if key_buffer_size can be accessed with and without @@ sign # +########################################################################## + +--Error ER_GLOBAL_VARIABLE +SET key_buffer_size = @min_key_buffer_size; +SELECT @@key_buffer_size = @min_key_buffer_size; +--Error ER_PARSE_ERROR +SET local.key_buffer_size = 10; +--Error ER_UNKNOWN_TABLE +SELECT local.key_buffer_size; +--Error ER_PARSE_ERROR +SET global.key_buffer_size = 10; +--Error ER_UNKNOWN_TABLE +SELECT global.key_buffer_size; +--Error ER_BAD_FIELD_ERROR +SELECT key_buffer_size = @@session.key_buffer_size; + + +############################## +# Restore initial value # +############################## + +SET @@global.key_buffer_size = @start_value; +SELECT @@global.key_buffer_size; + +--enable_warnings +####################################################################### +# END OF key_buffer_size TESTS # +####################################################################### diff --git a/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc new file mode 100644 index 00000000000..7841ad2cedc --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/key_cache_age_threshold_basic.inc @@ -0,0 +1,180 @@ +############## mysql-test\t\key_cache_age_threshold_basic.test ############### +# # +# Variable Name: key_cache_age_threshold # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 300 # +# Range: 100-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable key_cache_age_threshold # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF key_cache_age_threshold TESTS # +######################################################################## + + +############################################################################# +# Saving initial value of key_cache_age_threshold in a temporary variable # +############################################################################# + +SET @start_value = @@global.key_cache_age_threshold; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_056_01------------------------#' +################################################################################ +# Display the DEFAULT value of key_cache_age_threshold # +################################################################################ + +SET @@global.key_cache_age_threshold = 99; +--Error ER_NO_DEFAULT +SET @@global.key_cache_age_threshold = DEFAULT; +--echo 'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_cache_age_threshold; + + +--echo '#---------------------FN_DYNVARS_056_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.key_cache_age_threshold = @start_value; +SELECT @@global.key_cache_age_threshold = 300; + + +--echo '#--------------------FN_DYNVARS_056_03------------------------#' +############################################################################### +# Change the value of key_cache_age_threshold to a valid value # +############################################################################### + +SET @@global.key_cache_age_threshold = 100; +SELECT @@global.key_cache_age_threshold; +SET @@global.key_cache_age_threshold = 4294967295; +SELECT @@global.key_cache_age_threshold; +SET @@global.key_cache_age_threshold = 1800; +SELECT @@global.key_cache_age_threshold; +SET @@global.key_cache_age_threshold = 65535; +SELECT @@global.key_cache_age_threshold; +--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; + + +--echo '#--------------------FN_DYNVARS_056_04-------------------------#' +########################################################################### +# Change the value of key_cache_age_threshold to invalid value # +########################################################################### + +SET @@global.key_cache_age_threshold = -1; +SELECT @@global.key_cache_age_threshold; +SET @@global.key_cache_age_threshold = 42949672951; +SELECT @@global.key_cache_age_threshold; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_age_threshold = 10000.01; +SELECT @@global.key_cache_age_threshold; +SET @@global.key_cache_age_threshold = -1024; +SELECT @@global.key_cache_age_threshold; +SET @@global.key_cache_age_threshold = 99; +SELECT @@global.key_cache_age_threshold; + +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_age_threshold = ON; +SELECT @@global.key_cache_age_threshold; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_age_threshold = 'test'; +SELECT @@global.key_cache_age_threshold; + + +--echo '#-------------------FN_DYNVARS_056_05----------------------------#' +########################################################################### +# Test if accessing session key_cache_age_threshold gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.key_cache_age_threshold = 0; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.key_cache_age_threshold; + + +--echo '#----------------------FN_DYNVARS_056_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_age_threshold'; + +SELECT @@key_cache_age_threshold = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_age_threshold'; + + +--echo '#---------------------FN_DYNVARS_056_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.key_cache_age_threshold = TRUE; +SELECT @@global.key_cache_age_threshold; +SET @@global.key_cache_age_threshold = FALSE; +SELECT @@global.key_cache_age_threshold; + + +--echo '#---------------------FN_DYNVARS_056_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.key_cache_age_threshold = 101; +SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold; + + +--echo '#---------------------FN_DYNVARS_056_09----------------------#' +########################################################################## ####### +# Check if key_cache_age_threshold can be accessed with and without @@ sign # +################################################################################## + +--Error ER_GLOBAL_VARIABLE +SET key_cache_age_threshold = 8000; +SELECT @@key_cache_age_threshold; +--Error ER_PARSE_ERROR +SET local.key_cache_age_threshold = 10; +--Error ER_UNKNOWN_TABLE +SELECT local.key_cache_age_threshold; +--Error ER_PARSE_ERROR +SET global.key_cache_age_threshold = 10; +--Error ER_UNKNOWN_TABLE +SELECT global.key_cache_age_threshold; +--Error ER_BAD_FIELD_ERROR +SELECT key_cache_age_threshold = @@session.key_cache_age_threshold; + + +############################## +# Restore initial value # +############################## + +SET @@global.key_cache_age_threshold = @start_value; +SELECT @@global.key_cache_age_threshold; + + +######################################################################## +# END OF key_cache_age_threshold TESTS # +######################################################################## diff --git a/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc new file mode 100644 index 00000000000..b12ea45b762 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/key_cache_block_size_basic.inc @@ -0,0 +1,185 @@ +############## mysql-test\t\key_cache_block_size_basic.test ############### +# # +# Variable Name: key_cache_block_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric 1024 # +# Default Value: # +# Range: 512-16384 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable key_cache_block_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +##################################################################### +# START OF key_cache_block_size TESTS # +##################################################################### + + +########################################################################## +# Saving initial value of key_cache_block_size in a temporary variable # +########################################################################## + +SET @start_value = @@global.key_cache_block_size; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_057_01------------------------#' +################################################################################ +# Display the DEFAULT value of key_cache_block_size # +################################################################################ + +SET @@global.key_cache_block_size = 600; +--Error ER_NO_DEFAULT +SET @@global.key_cache_block_size = DEFAULT; +--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; +SELECT @@global.key_cache_block_size; + + +--echo '#---------------------FN_DYNVARS_057_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.key_cache_block_size = @start_value; +SELECT @@global.key_cache_block_size = 1024; + + +--echo '#--------------------FN_DYNVARS_057_03------------------------#' +############################################################################### +# Change the value of key_cache_block_size to a valid value # +############################################################################### + +SET @@global.key_cache_block_size = 1024; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = 16384; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = 1800; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = 16383; +SELECT @@global.key_cache_block_size; +--echo 'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; + + +--echo '#--------------------FN_DYNVARS_057_04-------------------------#' +########################################################################### +# Change the value of key_cache_block_size to invalid value # +########################################################################### + +SET @@global.key_cache_block_size = -1; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = 42949672951; +SELECT @@global.key_cache_block_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_block_size = 10000.01; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = -1024; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = 256; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = 511; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = 16385; +SELECT @@global.key_cache_block_size; + +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_block_size = ON; +SELECT @@global.key_cache_block_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_block_size = 'test'; +SELECT @@global.key_cache_block_size; + + +--echo '#-------------------FN_DYNVARS_057_05----------------------------#' +########################################################################### +# Test if accessing session key_cache_block_size gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.key_cache_block_size = 0; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.key_cache_block_size; + + +--echo '#----------------------FN_DYNVARS_057_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.key_cache_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_block_size'; + +SELECT @@key_cache_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_block_size'; + + +--echo '#---------------------FN_DYNVARS_057_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.key_cache_block_size = TRUE; +SELECT @@global.key_cache_block_size; +SET @@global.key_cache_block_size = FALSE; +SELECT @@global.key_cache_block_size; + + +--echo '#---------------------FN_DYNVARS_057_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.key_cache_block_size = 1024; +SELECT @@key_cache_block_size = @@global.key_cache_block_size; + + +--echo '#---------------------FN_DYNVARS_057_09----------------------#' +############################################################################### +# Check if key_cache_block_size can be accessed with and without @@ sign # +###############################################################################; + +--Error ER_GLOBAL_VARIABLE +SET key_cache_block_size = 8000; +SELECT @@key_cache_block_size; +--Error ER_PARSE_ERROR +SET local.key_cache_block_size = 10; +--Error ER_UNKNOWN_TABLE +SELECT local.key_cache_block_size; +--Error ER_PARSE_ERROR +SET global.key_cache_block_size = 10; +--Error ER_UNKNOWN_TABLE +SELECT global.key_cache_block_size; +--Error ER_BAD_FIELD_ERROR +SELECT key_cache_block_size = @@session.key_cache_block_size; + + +############################## +# Restore initial value # +############################## + +SET @@global.key_cache_block_size = @start_value; +SELECT @@global.key_cache_block_size; + + +##################################################################### +# END OF key_cache_block_size TESTS # +##################################################################### + diff --git a/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc b/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc new file mode 100644 index 00000000000..a2cc49a1f38 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/key_cache_division_limit_basic.inc @@ -0,0 +1,184 @@ +############## mysql-test\t\key_cache_division_limit_basic.test ############### +# # +# Variable Name: key_cache_division_limit # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 100 # +# Range: 1-100 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable key_cache_division_limit # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +##################################################################### +# START OF key_cache_division_limit TESTS # +##################################################################### + + +############################################################################## +# Saving initial value of key_cache_division_limit in a temporary variable # +############################################################################## + +SET @start_value = @@global.key_cache_division_limit; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_058_01------------------------#' +################################################################################ +# Display the DEFAULT value of key_cache_division_limit # +################################################################################ + +SET @@global.key_cache_division_limit = 50; +--Error ER_NO_DEFAULT +SET @@global.key_cache_division_limit = DEFAULT; +--echo 'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_cache_division_limit; + + +--echo '#---------------------FN_DYNVARS_058_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.key_cache_division_limit = @start_value; +SELECT @@global.key_cache_division_limit = 100; + + +--echo '#--------------------FN_DYNVARS_058_03------------------------#' +############################################################################### +# Change the value of key_cache_division_limit to a valid value # +############################################################################### + +SET @@global.key_cache_division_limit = 1; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = 50; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = 99; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = 2; +SELECT @@global.key_cache_division_limit; + + +--echo '#--------------------FN_DYNVARS_058_04-------------------------#' +########################################################################### +# Change the value of key_cache_division_limit to invalid value # +########################################################################### + +SET @@global.key_cache_division_limit = -1; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = 101; +SELECT @@global.key_cache_division_limit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_division_limit = 10000.01; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = -1024; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = 0; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = 200; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = 65535; +SELECT @@global.key_cache_division_limit; + +echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_division_limit = ON; +SELECT @@global.key_cache_division_limit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.key_cache_division_limit = 'test'; +SELECT @@global.key_cache_division_limit; + + +--echo '#-------------------FN_DYNVARS_058_05----------------------------#' +########################################################################### +# Test if accessing session key_cache_division_limit gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.key_cache_division_limit = 0; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.key_cache_division_limit; + + +--echo '#----------------------FN_DYNVARS_058_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.key_cache_division_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_division_limit'; + +SELECT @@key_cache_division_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_division_limit'; + + +--echo '#---------------------FN_DYNVARS_058_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.key_cache_division_limit = TRUE; +SELECT @@global.key_cache_division_limit; +SET @@global.key_cache_division_limit = FALSE; +SELECT @@global.key_cache_division_limit; + + +--echo '#---------------------FN_DYNVARS_058_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.key_cache_division_limit = 90; +SELECT @@key_cache_division_limit = @@global.key_cache_division_limit; + + +--echo '#---------------------FN_DYNVARS_058_09----------------------#' +############################################################################### +# Check if key_cache_division_limit can be accessed with and without @@ sign # +###############################################################################; + +--Error ER_GLOBAL_VARIABLE +SET key_cache_division_limit = 80; +SELECT @@key_cache_division_limit; +--Error ER_PARSE_ERROR +SET local.key_cache_division_limit = 10; +--Error ER_UNKNOWN_TABLE +SELECT local.key_cache_division_limit; +--Error ER_PARSE_ERROR +SET global.key_cache_division_limit = 10; +--Error ER_UNKNOWN_TABLE +SELECT global.key_cache_division_limit; +--Error ER_BAD_FIELD_ERROR +SELECT key_cache_division_limit = @@session.key_cache_division_limit; + + +############################## +# Restore initial value # +############################## + +SET @@global.key_cache_division_limit = @start_value; +SELECT @@global.key_cache_division_limit; + + +##################################################################### +# END OF key_cache_division_limit TESTS # +##################################################################### + diff --git a/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc new file mode 100644 index 00000000000..cd7e1023649 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/log_warnings_basic.inc @@ -0,0 +1,210 @@ +############## mysql-test\t\log_warnings_basic.test ############### +# # +# Variable Name: log_warnings # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 1 # +# Range: - # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable log_warnings # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +############################################################ +# START OF log_warnings TESTS # +############################################################ + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.log_warnings; +SELECT @start_global_value; +SET @start_session_value = @@session.log_warnings; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_067_01-------------------------#' +######################################################################## +# Display the DEFAULT value of log_warnings # +######################################################################## + +SET @@global.log_warnings = 100; +SET @@global.log_warnings = DEFAULT; +SELECT @@global.log_warnings; + +SET @@session.log_warnings = 200; +SET @@session.log_warnings = DEFAULT; +SELECT @@session.log_warnings; + + +--echo '#--------------------FN_DYNVARS_067_02-------------------------#' +######################################################################## +# Check the DEFAULT value of log_warnings # +######################################################################## + +SET @@global.log_warnings = DEFAULT; +SELECT @@global.log_warnings = 1; + +SET @@session.log_warnings = DEFAULT; +SELECT @@session.log_warnings = 1; + + +--echo '#--------------------FN_DYNVARS_067_03-------------------------#' +###################################################################### +# Change the value of log_warnings to a valid value for GLOBAL Scope # +###################################################################### + +SET @@global.log_warnings = 0; +SELECT @@global.log_warnings; +SET @@global.log_warnings = 1; +SELECT @@global.log_warnings; +SET @@global.log_warnings = 60020; +SELECT @@global.log_warnings; +SET @@global.log_warnings = 65535; +SELECT @@global.log_warnings; +SET @@global.log_warnings = 65536; +SELECT @@global.log_warnings; + + +--echo '#--------------------FN_DYNVARS_067_04-------------------------#' +####################################################################### +# Change the value of log_warnings to a valid value for SESSION Scope # +####################################################################### + +SET @@session.log_warnings = 0; +SELECT @@session.log_warnings; +SET @@session.log_warnings = 1; +SELECT @@session.log_warnings; +SET @@session.log_warnings = 50050; +SELECT @@session.log_warnings; +SET @@session.log_warnings = 65535; +SELECT @@session.log_warnings; +SET @@session.log_warnings = 65550; +SELECT @@session.log_warnings; + + +--echo '#------------------FN_DYNVARS_067_05-----------------------#' +######################################################## +# Change the value of log_warnings to an invalid value # +######################################################## + +SET @@global.log_warnings = 100000000000; +SELECT @@global.log_warnings; +SET @@global.log_warnings = -1024; +SELECT @@global.log_warnings; +--Error ER_PARSE_ERROR +SET @@global.log_warnings = 65530.34.; +SELECT @@global.log_warnings; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.log_warnings = test; +SELECT @@global.log_warnings; + +SET @@session.log_warnings = 100000000000; +SELECT @@session.log_warnings; +SET @@session.log_warnings = -2; +SELECT @@session.log_warnings; +--Error ER_PARSE_ERROR +SET @@session.log_warnings = 65530.34.; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.log_warnings = test; +SELECT @@session.log_warnings; + + +--echo '#------------------FN_DYNVARS_067_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.log_warnings = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_warnings'; + +--echo '#------------------FN_DYNVARS_067_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.log_warnings = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='log_warnings'; + + +--echo '#------------------FN_DYNVARS_067_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.log_warnings = TRUE; +SELECT @@global.log_warnings; +SET @@global.log_warnings = FALSE; +SELECT @@global.log_warnings; + + +--echo '#---------------------FN_DYNVARS_067_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.log_warnings = 10; +SELECT @@log_warnings = @@global.log_warnings; + + +--echo '#---------------------FN_DYNVARS_067_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@log_warnings = 100; +SELECT @@log_warnings = @@local.log_warnings; +SELECT @@local.log_warnings = @@session.log_warnings; + + +--echo '#---------------------FN_DYNVARS_067_11----------------------#' +####################################################################### +# Check if log_warnings can be accessed with and without @@ sign # +####################################################################### + +SET log_warnings = 1; +SELECT @@log_warnings; +--Error ER_UNKNOWN_TABLE +SELECT local.log_warnings; +--Error ER_UNKNOWN_TABLE +SELECT session.log_warnings; +--Error ER_BAD_FIELD_ERROR +SELECT log_warnings = @@session.log_warnings; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.log_warnings = @start_global_value; +SELECT @@global.log_warnings; +SET @@session.log_warnings = @start_session_value; +SELECT @@session.log_warnings; + + +############################################################# +# END OF log_warnings TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc new file mode 100644 index 00000000000..9f3416d2e31 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/max_binlog_cache_size_basic.inc @@ -0,0 +1,187 @@ +############## mysql-test\t\max_binlog_cache_size_basic.test ############### +# # +# Variable Name: max_binlog_cache_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:4294967295 # +# Range: 4096-4294967295 # +# # +# # +# # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable max_binlog_cache_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF max_binlog_cache_size TESTS # +######################################################################## + + +######################################################################## +# Saving initial value of max_binlog_cache_size in a temporary variable# +######################################################################## + +SET @start_value = @@global.max_binlog_cache_size; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_072_01------------------------#' +######################################################################## +# Display the DEFAULT value of max_binlog_cache_size # +######################################################################## + +SET @@global.max_binlog_cache_size = 5000; +SET @@global.max_binlog_cache_size = DEFAULT; +SELECT @@global.max_binlog_cache_size; + + +--echo '#---------------------FN_DYNVARS_072_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.max_binlog_cache_size = @start_value; +SELECT @@global.max_binlog_cache_size = 4294967295; +--echo 'Bug# 34876: Incorrect Default Value is assigned to variable'; + +--echo '#--------------------FN_DYNVARS_072_03------------------------#' +######################################################################## +# Change the value of max_binlog_cache_size to a valid value # +######################################################################## + +SET @@global.max_binlog_cache_size = 4096; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 4294967295; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 4294967294; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 4097; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 65535; +SELECT @@global.max_binlog_cache_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_072_04-------------------------#' +########################################################################### +# Change the value of max_binlog_cache_size to invalid value # +########################################################################### + +SET @@global.max_binlog_cache_size = -1; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 100000000000; +SELECT @@global.max_binlog_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_binlog_cache_size = 10000.01; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = -1024; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 1024; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 4294967296; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = 4095; +SELECT @@global.max_binlog_cache_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_binlog_cache_size = ON; +SELECT @@global.max_binlog_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_binlog_cache_size = 'test'; +SELECT @@global.max_binlog_cache_size; + + +--echo '#-------------------FN_DYNVARS_072_05----------------------------#' +########################################################################### +# Test if accessing session max_binlog_cache_size gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.max_binlog_cache_size = 4096; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.max_binlog_cache_size; + + +--echo '#----------------------FN_DYNVARS_072_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_binlog_cache_size'; + +SELECT @@max_binlog_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_binlog_cache_size'; + + +--echo '#---------------------FN_DYNVARS_072_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.max_binlog_cache_size = TRUE; +SELECT @@global.max_binlog_cache_size; +SET @@global.max_binlog_cache_size = FALSE; +SELECT @@global.max_binlog_cache_size; + + +--echo '#---------------------FN_DYNVARS_072_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.max_binlog_cache_size = 5000; +SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size; + + +--echo '#---------------------FN_DYNVARS_072_09----------------------#' +################################################################################ +# Check if max_binlog_cache_size can be accessed with and without @@ sign # +################################################################################ + +--Error ER_GLOBAL_VARIABLE +SET max_binlog_cache_size = 6000; +SELECT @@max_binlog_cache_size; +--Error ER_PARSE_ERROR +SET local.max_binlog_cache_size = 7000; +--Error ER_UNKNOWN_TABLE +SELECT local.max_binlog_cache_size; +--Error ER_PARSE_ERROR +SET global.max_binlog_cache_size = 8000; +--Error ER_UNKNOWN_TABLE +SELECT global.max_binlog_cache_size; +--Error ER_BAD_FIELD_ERROR +SELECT max_binlog_cache_size = @@session.max_binlog_cache_size; + + +############################## +# Restore initial value # +############################## + +SET @@global.max_binlog_cache_size = @start_value; +SELECT @@global.max_binlog_cache_size; + + +######################################################################## +# END OF max_binlog_cache_size TESTS # +######################################################################## diff --git a/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc new file mode 100644 index 00000000000..530022652a1 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/max_connect_errors_basic.inc @@ -0,0 +1,182 @@ +############## mysql-test\t\max_connect_errors_basic.test ############### +# # +# Variable Name: max_connect_errors # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 10 # +# Range: 1-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable max_connect_errors # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +################################################################## +# START OF max_connect_errors TESTS # +################################################################## + + +###################################################################### +# Saving initial value of max_connect_errors in a temporary variable # +###################################################################### + +SET @start_value = @@global.max_connect_errors; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_073_01------------------------#' +################################################################## +# Display the DEFAULT value of max_connect_errors # +################################################################## + +SET @@global.max_connect_errors = 5000; +SET @@global.max_connect_errors = DEFAULT; +SELECT @@global.max_connect_errors; +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; + +--echo '#---------------------FN_DYNVARS_073_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.max_connect_errors = @start_value; +SELECT @@global.max_connect_errors = 10; + +--echo '#--------------------FN_DYNVARS_073_03------------------------#' +################################################################## +# Change the value of max_connect_errors to a valid value # +################################################################## + +SET @@global.max_connect_errors = 4096; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = 4294967294; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = 4294967295; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = 1; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = 2; +SELECT @@global.max_connect_errors; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_073_04-------------------------#' +##################################################################### +# Change the value of max_connect_errors to invalid value # +##################################################################### + +SET @@global.max_connect_errors = -1; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = 100000000000; +SELECT @@global.max_connect_errors; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_connect_errors = 10000.01; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = -1024; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = 0; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = 4294967296; +SELECT @@global.max_connect_errors; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_connect_errors = ON; +SELECT @@global.max_connect_errors; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_connect_errors = 'test'; +SELECT @@global.max_connect_errors; + + +--echo '#-------------------FN_DYNVARS_073_05----------------------------#' +##################################################################### +# Test if accessing session max_connect_errors gives error # +##################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.max_connect_errors = 4096; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.max_connect_errors; + + +--echo '#----------------------FN_DYNVARS_073_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.max_connect_errors = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_connect_errors'; + +SELECT @@max_connect_errors = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_connect_errors'; + + +--echo '#---------------------FN_DYNVARS_073_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.max_connect_errors = TRUE; +SELECT @@global.max_connect_errors; +SET @@global.max_connect_errors = FALSE; +SELECT @@global.max_connect_errors; + + +--echo '#---------------------FN_DYNVARS_073_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.max_connect_errors = 5000; +SELECT @@max_connect_errors = @@global.max_connect_errors; + + +--echo '#---------------------FN_DYNVARS_073_09----------------------#' +########################################################################## +# Check if max_connect_errors can be accessed with and without @@ sign # +########################################################################## + +--Error ER_GLOBAL_VARIABLE +SET max_connect_errors = 6000; +SELECT @@max_connect_errors; +--Error ER_PARSE_ERROR +SET local.max_connect_errors = 7000; +--Error ER_UNKNOWN_TABLE +SELECT local.max_connect_errors; +--Error ER_PARSE_ERROR +SET global.max_connect_errors = 8000; +--Error ER_UNKNOWN_TABLE +SELECT global.max_connect_errors; +--Error ER_BAD_FIELD_ERROR +SELECT max_connect_errors = @@session.max_connect_errors; + + +############################## +# Restore initial value # +############################## + +SET @@global.max_connect_errors = @start_value; +SELECT @@global.max_connect_errors; + + +################################################################## +# END OF max_connect_errors TESTS # +################################################################## + diff --git a/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc b/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc new file mode 100644 index 00000000000..d07ae094cde --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/max_heap_table_size_basic.inc @@ -0,0 +1,222 @@ +############## mysql-test\t\max_heap_table_size_basic.test ############### +# # +# Variable Name: max_heap_table_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 16777216 # +# Range: 16384-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable max_heap_table_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +############################################################### +# START OF max_heap_table_size TESTS # +############################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.max_heap_table_size; +SELECT @start_global_value; +SET @start_session_value = @@session.max_heap_table_size; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_077_01-------------------------#' +############################################################### +# Display the DEFAULT value of max_heap_table_size # +############################################################### + +SET @@global.max_heap_table_size = 1677721610; +SET @@global.max_heap_table_size = DEFAULT; +SELECT @@global.max_heap_table_size; + +SET @@session.max_heap_table_size = 1677721610; +SET @@session.max_heap_table_size = DEFAULT; +SELECT @@session.max_heap_table_size; + + +--echo '#--------------------FN_DYNVARS_077_02-------------------------#' +################################################################## +# Check the DEFAULT value of max_heap_table_size # +################################################################## + +SET @@global.max_heap_table_size = DEFAULT; +SELECT @@global.max_heap_table_size = 16777216; + +SET @@session.max_heap_table_size = DEFAULT; +SELECT @@session.max_heap_table_size = 16777216; + + +--echo '#--------------------FN_DYNVARS_077_03-------------------------#' +############################################################################ +# Change the value of max_heap_table_size to a valid value for GLOBAL Scope # +############################################################################ + +SET @@global.max_heap_table_size = 16384; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = 16385; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = 65535; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = 4294967294; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = 4294967295; +SELECT @@global.max_heap_table_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_077_04-------------------------#' +############################################################################# +# Change the value of max_heap_table_size to a valid value for SESSION Scope # +############################################################################# + +SET @@session.max_heap_table_size = 16384; +SELECT @@session.max_heap_table_size; +SET @@session.max_heap_table_size = 16385; +SELECT @@session.max_heap_table_size; +SET @@session.max_heap_table_size = 65535; +SELECT @@session.max_heap_table_size; +SET @@session.max_heap_table_size = 4294967294; +SELECT @@session.max_heap_table_size; +SET @@session.max_heap_table_size = 4294967295; +SELECT @@session.max_heap_table_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#------------------FN_DYNVARS_077_05-----------------------#' +############################################################## +# Change the value of max_heap_table_size to an invalid value # +############################################################## + +SET @@global.max_heap_table_size = -1; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = -1024; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = 1024; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = 16383; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = 4294967296; +SELECT @@global.max_heap_table_size; +--Error ER_PARSE_ERROR +SET @@global.max_heap_table_size = 65530.34.; +SELECT @@global.max_heap_table_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_heap_table_size = test; +SELECT @@global.max_heap_table_size; + +SET @@session.max_heap_table_size = -1; +SELECT @@session.max_heap_table_size; +SET @@session.max_heap_table_size = 16383; +SELECT @@session.max_heap_table_size; +SET @@session.max_heap_table_size = 4294967296; +SELECT @@session.max_heap_table_size; +--Error ER_PARSE_ERROR +SET @@session.max_heap_table_size = 65530.34.; +SET @@session.max_heap_table_size = 10737418241; +SELECT @@session.max_heap_table_size; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_heap_table_size = test; +SELECT @@session.max_heap_table_size; + + +--echo '#------------------FN_DYNVARS_077_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.max_heap_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_heap_table_size'; + +--echo '#------------------FN_DYNVARS_077_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.max_heap_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_heap_table_size'; + + +--echo '#------------------FN_DYNVARS_077_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.max_heap_table_size = TRUE; +SELECT @@global.max_heap_table_size; +SET @@global.max_heap_table_size = FALSE; +SELECT @@global.max_heap_table_size; + + +--echo '#---------------------FN_DYNVARS_077_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.max_heap_table_size = 163845; +SELECT @@max_heap_table_size = @@global.max_heap_table_size; + + +--echo '#---------------------FN_DYNVARS_077_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@max_heap_table_size = 16777216; +SELECT @@max_heap_table_size = @@local.max_heap_table_size; +SELECT @@local.max_heap_table_size = @@session.max_heap_table_size; + + +--echo '#---------------------FN_DYNVARS_077_11----------------------#' +############################################################################# +# Check if max_heap_table_size can be accessed with and without @@ sign # +############################################################################# + +SET max_heap_table_size = 316777216; +SELECT @@max_heap_table_size; +--Error ER_UNKNOWN_TABLE +SELECT local.max_heap_table_size; +--Error ER_UNKNOWN_TABLE +SELECT session.max_heap_table_size; +--Error ER_BAD_FIELD_ERROR +SELECT max_heap_table_size = @@session.max_heap_table_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.max_heap_table_size = @start_global_value; +SELECT @@global.max_heap_table_size; +SET @@session.max_heap_table_size = @start_session_value; +SELECT @@session.max_heap_table_size; + + +####################################################### +# END OF max_heap_table_size TESTS # +####################################################### + diff --git a/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc new file mode 100644 index 00000000000..23c3c5b2a95 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/max_seeks_for_key_basic.inc @@ -0,0 +1,213 @@ +############## mysql-test\t\max_seeks_for_key_basic.test ############### +# # +# Variable Name: max_seeks_for_key # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 4294967295 # +# Range: 1-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable max_seeks_for_key # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +################################################################# +# START OF max_seeks_for_key TESTS # +################################################################# + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.max_seeks_for_key; +SELECT @start_global_value; +SET @start_session_value = @@session.max_seeks_for_key; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_083_01-------------------------#' +################################################################# +# Display the DEFAULT value of max_seeks_for_key # +################################################################# + +SET @@global.max_seeks_for_key = 100; +SET @@global.max_seeks_for_key = DEFAULT; +SELECT @@global.max_seeks_for_key; + +SET @@session.max_seeks_for_key = 200; +SET @@session.max_seeks_for_key = DEFAULT; +SELECT @@session.max_seeks_for_key; + + +--echo '#--------------------FN_DYNVARS_083_02-------------------------#' +################################################################# +# Check the DEFAULT value of max_seeks_for_key # +################################################################# + +SET @@global.max_seeks_for_key = DEFAULT; +SELECT @@global.max_seeks_for_key = 4294967295; + +SET @@session.max_seeks_for_key = DEFAULT; +SELECT @@session.max_seeks_for_key = 4294967295; + + +--echo '#--------------------FN_DYNVARS_083_03-------------------------#' +########################################################################### +# Change the value of max_seeks_for_key to a valid value for GLOBAL Scope # +########################################################################### + +SET @@global.max_seeks_for_key = 1; +SELECT @@global.max_seeks_for_key; +SET @@global.max_seeks_for_key = 2; +SELECT @@global.max_seeks_for_key; +SET @@global.max_seeks_for_key = 65536; +SELECT @@global.max_seeks_for_key; +SET @@global.max_seeks_for_key = 4294967295; +SELECT @@global.max_seeks_for_key; +SET @@global.max_seeks_for_key = 4294967294; +SELECT @@global.max_seeks_for_key; + + +--echo '#--------------------FN_DYNVARS_083_04-------------------------#' +############################################################################ +# Change the value of max_seeks_for_key to a valid value for SESSION Scope # +############################################################################ +SET @@session.max_seeks_for_key = 1; +SELECT @@session.max_seeks_for_key; +SET @@session.max_seeks_for_key = 2; +SELECT @@session.max_seeks_for_key; +SET @@session.max_seeks_for_key = 4294967295; +SELECT @@session.max_seeks_for_key; +SET @@session.max_seeks_for_key = 4294967294; +SELECT @@session.max_seeks_for_key; +SET @@session.max_seeks_for_key = 65535; +SELECT @@session.max_seeks_for_key; + + +--echo '#------------------FN_DYNVARS_083_05-----------------------#' +############################################################# +# Change the value of max_seeks_for_key to an invalid value # +############################################################# + +SET @@global.max_seeks_for_key = 0; +SELECT @@global.max_seeks_for_key; +SET @@global.max_seeks_for_key = -1024; +SELECT @@global.max_seeks_for_key; +SET @@global.max_seeks_for_key = 4294967296; +SELECT @@global.max_seeks_for_key; +--Error ER_PARSE_ERROR +SET @@global.max_seeks_for_key = 65530.34.; +SELECT @@global.max_seeks_for_key; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_seeks_for_key = test; +SELECT @@global.max_seeks_for_key; + +SET @@session.max_seeks_for_key = 0; +SELECT @@session.max_seeks_for_key; +SET @@session.max_seeks_for_key = -2; +SELECT @@session.max_seeks_for_key; +--Error ER_PARSE_ERROR +SET @@session.max_seeks_for_key = 65530.34.; +SET @@session.max_seeks_for_key = 4294967296; +SELECT @@session.max_seeks_for_key; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_seeks_for_key = test; +SELECT @@session.max_seeks_for_key; + + +--echo '#------------------FN_DYNVARS_083_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.max_seeks_for_key = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_seeks_for_key'; + +--echo '#------------------FN_DYNVARS_083_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.max_seeks_for_key = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_seeks_for_key'; + + +--echo '#------------------FN_DYNVARS_083_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.max_seeks_for_key = TRUE; +SELECT @@global.max_seeks_for_key; +SET @@global.max_seeks_for_key = FALSE; +SELECT @@global.max_seeks_for_key; + + +--echo '#---------------------FN_DYNVARS_083_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.max_seeks_for_key = 10; +SELECT @@max_seeks_for_key = @@global.max_seeks_for_key; + + +--echo '#---------------------FN_DYNVARS_083_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@max_seeks_for_key = 100; +SELECT @@max_seeks_for_key = @@local.max_seeks_for_key; +SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key; + + +--echo '#---------------------FN_DYNVARS_083_11----------------------#' +############################################################################ +# Check if max_seeks_for_key can be accessed with and without @@ sign # +############################################################################ + +SET max_seeks_for_key = 1; +SELECT @@max_seeks_for_key; +--Error ER_UNKNOWN_TABLE +SELECT local.max_seeks_for_key; +--Error ER_UNKNOWN_TABLE +SELECT session.max_seeks_for_key; +--Error ER_BAD_FIELD_ERROR +SELECT max_seeks_for_key = @@session.max_seeks_for_key; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.max_seeks_for_key = @start_global_value; +SELECT @@global.max_seeks_for_key; +SET @@session.max_seeks_for_key = @start_session_value; +SELECT @@session.max_seeks_for_key; + + +############################################################# +# END OF max_seeks_for_key TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc new file mode 100644 index 00000000000..e24d97f47dd --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/max_tmp_tables_basic.inc @@ -0,0 +1,227 @@ +############## mysql-test\t\max_tmp_tables_basic.test ############### +# # +# Variable Name: max_tmp_tables # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 32 # +# Range: 1-4294967295 # +# # +# # +# # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable max_tmp_tables # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +#################################### +# START OF max_tmp_tables TESTS # +#################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.max_tmp_tables; +SELECT @start_global_value; +SET @start_session_value = @@session.max_tmp_tables; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_086_01-------------------------#' +###################################################### +# Display the DEFAULT value of max_tmp_tables # +###################################################### + +SET @@global.max_tmp_tables = 1000; +SET @@global.max_tmp_tables = DEFAULT; +SELECT @@global.max_tmp_tables; + + +SET @@session.max_tmp_tables = 1000; +SET @@session.max_tmp_tables = DEFAULT; +SELECT @@session.max_tmp_tables; + + +--echo '#--------------------FN_DYNVARS_086_02-------------------------#' +###################################################### +# Check the DEFAULT value of max_tmp_tables # +###################################################### + +SET @@global.max_tmp_tables = DEFAULT; +SELECT @@global.max_tmp_tables = 32; + +SET @@session.max_tmp_tables = DEFAULT; +SELECT @@session.max_tmp_tables = 32; + + + +--echo '#--------------------FN_DYNVARS_086_03-------------------------#' +######################################################################## +# Change the value of max_tmp_tables to a valid value for GLOBAL Scope # +######################################################################## + +SET @@global.max_tmp_tables = 1; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = 2; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = 65536; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = 4294967295; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = 4294967294; +SELECT @@global.max_tmp_tables; + +--echo '#--------------------FN_DYNVARS_086_04-------------------------#' +######################################################################### +# Change the value of max_tmp_tables to a valid value for SESSION Scope # +######################################################################### + +SET @@session.max_tmp_tables = 1; +SELECT @@session.max_tmp_tables; + +SET @@session.max_tmp_tables = 2; +SELECT @@session.max_tmp_tables; + +SET @@session.max_tmp_tables = 65536; +SELECT @@session.max_tmp_tables; + +SET @@session.max_tmp_tables = 4294967295; +SELECT @@session.max_tmp_tables; + +SET @@session.max_tmp_tables = 4294967294; +SELECT @@session.max_tmp_tables; + + +--echo '#------------------FN_DYNVARS_086_05-----------------------#' +########################################################## +# Change the value of max_tmp_tables to an invalid value # +########################################################## + +SET @@global.max_tmp_tables = -1024; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = 4294967296; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = -1; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = 429496729500; +SELECT @@global.max_tmp_tables; +--Error ER_PARSE_ERROR +SET @@global.max_tmp_tables = 65530.34.; +SELECT @@global.max_tmp_tables; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_tmp_tables = test; +SELECT @@global.max_tmp_tables; + +SET @@session.max_tmp_tables = 4294967296; +SELECT @@session.max_tmp_tables; +SET @@session.max_tmp_tables = -1; +SELECT @@session.max_tmp_tables; +SET @@session.max_tmp_tables = 429496729500; +SELECT @@session.max_tmp_tables; +SET @@session.max_tmp_tables = -001; +SELECT @@session.max_tmp_tables; +--Error ER_PARSE_ERROR +SET @@session.max_tmp_tables = 65530.34.; +SET @@session.max_tmp_tables = 10737418241; +SELECT @@session.max_tmp_tables; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.max_tmp_tables = test; +SELECT @@session.max_tmp_tables; + + +--echo '#------------------FN_DYNVARS_086_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.max_tmp_tables = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_tmp_tables'; + +--echo '#------------------FN_DYNVARS_086_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.max_tmp_tables = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_tmp_tables'; + + +--echo '#------------------FN_DYNVARS_086_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.max_tmp_tables = TRUE; +SELECT @@global.max_tmp_tables; +SET @@global.max_tmp_tables = FALSE; +SELECT @@global.max_tmp_tables; + + +--echo '#---------------------FN_DYNVARS_086_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.max_tmp_tables = 20; +SELECT @@max_tmp_tables = @@global.max_tmp_tables; + + +--echo '#---------------------FN_DYNVARS_086_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@max_tmp_tables = 255; +SELECT @@max_tmp_tables = @@local.max_tmp_tables; +SELECT @@local.max_tmp_tables = @@session.max_tmp_tables; + + +--echo '#---------------------FN_DYNVARS_086_11----------------------#' +######################################################################### +# Check if max_tmp_tables can be accessed with and without @@ sign # +######################################################################### + + +SET max_tmp_tables = 102; +SELECT @@max_tmp_tables; +--Error ER_UNKNOWN_TABLE +SELECT local.max_tmp_tables; +--Error ER_UNKNOWN_TABLE +SELECT session.max_tmp_tables; +--Error ER_BAD_FIELD_ERROR +SELECT max_tmp_tables = @@session.max_tmp_tables; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.max_tmp_tables = @start_global_value; +SELECT @@global.max_tmp_tables; +SET @@session.max_tmp_tables = @start_session_value; +SELECT @@session.max_tmp_tables; + + +################################################### +# END OF max_tmp_tables TESTS # +################################################### + diff --git a/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc new file mode 100644 index 00000000000..80d5b7cc747 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc @@ -0,0 +1,158 @@ +############## mysql-test\t\max_write_lock_count_basic.test ############### +# # +# Variable Name: max_write_lock_count # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 4294967295 # +# Range:1-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable max_write_lock_count # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +########################################## +# START OF max_write_lock_count TESTS # +########################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.max_write_lock_count; +SELECT @start_global_value; + + +--echo '#--------------------FN_DYNVARS_088_01-------------------------#' +############################################################ +# Display the DEFAULT value of max_write_lock_count # +############################################################ + +SET @@global.max_write_lock_count = 1000; +SET @@global.max_write_lock_count = DEFAULT; +SELECT @@global.max_write_lock_count; + + +--echo '#--------------------FN_DYNVARS_088_02-------------------------#' +############################################################ +# Check the DEFAULT value of max_write_lock_count # +############################################################ + +SET @@global.max_write_lock_count = DEFAULT; +SELECT @@global.max_write_lock_count = 4294967295; + + +--echo '#--------------------FN_DYNVARS_088_03-------------------------#' +############################################################################## +# Change the value of max_write_lock_count to a valid value for GLOBAL Scope # +############################################################################## + +SET @@global.max_write_lock_count = 1; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = 2; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = 65536; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = 4294967295; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = 4294967294; +SELECT @@global.max_write_lock_count; + + + +--echo '#------------------FN_DYNVARS_088_04-----------------------#' +################################################################ +# Change the value of max_write_lock_count to an invalid value # +################################################################ + +SET @@global.max_write_lock_count = -1024; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = 4294967296; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = -1; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = 429496729500; +SELECT @@global.max_write_lock_count; +--Error ER_PARSE_ERROR +SET @@global.max_write_lock_count = 65530.34.; +SELECT @@global.max_write_lock_count; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_write_lock_count = test; +SELECT @@global.max_write_lock_count; + + + +--echo '#------------------FN_DYNVARS_088_05-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.max_write_lock_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_write_lock_count'; + + +--echo '#------------------FN_DYNVARS_088_06-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.max_write_lock_count = TRUE; +SELECT @@global.max_write_lock_count; +SET @@global.max_write_lock_count = FALSE; +SELECT @@global.max_write_lock_count; + + +--echo '#---------------------FN_DYNVARS_088_07----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.max_write_lock_count = 20; +SELECT @@max_write_lock_count = @@global.max_write_lock_count; + + +--echo '#---------------------FN_DYNVARS_088_08----------------------#' +############################################################################### +# Check if max_write_lock_count can be accessed with and without @@ sign # +############################################################################### + + +SET @@global.max_write_lock_count = 102; +SELECT @@max_write_lock_count; +--Error ER_UNKNOWN_TABLE +SELECT local.max_write_lock_count; +--Error ER_UNKNOWN_TABLE +SELECT global.max_write_lock_count; +--Error ER_BAD_FIELD_ERROR +SELECT max_write_lock_count = @@global.max_write_lock_count; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.max_write_lock_count = @start_global_value; +SELECT @@global.max_write_lock_count; + + +################################################### +# END OF max_write_lock_count TESTS # +################################################### + diff --git a/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc new file mode 100644 index 00000000000..c032d4a9d6d --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/min_examined_row_limit_basic.inc @@ -0,0 +1,219 @@ +############## mysql-test\t\min_examined_row_limit_basic.test ############### +# # +# Variable Name: min_examined_row_limit # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 0 # +# Range:0-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable min_examined_row_limit # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +###################################################################### +# START OF min_examined_row_limit TESTS # +###################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.min_examined_row_limit; +SELECT @start_global_value; +SET @start_session_value = @@session.min_examined_row_limit; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_089_01-------------------------#' +###################################################################### +# Display the DEFAULT value of min_examined_row_limit # +###################################################################### + +SET @@global.min_examined_row_limit = 100; +SET @@global.min_examined_row_limit = DEFAULT; +SELECT @@global.min_examined_row_limit; + +SET @@session.min_examined_row_limit = 200; +SET @@session.min_examined_row_limit = DEFAULT; +SELECT @@session.min_examined_row_limit; + + +--echo '#--------------------FN_DYNVARS_089_02-------------------------#' +######################################################################## +# Check the DEFAULT value of min_examined_row_limit # +######################################################################## + +SET @@global.min_examined_row_limit = DEFAULT; +SELECT @@global.min_examined_row_limit = 0; + +SET @@session.min_examined_row_limit = DEFAULT; +SELECT @@session.min_examined_row_limit = 0; + + +--echo '#--------------------FN_DYNVARS_089_03-------------------------#' +################################################################################ +# Change the value of min_examined_row_limit to a valid value for GLOBAL Scope # +################################################################################ + +SET @@global.min_examined_row_limit = 0; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = 1; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = 60020; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = 65535; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = 4294967295; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = 4294967294; +SELECT @@global.min_examined_row_limit; + + + +--echo '#--------------------FN_DYNVARS_089_04-------------------------#' +################################################################################### +# Change the value of min_examined_row_limit to a valid value for SESSION Scope # +################################################################################### + +SET @@session.min_examined_row_limit = 0; +SELECT @@session.min_examined_row_limit; +SET @@session.min_examined_row_limit = 1; +SELECT @@session.min_examined_row_limit; +SET @@session.min_examined_row_limit = 50050; +SELECT @@session.min_examined_row_limit; +SET @@session.min_examined_row_limit = 65535; +SELECT @@session.min_examined_row_limit; +SET @@session.min_examined_row_limit = 4294967295; +SELECT @@session.min_examined_row_limit; +SET @@session.min_examined_row_limit = 4294967294; +SELECT @@session.min_examined_row_limit; + + +--echo '#------------------FN_DYNVARS_089_05-----------------------#' +#################################################################### +# Change the value of min_examined_row_limit to an invalid value # +#################################################################### + +SET @@global.min_examined_row_limit = 429496726; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = -1024; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = 429496729500; +SELECT @@global.min_examined_row_limit; +--Error ER_PARSE_ERROR +SET @@global.min_examined_row_limit = 65530.34.; +SELECT @@global.min_examined_row_limit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.min_examined_row_limit = test; +SELECT @@global.min_examined_row_limit; + +SET @@session.min_examined_row_limit = 4294967296; +SELECT @@session.min_examined_row_limit; +SET @@session.min_examined_row_limit = -1; +SELECT @@session.min_examined_row_limit; +--Error ER_PARSE_ERROR +SET @@session.min_examined_row_limit = 65530.34.; +SET @@session.min_examined_row_limit = 4294967295021; +SELECT @@session.min_examined_row_limit; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.min_examined_row_limit = test; +SELECT @@session.min_examined_row_limit; + + +--echo '#------------------FN_DYNVARS_089_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.min_examined_row_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='min_examined_row_limit'; + +--echo '#------------------FN_DYNVARS_089_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.min_examined_row_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='min_examined_row_limit'; + + +--echo '#------------------FN_DYNVARS_089_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.min_examined_row_limit = TRUE; +SELECT @@global.min_examined_row_limit; +SET @@global.min_examined_row_limit = FALSE; +SELECT @@global.min_examined_row_limit; + + +--echo '#---------------------FN_DYNVARS_089_09----------------------#' +#################################################################################### +# Check if accessing variable with and without GLOBAL point to same variable # +#################################################################################### + +SET @@global.min_examined_row_limit = 10; +SELECT @@min_examined_row_limit = @@global.min_examined_row_limit; + + +--echo '#---------------------FN_DYNVARS_089_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@min_examined_row_limit = 100; +SELECT @@min_examined_row_limit = @@local.min_examined_row_limit; +SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit; + + +--echo '#---------------------FN_DYNVARS_089_11----------------------#' +################################################################################### +# Check if min_examined_row_limit can be accessed with and without @@ sign # +################################################################################### + +SET min_examined_row_limit = 1; +SELECT @@min_examined_row_limit; +--Error ER_UNKNOWN_TABLE +SELECT local.min_examined_row_limit; +--Error ER_UNKNOWN_TABLE +SELECT session.min_examined_row_limit; +--Error ER_BAD_FIELD_ERROR +SELECT min_examined_row_limit = @@session.min_examined_row_limit; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.min_examined_row_limit = @start_global_value; +SELECT @@global.min_examined_row_limit; +SET @@session.min_examined_row_limit = @start_session_value; +SELECT @@session.min_examined_row_limit; + + +############################################################# +# END OF min_examined_row_limit TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc b/mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc new file mode 100644 index 00000000000..47e8352196f --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/multi_range_count_basic.inc @@ -0,0 +1,219 @@ +############## mysql-test\t\multi_range_count_basic.test ############### +# # +# Variable Name: multi_range_count # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 256 # +# Range:1-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable multi_range_count # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +################################################################# +# START OF multi_range_count TESTS # +################################################################# + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.multi_range_count; +SELECT @start_global_value; +SET @start_session_value = @@session.multi_range_count; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_090_01-------------------------#' +################################################################# +# Display the DEFAULT value of multi_range_count # +################################################################# + +SET @@global.multi_range_count = 100; +SET @@global.multi_range_count = DEFAULT; +SELECT @@global.multi_range_count; + +SET @@session.multi_range_count = 200; +SET @@session.multi_range_count = DEFAULT; +SELECT @@session.multi_range_count; + + +--echo '#--------------------FN_DYNVARS_090_02-------------------------#' +################################################################# +# Check the DEFAULT value of multi_range_count # +################################################################# + +SET @@global.multi_range_count = DEFAULT; +SELECT @@global.multi_range_count = 256; + +SET @@session.multi_range_count = DEFAULT; +SELECT @@session.multi_range_count = 256; + + +--echo '#--------------------FN_DYNVARS_090_03-------------------------#' +########################################################################### +# Change the value of multi_range_count to a valid value for GLOBAL Scope # +########################################################################### + +SET @@global.multi_range_count = 1; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = 60020; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = 65535; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = 4294967295; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = 4294967294; +SELECT @@global.multi_range_count; + + + +--echo '#--------------------FN_DYNVARS_090_04-------------------------#' +############################################################################ +# Change the value of multi_range_count to a valid value for SESSION Scope # +############################################################################ + +SET @@session.multi_range_count = 1; +SELECT @@session.multi_range_count; +SET @@session.multi_range_count = 50050; +SELECT @@session.multi_range_count; +SET @@session.multi_range_count = 65535; +SELECT @@session.multi_range_count; +SET @@session.multi_range_count = 4294967295; +SELECT @@session.multi_range_count; +SET @@session.multi_range_count = 4294967294; +SELECT @@session.multi_range_count; + + +--echo '#------------------FN_DYNVARS_090_05-----------------------#' +############################################################# +# Change the value of multi_range_count to an invalid value # +############################################################# + +SET @@global.multi_range_count = 0; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = 4294967296; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = -1024; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = 429496729500; +SELECT @@global.multi_range_count; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.multi_range_count = 65530.34; +SELECT @@global.multi_range_count; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.multi_range_count = test; +SELECT @@global.multi_range_count; + +SET @@session.multi_range_count = 0; +SELECT @@session.multi_range_count; +SET @@session.multi_range_count = 4294967296; +SELECT @@session.multi_range_count; +SET @@session.multi_range_count = -1; +SELECT @@session.multi_range_count; +--Error ER_PARSE_ERROR +SET @@session.multi_range_count = 65530.34.; +SET @@session.multi_range_count = 4294967295021; +SELECT @@session.multi_range_count; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.multi_range_count = test; +SELECT @@session.multi_range_count; + + +--echo '#------------------FN_DYNVARS_090_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.multi_range_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='multi_range_count'; + +--echo '#------------------FN_DYNVARS_090_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.multi_range_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='multi_range_count'; + + +--echo '#------------------FN_DYNVARS_090_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.multi_range_count = TRUE; +SELECT @@global.multi_range_count; +SET @@global.multi_range_count = FALSE; +SELECT @@global.multi_range_count; + + +--echo '#---------------------FN_DYNVARS_090_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.multi_range_count = 10; +SELECT @@multi_range_count = @@global.multi_range_count; + + +--echo '#---------------------FN_DYNVARS_090_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@multi_range_count = 100; +SELECT @@multi_range_count = @@local.multi_range_count; +SELECT @@local.multi_range_count = @@session.multi_range_count; + + +--echo '#---------------------FN_DYNVARS_090_11----------------------#' +############################################################################ +# Check if multi_range_count can be accessed with and without @@ sign # +############################################################################ + +SET multi_range_count = 1; +SELECT @@multi_range_count; +--Error ER_UNKNOWN_TABLE +SELECT local.multi_range_count; +--Error ER_UNKNOWN_TABLE +SELECT session.multi_range_count; +--Error ER_BAD_FIELD_ERROR +SELECT multi_range_count = @@session.multi_range_count; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.multi_range_count = @start_global_value; +SELECT @@global.multi_range_count; +SET @@session.multi_range_count = @start_session_value; +SELECT @@session.multi_range_count; + + +###################################################### +# END OF multi_range_count TESTS # +###################################################### + diff --git a/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc new file mode 100644 index 00000000000..23f0607b439 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc @@ -0,0 +1,184 @@ + +############## mysql-test\t\myisam_max_sort_file_size_basic.test ################ +# # +# Variable Name: myisam_max_sort_file_size # +# Scope: GLOBAL & SESSION # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 1 # +# Range: 1 - 65536 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan Maredia # +# # +# Description: Test Cases of Dynamic System Variable myisam_max_sort_file_size # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +################################################################################ + +--source include/load_sysvars.inc + +################################################################### +# START OF myisam_max_sort_file_size TESTS # +################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.myisam_max_sort_file_size; +SELECT @start_global_value; + +--echo '#--------------------FN_DYNVARS_094_01-------------------------#' +################################################################### +# Display the DEFAULT value of myisam_max_sort_file_size # +################################################################### + +SET @@global.myisam_max_sort_file_size = 500000; +SET @@global.myisam_max_sort_file_size = DEFAULT; +SELECT @@global.myisam_max_sort_file_size; + +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; + +--echo '#--------------------FN_DYNVARS_094_02-------------------------#' +################################################################### +# Check the DEFAULT value of myisam_max_sort_file_size # +################################################################### + +SET @@global.myisam_max_sort_file_size = DEFAULT; +SELECT @@global.myisam_max_sort_file_size = 2147483648; + +--echo '#--------------------FN_DYNVARS_094_03-------------------------#' +################################################################################## +# Change the value of myisam_max_sort_file_size to a valid value for GLOBAL Scope # +################################################################################## + +SET @@global.myisam_max_sort_file_size = 0; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = 1024; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = 123456789; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = 2147483648*2; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = 2147483648*1024; +SELECT @@global.myisam_max_sort_file_size; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = 2147483648*2147483648; + +--echo '#--------------------FN_DYNVARS_094_04-------------------------#' +################################################################################# +# Check if variable can be access with session scope # +################################################################################# + +--Error ER_GLOBAL_VARIABLE +SET @@myisam_max_sort_file_size = 2; + +--Error ER_GLOBAL_VARIABLE +SET @@session.myisam_max_sort_file_size = 3; + +--Error ER_GLOBAL_VARIABLE +SET @@local.myisam_max_sort_file_size = 4; + + + +--echo '#------------------FN_DYNVARS_094_05-----------------------#' +#################################################################### +# Change the value of myisam_max_sort_file_size to an invalid value # +#################################################################### + +SET @@global.myisam_max_sort_file_size = -1; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = -2147483648; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = -2147483649; +SELECT @@global.myisam_max_sort_file_size; +--Error ER_PARSE_ERROR +SET @@global.myisam_max_sort_file_size = 65530.34.; +SELECT @@global.myisam_max_sort_file_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_max_sort_file_size = 2147483649.56; +SELECT @@global.myisam_max_sort_file_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_max_sort_file_size = 1G; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + + +--echo '#------------------FN_DYNVARS_094_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SET @@global.myisam_max_sort_file_size = 3000; +SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_max_sort_file_size'; + + +--echo '#------------------FN_DYNVARS_094_07-----------------------#' +########################################################################### +# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # +########################################################################### + +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_max_sort_file_size'; + + +--echo '#------------------FN_DYNVARS_094_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.myisam_max_sort_file_size = TRUE; +SELECT @@global.myisam_max_sort_file_size; +SET @@global.myisam_max_sort_file_size = FALSE; +SELECT @@global.myisam_max_sort_file_size; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + + +SET @@global.myisam_max_sort_file_size = 512; +SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +################################################################################## +# Check if myisam_max_sort_file_size can be accessed without @@ sign and scope # +################################################################################## + +--Error ER_GLOBAL_VARIABLE +SET myisam_max_sort_file_size = 2048; +--Error ER_BAD_FIELD_ERROR +SELECT myisam_max_sort_file_size; + +SELECT @@myisam_max_sort_file_size; + +#verifying another syntax for setting value# +SET global myisam_max_sort_file_size = 64; + +#################################### +# Restore initial value # +#################################### + +SET @@global.myisam_max_sort_file_size = @start_global_value; +SELECT @@global.myisam_max_sort_file_size; + +######################################################## +# END OF myisam_max_sort_file_size TESTS # +######################################################## + diff --git a/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc new file mode 100644 index 00000000000..8485e79ff03 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/myisam_repair_threads_basic.inc @@ -0,0 +1,242 @@ +############## mysql-test\t\myisam_repair_threads_basic.test ################## +# # +# Variable Name: myisam_repair_threads # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 1 # +# Range: 1-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Sharique Abdullah # +# # +# Description: Test Cases of Dynamic System Variable myisam_repair_threads # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +###################################################################### +# START OF myisam_repair_threads TESTS # +###################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.myisam_repair_threads; +SELECT @start_global_value; +SET @start_session_value = @@session.myisam_repair_threads; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +################################################################# +# Display the DEFAULT value of myisam_block_size # +################################################################# + +SET @@global.myisam_repair_threads = 100; +SET @@global.myisam_repair_threads = DEFAULT; +SELECT @@global.myisam_repair_threads ; + +SET @@session.myisam_repair_threads = 200; +SET @@session.myisam_repair_threads = DEFAULT; +SELECT @@session.myisam_repair_threads ; + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +###################################################################### +# Check the DEFAULT value of myisam_repair_threads # +###################################################################### + +SET @@global.myisam_repair_threads = DEFAULT; +SELECT @@global.myisam_repair_threads = 1; + +SET @@session.myisam_repair_threads = DEFAULT; +SELECT @@session.myisam_repair_threads = 1; + + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +############################################################################### +# Change the value of myisam_repair_threads to a valid value for GLOBAL Scope# +############################################################################### + +SET @@global.myisam_repair_threads = 1; +SELECT @@global.myisam_repair_threads ; + +SET @@global.myisam_repair_threads = 4294967295; +SELECT @@global.myisam_repair_threads ; + +SET @@global.myisam_repair_threads = 655354; +SELECT @@global.myisam_repair_threads ; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +############################################################################### +# Change the value of myisam_repair_threads to a valid value for SESSION +# Scope +############################################################################### + +SET @@session.myisam_repair_threads = 1; +SELECT @@session.myisam_repair_threads ; + +SET @@session.myisam_repair_threads = 4294967295; +SELECT @@session.myisam_repair_threads ; + +SET @@session.myisam_repair_threads = 655345; +SELECT @@session.myisam_repair_threads ; + + + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +################################################################## +# Change the value of myisam_repair_threads to an invalid value # +################################################################## + +SET @@global.myisam_repair_threads = 0; +SELECT @@global.myisam_repair_threads ; + +SET @@global.myisam_repair_threads = -1024; +SELECT @@global.myisam_repair_threads ; + +SET @@global.myisam_repair_threads = 429496729533; +SELECT @@global.myisam_repair_threads ; + + +--Error ER_PARSE_ERROR +SET @@global.myisam_repair_threads = 65530.34.; +SELECT @@global.myisam_repair_threads ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_repair_threads = test; +SELECT @@global.myisam_repair_threads ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_repair_threads = "test"; +SELECT @@global.myisam_repair_threads ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_repair_threads = 'test'; +SELECT @@global.myisam_repair_threads ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_repair_threads = ON; +SELECT @@global.myisam_repair_threads ; + + +SET @@session.myisam_repair_threads = 0; +SELECT @@session.myisam_repair_threads ; + +SET @@session.myisam_repair_threads = -2; +SELECT @@session.myisam_repair_threads ; + +--Error ER_PARSE_ERROR + +SET @@session.myisam_repair_threads = 65530.34.; +SELECT @@session.myisam_repair_threads ; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.myisam_repair_threads = test; +SELECT @@session.myisam_repair_threads ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.myisam_repair_threads = "test"; +SELECT @@session.myisam_repair_threads ; + + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.myisam_repair_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_repair_threads '; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.myisam_repair_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_repair_threads '; + + +--echo '#------------------FN_DYNVARS_005_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.myisam_repair_threads = TRUE; +SELECT @@global.myisam_repair_threads ; +SET @@global.myisam_repair_threads = FALSE; +SELECT @@global.myisam_repair_threads ; + + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +############################################################################### +# Check if accessing variable with and without GLOBAL point to same variable # +############################################################################### + +SET @@global.myisam_repair_threads = 10; +SELECT @@myisam_repair_threads = @@global.myisam_repair_threads ; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to +# same session variable # +######################################################################################################## + +SET @@myisam_repair_threads = 100; +SELECT @@myisam_repair_threads = @@local.myisam_repair_threads ; +SELECT @@local.myisam_repair_threads = @@session.myisam_repair_threads ; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +################################################################################### +# Check if myisam_repair_threads can be accessed with and without @@ sign # +################################################################################### + +SET myisam_repair_threads = 1; +SELECT @@myisam_repair_threads ; +--Error ER_UNKNOWN_TABLE + +SELECT local.myisam_repair_threads ; + +--Error ER_UNKNOWN_TABLE +SELECT session.myisam_repair_threads ; + +--Error ER_BAD_FIELD_ERROR +SELECT myisam_repair_threads = @@session.myisam_repair_threads ; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.myisam_repair_threads = @start_global_value; +SELECT @@global.myisam_repair_threads ; +SET @@session.myisam_repair_threads = @start_session_value; +SELECT @@session.myisam_repair_threads ; + + +############################################################# +# END OF myisam_repair_threads TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc new file mode 100644 index 00000000000..8e36d8a2c70 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc @@ -0,0 +1,240 @@ +############## mysql-test\t\myisam_sort_buffer_size_basic.test ############### +# # +# Variable Name: myisam_sort_buffer_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: # +# Range: # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +# Description: Test Cases of Dynamic System Variable myisam_sort_buffer_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF myisam_sort_buffer_size TESTS # +######################################################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.myisam_sort_buffer_size ; +SELECT @start_global_value; +SET @start_session_value = @@session.myisam_sort_buffer_size ; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +######################################################################## +# Display the DEFAULT value of myisam_block_size # +######################################################################## + +SET @@global.myisam_sort_buffer_size = 100; +SET @@global.myisam_sort_buffer_size = DEFAULT; +SELECT @@global.myisam_sort_buffer_size ; + +SET @@session.myisam_sort_buffer_size = 200; +SET @@session.myisam_sort_buffer_size = DEFAULT; +SELECT @@session.myisam_sort_buffer_size ; + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of myisam_sort_buffer_size # +######################################################################## + +SET @@global.myisam_sort_buffer_size = DEFAULT; +SELECT @@global.myisam_sort_buffer_size = 8388608; + +SET @@session.myisam_sort_buffer_size = DEFAULT; +SELECT @@session.myisam_sort_buffer_size = 8388608; + + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +################################################################################## +# Change the value of myisam_sort_buffer_size to a valid value for GLOBAL Scope # +################################################################################## + +SET @@global.myisam_sort_buffer_size = 4; +SELECT @@global.myisam_sort_buffer_size ; + +SET @@global.myisam_sort_buffer_size = 4294967295; +SELECT @@global.myisam_sort_buffer_size ; + +SET @@global.myisam_sort_buffer_size = 655354; +SELECT @@global.myisam_sort_buffer_size ; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +################################################################################### +# Change the value of myisam_sort_buffer_size to a valid value for SESSION Scope # +################################################################################### + +SET @@session.myisam_sort_buffer_size = 4; +SELECT @@session.myisam_sort_buffer_size ; + +SET @@session.myisam_sort_buffer_size = 4294967295; +SELECT @@session.myisam_sort_buffer_size ; + +SET @@session.myisam_sort_buffer_size = 655345; +SELECT @@session.myisam_sort_buffer_size ; + + + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +#################################################################### +# Change the value of myisam_sort_buffer_size to an invalid value # +#################################################################### + +SET @@global.myisam_sort_buffer_size = 0; +SELECT @@global.myisam_sort_buffer_size ; + +SET @@global.myisam_sort_buffer_size = -1024; +SELECT @@global.myisam_sort_buffer_size ; + +SET @@global.myisam_sort_buffer_size = 429496729533; +SELECT @@global.myisam_sort_buffer_size ; + + +--Error ER_PARSE_ERROR +SET @@global.myisam_sort_buffer_size = 65530.34.; +SELECT @@global.myisam_sort_buffer_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_sort_buffer_size = test; +SELECT @@global.myisam_sort_buffer_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_sort_buffer_size = "test"; +SELECT @@global.myisam_sort_buffer_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_sort_buffer_size = 'test'; +SELECT @@global.myisam_sort_buffer_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.myisam_sort_buffer_size = ON; +SELECT @@global.myisam_sort_buffer_size ; + + +SET @@session.myisam_sort_buffer_size = 0; +SELECT @@session.myisam_sort_buffer_size ; + +SET @@session.myisam_sort_buffer_size = -2; +SELECT @@session.myisam_sort_buffer_size ; + +--Error ER_PARSE_ERROR + +SET @@session.myisam_sort_buffer_size = 65530.34.; +SELECT @@session.myisam_sort_buffer_size ; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.myisam_sort_buffer_size = test; +SELECT @@session.myisam_sort_buffer_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.myisam_sort_buffer_size = "test"; +SELECT @@session.myisam_sort_buffer_size ; + + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_sort_buffer_size '; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_sort_buffer_size '; + + +--echo '#------------------FN_DYNVARS_005_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.myisam_sort_buffer_size = TRUE; +SELECT @@global.myisam_sort_buffer_size ; +SET @@global.myisam_sort_buffer_size = FALSE; +SELECT @@global.myisam_sort_buffer_size ; + + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +#################################################################################### +# Check if accessing variable with and without GLOBAL point to same variable # +#################################################################################### + +SET @@global.myisam_sort_buffer_size = 10; +SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@myisam_sort_buffer_size = 100; +SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; +SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +################################################################################### +# Check if myisam_sort_buffer_size can be accessed with and without @@ sign # +################################################################################### + +SET myisam_sort_buffer_size = 1; +SELECT @@myisam_sort_buffer_size ; +--Error ER_UNKNOWN_TABLE + +SELECT local.myisam_sort_buffer_size ; + +--Error ER_UNKNOWN_TABLE +SELECT session.myisam_sort_buffer_size ; + +--Error ER_BAD_FIELD_ERROR +SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.myisam_sort_buffer_size = @start_global_value; +SELECT @@global.myisam_sort_buffer_size ; +SET @@session.myisam_sort_buffer_size = @start_session_value; +SELECT @@session.myisam_sort_buffer_size ; + + +############################################################# +# END OF myisam_sort_buffer_size TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc new file mode 100644 index 00000000000..537d8eea6c6 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/net_retry_count_basic.inc @@ -0,0 +1,217 @@ +############## mysql-test\t\net_retry_count_basic.test ############### +# # +# Variable Name: net_retry_count # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:10 # +# Range: 1-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable net_retry_count # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +############################################################### +# START OF net_retry_count TESTS # +############################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.net_retry_count; +SELECT @start_global_value; +SET @start_session_value = @@session.net_retry_count; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_111_01-------------------------#' +############################################################### +# Display the DEFAULT value of net_retry_count # +############################################################### + +SET @@global.net_retry_count = 100; +SET @@global.net_retry_count = DEFAULT; +SELECT @@global.net_retry_count; + +SET @@session.net_retry_count = 200; +SET @@session.net_retry_count = DEFAULT; +SELECT @@session.net_retry_count; + + +--echo '#--------------------FN_DYNVARS_111_02-------------------------#' +############################################################### +# Check the DEFAULT value of net_retry_count # +############################################################### + +SET @@global.net_retry_count = DEFAULT; +SELECT @@global.net_retry_count = 10; + +SET @@session.net_retry_count = DEFAULT; +SELECT @@session.net_retry_count = 10; + + +--echo '#--------------------FN_DYNVARS_111_03-------------------------#' +######################################################################### +# Change the value of net_retry_count to a valid value for GLOBAL Scope # +######################################################################### + +SET @@global.net_retry_count = 1; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = 2; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = 4294967295; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = 4294967294; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = 65536; +SELECT @@global.net_retry_count; + +--echo '#--------------------FN_DYNVARS_111_04-------------------------#' +########################################################################## +# Change the value of net_retry_count to a valid value for SESSION Scope # +########################################################################## + +SET @@session.net_retry_count = 1; +SELECT @@session.net_retry_count; +SET @@session.net_retry_count = 2; +SELECT @@session.net_retry_count; +SET @@session.net_retry_count = 65535; +SELECT @@session.net_retry_count; +SET @@session.net_retry_count = 4294967295; +SELECT @@session.net_retry_count; +SET @@session.net_retry_count = 4294967294; +SELECT @@session.net_retry_count; + +--echo '#------------------FN_DYNVARS_111_05-----------------------#' +########################################################### +# Change the value of net_retry_count to an invalid value # +########################################################### + +SET @@global.net_retry_count = 0; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = -1024; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = 4294967296; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = 429496729500; +SELECT @@global.net_retry_count; +--Error ER_PARSE_ERROR +SET @@global.net_retry_count = 65530.34.; +SELECT @@global.net_retry_count; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.net_retry_count = test; +SELECT @@global.net_retry_count; + +SET @@session.net_retry_count = 0; +SELECT @@session.net_retry_count; +SET @@session.net_retry_count = -2; +SELECT @@session.net_retry_count; +--Error ER_PARSE_ERROR +SET @@session.net_retry_count = 65530.34.; +SET @@session.net_retry_count = 6555015425; +SELECT @@session.net_retry_count; +SET @@session.net_retry_count = 4294967296; +SELECT @@session.net_retry_count; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.net_retry_count = test; +SELECT @@session.net_retry_count; + + +--echo '#------------------FN_DYNVARS_111_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.net_retry_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='net_retry_count'; + +--echo '#------------------FN_DYNVARS_111_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.net_retry_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='net_retry_count'; + + +--echo '#------------------FN_DYNVARS_111_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.net_retry_count = TRUE; +SELECT @@global.net_retry_count; +SET @@global.net_retry_count = FALSE; +SELECT @@global.net_retry_count; + + +--echo '#---------------------FN_DYNVARS_111_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.net_retry_count = 10; +SELECT @@net_retry_count = @@global.net_retry_count; + + +--echo '#---------------------FN_DYNVARS_111_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@net_retry_count = 100; +SELECT @@net_retry_count = @@local.net_retry_count; +SELECT @@local.net_retry_count = @@session.net_retry_count; + + +--echo '#---------------------FN_DYNVARS_111_11----------------------#' +########################################################################## +# Check if net_retry_count can be accessed with and without @@ sign # +########################################################################## + +SET net_retry_count = 1; +SELECT @@net_retry_count; +--Error ER_UNKNOWN_TABLE +SELECT local.net_retry_count; +--Error ER_UNKNOWN_TABLE +SELECT session.net_retry_count; +--Error ER_BAD_FIELD_ERROR +SELECT net_retry_count = @@session.net_retry_count; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.net_retry_count = @start_global_value; +SELECT @@global.net_retry_count; +SET @@session.net_retry_count = @start_session_value; +SELECT @@session.net_retry_count; + + +#################################################### +# END OF net_retry_count TESTS # +#################################################### + diff --git a/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc new file mode 100644 index 00000000000..208fe6b3da4 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/query_alloc_block_size_basic.inc @@ -0,0 +1,225 @@ +############## mysql-test\t\query_alloc_block_size_basic.test ############### +# # +# Variable Name: query_alloc_block_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 8192 # +# Range: 1024-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable query_alloc_block_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +################################################################### +# START OF query_alloc_block_size TESTS # +################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.query_alloc_block_size; +SELECT @start_global_value; +SET @start_session_value = @@session.query_alloc_block_size; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_130_01-------------------------#' +################################################################### +# Display the DEFAULT value of query_alloc_block_size # +################################################################### + +SET @@global.query_alloc_block_size = 10000; +SET @@global.query_alloc_block_size = DEFAULT; +SELECT @@global.query_alloc_block_size; + +SET @@session.query_alloc_block_size = 20000; +SET @@session.query_alloc_block_size = DEFAULT; +SELECT @@session.query_alloc_block_size; + + +--echo '#--------------------FN_DYNVARS_130_02-------------------------#' +################################################################### +# Check the DEFAULT value of query_alloc_block_size # +################################################################### + +SET @@global.query_alloc_block_size = DEFAULT; +SELECT @@global.query_alloc_block_size = 8192; + +SET @@session.query_alloc_block_size = DEFAULT; +SELECT @@session.query_alloc_block_size = 8192; + + +--echo '#--------------------FN_DYNVARS_130_03-------------------------#' +############################################################################# +# Change the value of query_alloc_block_size to a valid value for GLOBAL Scope # +############################################################################# + +SET @@global.query_alloc_block_size = 1024; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = 1025; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = 4294967295; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = 4294967294; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = 65536; +SELECT @@global.query_alloc_block_size; + +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_130_04-------------------------#' +################################################################################# +# Change the value of query_alloc_block_size to a valid value for SESSION Scope # +################################################################################# + +SET @@session.query_alloc_block_size = 1024; +SELECT @@session.query_alloc_block_size; +SET @@session.query_alloc_block_size = 1025; +SELECT @@session.query_alloc_block_size; +SET @@session.query_alloc_block_size = 4294967295; +SELECT @@session.query_alloc_block_size; +SET @@session.query_alloc_block_size = 4294967294; +SELECT @@session.query_alloc_block_size; +SET @@session.query_alloc_block_size = 655536; +SELECT @@session.query_alloc_block_size; + +--echo '#------------------FN_DYNVARS_130_05-----------------------#' +################################################################## +# Change the value of query_alloc_block_size to an invalid value # +################################################################## + +SET @@global.query_alloc_block_size = 64; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = -1; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = 1023; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = 4294967296; +SELECT @@global.query_alloc_block_size; +--Error ER_PARSE_ERROR +SET @@global.query_alloc_block_size = 65530.34.; +SELECT @@global.query_alloc_block_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_alloc_block_size = test; +SELECT @@global.query_alloc_block_size; + +SET @@session.query_alloc_block_size = 64; +SELECT @@session.query_alloc_block_size; +SET @@session.query_alloc_block_size = -2; +SELECT @@session.query_alloc_block_size; +--Error ER_PARSE_ERROR +SET @@session.query_alloc_block_size = 65530.34.; +SET @@session.query_alloc_block_size = 1023; +SELECT @@session.query_alloc_block_size; +SET @@session.query_alloc_block_size = 4294967296; +SELECT @@session.query_alloc_block_size; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.query_alloc_block_size = test; +SELECT @@session.query_alloc_block_size; + +--echo '#------------------FN_DYNVARS_130_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +#SET @@global.query_alloc_block_size = 1; +#SET @@session.query_alloc_block_size = 12; +--echo 'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement'; + +SET @@global.query_alloc_block_size = 1; +SET @@session.query_alloc_block_size = 12; + +SELECT @@global.query_alloc_block_size = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_alloc_block_size'; + + +--echo '#------------------FN_DYNVARS_130_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.query_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_alloc_block_size'; + + +--echo '#------------------FN_DYNVARS_130_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.query_alloc_block_size = TRUE; +SELECT @@global.query_alloc_block_size; +SET @@global.query_alloc_block_size = FALSE; +SELECT @@global.query_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_130_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + +SET @@global.query_alloc_block_size = 2048; +SELECT @@query_alloc_block_size = @@global.query_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_130_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@query_alloc_block_size = 5000; +SELECT @@query_alloc_block_size = @@local.query_alloc_block_size; +SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_130_11----------------------#' +############################################################################## +# Check if query_alloc_block_size can be accessed with and without @@ sign # +############################################################################## + +SET query_alloc_block_size = 1024; +SELECT @@query_alloc_block_size; +--Error ER_UNKNOWN_TABLE +SELECT local.query_alloc_block_size; +--Error ER_UNKNOWN_TABLE +SELECT session.query_alloc_block_size; +--Error ER_BAD_FIELD_ERROR +SELECT query_alloc_block_size = @@session.query_alloc_block_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.query_alloc_block_size = @start_global_value; +SELECT @@global.query_alloc_block_size; +SET @@session.query_alloc_block_size = @start_session_value; +SELECT @@session.query_alloc_block_size; + + +######################################################## +# END OF query_alloc_block_size TESTS # +######################################################## + diff --git a/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc new file mode 100644 index 00000000000..2eb4a597eef --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/query_cache_limit_basic.inc @@ -0,0 +1,178 @@ +############## mysql-test\t\query_cache_limit_basic.test ############### +# # +# Variable Name: query_cache_limit # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 1048576 # +# Min value: 0 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable query_cache_limit # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_query_cache.inc +--source include/load_sysvars.inc + +######################################################################## +# START OF query_cache_limit TESTS # +######################################################################## + + +######################################################################## +# Saving initial value of query_cache_limit in a temporary variable # +######################################################################## + +SET @start_value = @@global.query_cache_limit; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_131_01------------------------#' +######################################################################## +# Display the DEFAULT value of query_cache_limit # +######################################################################## + +SET @@global.query_cache_limit = 99; +SET @@global.query_cache_limit = DEFAULT; +SELECT @@global.query_cache_limit; + + +--echo '#---------------------FN_DYNVARS_131_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.query_cache_limit = @start_value; +SELECT @@global.query_cache_limit = 1048576; + + +--echo '#--------------------FN_DYNVARS_131_03------------------------#' +######################################################################## +# Change the value of query_cache_limit to a valid value # +######################################################################## + +SET @@global.query_cache_limit = 0; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = 1; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = 1048576; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = 1048575; +SELECT @@global.query_cache_limit; + + +--echo '#--------------------FN_DYNVARS_131_04-------------------------#' +########################################################################### +# Change the value of query_cache_limit to invalid value # +########################################################################### + +SET @@global.query_cache_limit = -1; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = 4294967296; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = 10240022115; +SELECT @@global.query_cache_limit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_limit = 10000.01; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = -1024; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = 42949672950; +SELECT @@global.query_cache_limit; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_limit = ON; +SELECT @@global.query_cache_limit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_limit = 'test'; +SELECT @@global.query_cache_limit; + + +--echo '#-------------------FN_DYNVARS_131_05----------------------------#' +########################################################################### +# Test if accessing session query_cache_limit gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.query_cache_limit = 0; +SELECT @@query_cache_limit; + + +--echo '#----------------------FN_DYNVARS_131_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.query_cache_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_limit'; + +SELECT @@query_cache_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_limit'; + + +--echo '#---------------------FN_DYNVARS_131_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.query_cache_limit = TRUE; +SELECT @@global.query_cache_limit; +SET @@global.query_cache_limit = FALSE; +SELECT @@global.query_cache_limit; + + +--echo '#---------------------FN_DYNVARS_131_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.query_cache_limit = 1; +SELECT @@query_cache_limit = @@global.query_cache_limit; + + +--echo '#---------------------FN_DYNVARS_131_09----------------------#' +########################################################################## +# Check if query_cache_limit can be accessed with and without @@ sign # +########################################################################## + +--Error ER_GLOBAL_VARIABLE +SET query_cache_limit = 1; +SELECT @@query_cache_limit; +--Error ER_PARSE_ERROR +SET local.query_cache_limit = 1; +--Error ER_UNKNOWN_TABLE +SELECT local.query_cache_limit; +--Error ER_PARSE_ERROR +SET global.query_cache_limit = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.query_cache_limit; +--Error ER_BAD_FIELD_ERROR +SELECT query_cache_limit = @@session.query_cache_limit; + + +############################## +# Restore initial value # +############################## + +SET @@global.query_cache_limit = @start_value; +SELECT @@global.query_cache_limit; + + +######################################################################## +# END OF query_cache_limit TESTS # +######################################################################## diff --git a/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc new file mode 100644 index 00000000000..1b65e035b18 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/query_cache_min_res_unit_basic.inc @@ -0,0 +1,187 @@ +############## mysql-test\t\query_cache_min_res_unit_basic.test ############### +# # +# Variable Name: query_cache_min_res_unit # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:1024 # +# Min Value:0 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman Rawala # +# # +# Description: Test Cases of Dynamic System Variable query_cache_min_res_unit # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_query_cache.inc +--source include/load_sysvars.inc + +######################################################################## + + +######################################################################## +# START OF query_cache_min_res_unit TESTS # +######################################################################## + + +############################################################################### +# Saving initial value of query_cache_min_res_unit in a temporary variable # +############################################################################### + +SET @start_value = @@global.query_cache_min_res_unit; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_132_01------------------------#' +############################################################################### +# Display the DEFAULT value of query_cache_min_res_unit # +############################################################################### + +SET @@global.query_cache_min_res_unit = 99; +SET @@global.query_cache_min_res_unit = DEFAULT; +SELECT @@global.query_cache_min_res_unit; + + +--echo '#---------------------FN_DYNVARS_132_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.query_cache_min_res_unit = @start_value; +SELECT @@global.query_cache_min_res_unit = 4096; + + +--echo '#--------------------FN_DYNVARS_132_03------------------------#' +################################################################################ +# Change the value of query_cache_min_res_unit to a valid value # +################################################################################ + +SET @@global.query_cache_min_res_unit = 0; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = 1; +SELECT @@global.query_cache_min_res_unit; +--echo 'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512'; +SET @@global.query_cache_min_res_unit = 512; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = 513; +SELECT @@global.query_cache_min_res_unit; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.query_cache_min_res_unit = 1048576; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = 1048575; +SELECT @@global.query_cache_min_res_unit; + + +--echo '#--------------------FN_DYNVARS_132_04-------------------------#' +################################################################################### +# Change the value of query_cache_min_res_unit to invalid value # +################################################################################### + +SET @@global.query_cache_min_res_unit = -1; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = 4294967296; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = 511; +SELECT @@global.query_cache_min_res_unit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_min_res_unit = 10000.01; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = -1024; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = 42949672950; +SELECT @@global.query_cache_min_res_unit; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_min_res_unit = ON; +SELECT @@global.query_cache_min_res_unit; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_min_res_unit = 'test'; +SELECT @@global.query_cache_min_res_unit; + + +--echo '#-------------------FN_DYNVARS_132_05----------------------------#' +################################################################################### +# Test if accessing session query_cache_min_res_unit gives error # +################################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.query_cache_min_res_unit = 0; +SELECT @@query_cache_min_res_unit; + + +--echo '#----------------------FN_DYNVARS_132_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_min_res_unit'; + +SELECT @@query_cache_min_res_unit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_min_res_unit'; + + +--echo '#---------------------FN_DYNVARS_132_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.query_cache_min_res_unit = TRUE; +SELECT @@global.query_cache_min_res_unit; +SET @@global.query_cache_min_res_unit = FALSE; +SELECT @@global.query_cache_min_res_unit; + + +--echo '#---------------------FN_DYNVARS_132_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.query_cache_min_res_unit = 1; +SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit; + + +--echo '#---------------------FN_DYNVARS_132_09----------------------#' +################################################################################## +# Check if query_cache_min_res_unit can be accessed with and without @@ sign # +################################################################################## + +--Error ER_GLOBAL_VARIABLE +SET query_cache_min_res_unit = 1; +SELECT @@query_cache_min_res_unit; +--Error ER_PARSE_ERROR +SET local.query_cache_min_res_unit = 1; +--Error ER_UNKNOWN_TABLE +SELECT local.query_cache_min_res_unit; +--Error ER_PARSE_ERROR +SET global.query_cache_min_res_unit = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.query_cache_min_res_unit; +--Error ER_BAD_FIELD_ERROR +SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit; + + +############################## +# Restore initial value # +############################## + +SET @@global.query_cache_min_res_unit = @start_value; +SELECT @@global.query_cache_min_res_unit; + + +######################################################################## +# END OF query_cache_min_res_unit TESTS # +######################################################################## diff --git a/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc new file mode 100644 index 00000000000..1a3f9e1efe2 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/query_cache_size_basic.inc @@ -0,0 +1,175 @@ +############## mysql-test\t\query_cache_size_basic.test ############### +# # +# Variable Name: query_cache_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 0 # +# Range: - # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable query_cache_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/have_query_cache.inc +--source include/load_sysvars.inc + +######################################################################## +# START OF query_cache_size TESTS # +######################################################################## + + +############################################################################### +# Saving initial value of query_cache_size in a temporary variable # +############################################################################### + +SET @start_value = @@global.query_cache_size; +SELECT @start_value; + +--echo '#--------------------FN_DYNVARS_133_01------------------------#' +############################################################################### +# Display the DEFAULT value of query_cache_size # +############################################################################### + +SET @@global.query_cache_size = 99; +SET @@global.query_cache_size = DEFAULT; +SELECT @@global.query_cache_size; + +--echo '#---------------------FN_DYNVARS_133_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.query_cache_size = @start_value; +SELECT @@global.query_cache_size = 0; + +--echo '#--------------------FN_DYNVARS_133_03------------------------#' +################################################################################ +# Change the value of query_cache_size to a valid value # +################################################################################ + +SET @@global.query_cache_size = 0; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = 1; +SELECT @@global.query_cache_size; + +SET @@global.query_cache_size = 512; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = 1024; +SELECT @@global.query_cache_size; +--echo : 'Bug#34880: Warnings are coming on assinging valid values to variable +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.query_cache_size = 1048576; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = 1048575; +SELECT @@global.query_cache_size; + +--echo '#--------------------FN_DYNVARS_133_04-------------------------#' +################################################################################### +# Change the value of query_cache_size to invalid value # +################################################################################### + +SET @@global.query_cache_size = -1; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = 4294967296; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = 511; +SELECT @@global.query_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_size = 10000.01; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = -1024; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = 42949672950; +SELECT @@global.query_cache_size; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_size = ON; +SELECT @@global.query_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_cache_size = 'test'; +SELECT @@global.query_cache_size; + +--echo '#-------------------FN_DYNVARS_133_05----------------------------#' +################################################################################### +# Test if accessing session query_cache_size gives error # +################################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.query_cache_size = 0; +SELECT @@query_cache_size; + +--echo '#----------------------FN_DYNVARS_133_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.query_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_size'; + +SELECT @@query_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_size'; + +--echo '#---------------------FN_DYNVARS_133_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.query_cache_size = TRUE; +SELECT @@global.query_cache_size; +SET @@global.query_cache_size = FALSE; +SELECT @@global.query_cache_size; + +--echo '#---------------------FN_DYNVARS_133_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.query_cache_size = 1; +SELECT @@query_cache_size = @@global.query_cache_size; + +--echo '#---------------------FN_DYNVARS_133_09----------------------#' +################################################################################## +# Check if query_cache_size can be accessed with and without @@ sign # +################################################################################## + +--Error ER_GLOBAL_VARIABLE +SET query_cache_size = 1; +SELECT @@query_cache_size; +--Error ER_PARSE_ERROR +SET local.query_cache_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT local.query_cache_size; +--Error ER_PARSE_ERROR +SET global.query_cache_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.query_cache_size; +--Error ER_BAD_FIELD_ERROR +SELECT query_cache_size = @@session.query_cache_size; + +############################## +# Restore initial value # +############################## + +SET @@global.query_cache_size = @start_value; +SELECT @@global.query_cache_size; + +######################################################################## +# END OF query_cache_size TESTS # +######################################################################## + diff --git a/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc new file mode 100644 index 00000000000..3a8608736c5 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/query_prealloc_size_basic.inc @@ -0,0 +1,241 @@ +################# mysql-test\t\query_prealloc_size_basic.test ################## +# # +# Variable Name: query_prealloc_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 8192 # +# Range: 8192-4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +# Description: Test Cases of Dynamic System Variable query_prealloc_size # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: # +# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # +# # +################################################################################ + +--source include/load_sysvars.inc + +######################################################################## +# START OF query_prealloc_size TESTS # +######################################################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.query_prealloc_size ; +SELECT @start_global_value; +SET @start_session_value = @@session.query_prealloc_size ; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +######################################################################## +# Display the DEFAULT value of myisam_block_size # +######################################################################## + +SET @@global.query_prealloc_size = 100; +SET @@global.query_prealloc_size = DEFAULT; +SELECT @@global.query_prealloc_size ; + +SET @@session.query_prealloc_size = 200; +SET @@session.query_prealloc_size = DEFAULT; +SELECT @@session.query_prealloc_size ; + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of query_prealloc_size # +######################################################################## + +SET @@global.query_prealloc_size = DEFAULT; +SELECT @@global.query_prealloc_size = 8192; + +SET @@session.query_prealloc_size = DEFAULT; +SELECT @@session.query_prealloc_size = 8192; + + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +################################################################################ +# Change the value of query_prealloc_size to a valid value for GLOBAL Scope # +################################################################################ + +SET @@global.query_prealloc_size = 8192; +SELECT @@global.query_prealloc_size ; + +SET @@global.query_prealloc_size = 4294967295; +SELECT @@global.query_prealloc_size ; + +SET @@global.query_prealloc_size = 655354; +SELECT @@global.query_prealloc_size ; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +################################################################################## +# Change the value of query_prealloc_size to a valid value for SESSION Scope # +################################################################################## + +SET @@session.query_prealloc_size = 8192; +SELECT @@session.query_prealloc_size ; + +SET @@session.query_prealloc_size = 4294967295; +SELECT @@session.query_prealloc_size ; + +SET @@session.query_prealloc_size = 655345; +SELECT @@session.query_prealloc_size ; + + + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +#################################################################### +# Change the value of query_prealloc_size to an invalid value # +#################################################################### + +SET @@global.query_prealloc_size = 0; +SELECT @@global.query_prealloc_size ; + +SET @@global.query_prealloc_size = -1024; +SELECT @@global.query_prealloc_size ; + +SET @@global.query_prealloc_size = 429496729533; +SELECT @@global.query_prealloc_size ; + + +--Error ER_PARSE_ERROR +SET @@global.query_prealloc_size = 65530.34.; +SELECT @@global.query_prealloc_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_prealloc_size = test; +SELECT @@global.query_prealloc_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_prealloc_size = "test"; +SELECT @@global.query_prealloc_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_prealloc_size = 'test'; +SELECT @@global.query_prealloc_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.query_prealloc_size = ON; +SELECT @@global.query_prealloc_size ; + + +SET @@session.query_prealloc_size = 0; +SELECT @@session.query_prealloc_size ; + +SET @@session.query_prealloc_size = -2; +SELECT @@session.query_prealloc_size ; + +--Error ER_PARSE_ERROR + +SET @@session.query_prealloc_size = 65530.34.; +SELECT @@session.query_prealloc_size ; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.query_prealloc_size = test; +SELECT @@session.query_prealloc_size ; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.query_prealloc_size = "test"; +SELECT @@session.query_prealloc_size ; + + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_prealloc_size '; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_prealloc_size '; + + +--echo '#------------------FN_DYNVARS_005_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.query_prealloc_size = TRUE; +SELECT @@global.query_prealloc_size ; +SET @@global.query_prealloc_size = FALSE; +SELECT @@global.query_prealloc_size ; + + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +################################################################################ +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################ + +SET @@global.query_prealloc_size = 10; +SELECT @@query_prealloc_size = @@global.query_prealloc_size ; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +############################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to # +# to the same session variable # +############################################################################## + +SET @@query_prealloc_size = 100; +SELECT @@query_prealloc_size = @@local.query_prealloc_size ; +SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +################################################################################ +# Check if query_prealloc_size can be accessed with and without @@ sign # +################################################################################ + +SET query_prealloc_size = 1; +SELECT @@query_prealloc_size ; +--Error ER_UNKNOWN_TABLE + +SELECT local.query_prealloc_size ; + +--Error ER_UNKNOWN_TABLE +SELECT session.query_prealloc_size ; + +--Error ER_BAD_FIELD_ERROR +SELECT query_prealloc_size = @@session.query_prealloc_size ; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.query_prealloc_size = @start_global_value; +SELECT @@global.query_prealloc_size ; +SET @@session.query_prealloc_size = @start_session_value; +SELECT @@session.query_prealloc_size ; + + +############################################################# +# END OF query_prealloc_size TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc new file mode 100644 index 00000000000..37692cc8c35 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/range_alloc_block_size_basic.inc @@ -0,0 +1,208 @@ +############## mysql-test\t\range_alloc_block_size_basic.test ############### +# # +# Variable Name: range_alloc_block_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:2048 # +# Max value: 4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable range_alloc_block_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +###################################################################### +# START OF range_alloc_block_size TESTS # +###################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.range_alloc_block_size; +SELECT @start_global_value; +SET @start_session_value = @@session.range_alloc_block_size; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_137_01-------------------------#' +###################################################################### +# Display the DEFAULT value of range_alloc_block_size # +###################################################################### + +SET @@global.range_alloc_block_size = 100; +SET @@global.range_alloc_block_size = DEFAULT; +SELECT @@global.range_alloc_block_size; + +SET @@session.range_alloc_block_size = 200; +SET @@session.range_alloc_block_size = DEFAULT; +SELECT @@session.range_alloc_block_size; + + +--echo '#--------------------FN_DYNVARS_137_02-------------------------#' +###################################################################### +# Check the DEFAULT value of range_alloc_block_size # +###################################################################### + +SET @@global.range_alloc_block_size = DEFAULT; +SELECT @@global.range_alloc_block_size = 2048; + +SET @@session.range_alloc_block_size = DEFAULT; +SELECT @@session.range_alloc_block_size = 2048; + + +--echo '#--------------------FN_DYNVARS_137_03-------------------------#' +################################################################################ +# Change the value of range_alloc_block_size to a valid value for GLOBAL Scope # +################################################################################ + +SET @@global.range_alloc_block_size = 2048; +SELECT @@global.range_alloc_block_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.range_alloc_block_size = 4294967295; +SELECT @@global.range_alloc_block_size; +SET @@global.range_alloc_block_size = 4294967294; +SELECT @@global.range_alloc_block_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_137_04-------------------------#' +################################################################################### +# Change the value of range_alloc_block_size to a valid value for SESSION Scope # +################################################################################### + +SET @@session.range_alloc_block_size = 2048; +SELECT @@session.range_alloc_block_size; +SET @@session.range_alloc_block_size = 4294967295; +SELECT @@session.range_alloc_block_size; +SET @@session.range_alloc_block_size = 4294967294; +SELECT @@session.range_alloc_block_size; + + +--echo '#------------------FN_DYNVARS_137_05-----------------------#' +################################################################## +# Change the value of range_alloc_block_size to an invalid value # +################################################################## + +SET @@global.range_alloc_block_size = 0; +SELECT @@global.range_alloc_block_size; +SET @@global.range_alloc_block_size = -1024; +SELECT @@global.range_alloc_block_size; +SET @@global.range_alloc_block_size = 42949672951; +SELECT @@global.range_alloc_block_size; +--Error ER_PARSE_ERROR +SET @@global.range_alloc_block_size = 65530.34.; +SELECT @@global.range_alloc_block_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.range_alloc_block_size = test; +SELECT @@global.range_alloc_block_size; + +SET @@session.range_alloc_block_size = 0; +SELECT @@session.range_alloc_block_size; +SET @@session.range_alloc_block_size = -2; +SELECT @@session.range_alloc_block_size; +--Error ER_PARSE_ERROR +SET @@session.range_alloc_block_size = 65530.34.; +SET @@session.range_alloc_block_size = 4294967296; +SELECT @@session.range_alloc_block_size; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.range_alloc_block_size = test; +SELECT @@session.range_alloc_block_size; + + +--echo '#------------------FN_DYNVARS_137_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.range_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='range_alloc_block_size'; + +--echo '#------------------FN_DYNVARS_137_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.range_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='range_alloc_block_size'; + + +--echo '#------------------FN_DYNVARS_137_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.range_alloc_block_size = TRUE; +SELECT @@global.range_alloc_block_size; +SET @@global.range_alloc_block_size = FALSE; +SELECT @@global.range_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_137_09----------------------#' +#################################################################################### +# Check if accessing variable with and without GLOBAL point to same variable # +#################################################################################### + +SET @@global.range_alloc_block_size = 10; +SELECT @@range_alloc_block_size = @@global.range_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_137_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@range_alloc_block_size = 100; +SELECT @@range_alloc_block_size = @@local.range_alloc_block_size; +SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_137_11----------------------#' +################################################################################### +# Check if range_alloc_block_size can be accessed with and without @@ sign # +################################################################################### + +SET range_alloc_block_size = 1; +SELECT @@range_alloc_block_size; +--Error ER_UNKNOWN_TABLE +SELECT local.range_alloc_block_size; +--Error ER_UNKNOWN_TABLE +SELECT session.range_alloc_block_size; +--Error ER_BAD_FIELD_ERROR +SELECT range_alloc_block_size = @@session.range_alloc_block_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.range_alloc_block_size = @start_global_value; +SELECT @@global.range_alloc_block_size; +SET @@session.range_alloc_block_size = @start_session_value; +SELECT @@session.range_alloc_block_size; + + +############################################################# +# END OF range_alloc_block_size TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc new file mode 100644 index 00000000000..f9ae3968b31 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc @@ -0,0 +1,171 @@ +############## mysql-test\t\rpl_recovery_rank_basic.test ####################### +# # +# Variable Name: rpl_recovery_rank # +# Scope: GLOBAL & SESSION # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 1 # +# Range: 1 - 65536 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan Maredia # +# # +# Description: Test Cases of Dynamic System Variable rpl_recovery_rank # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +################################################################################ + +--source include/load_sysvars.inc + +################################################################### +# START OF rpl_recovery_rank TESTS # +################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.rpl_recovery_rank; +SELECT @start_global_value; + +--echo '#--------------------FN_DYNVARS_142_01-------------------------#' +################################################################### +# Check the DEFAULT value of rpl_recovery_rank # +################################################################### + +SET @@global.rpl_recovery_rank = 500000; +SET @@global.rpl_recovery_rank = DEFAULT; +SELECT @@global.rpl_recovery_rank; + +--echo '#--------------------FN_DYNVARS_142_02-------------------------#' +################################################################################## +# Change the value of rpl_recovery_rank to a valid value for GLOBAL Scope # +################################################################################## + +SET @@global.rpl_recovery_rank = 0; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = 1024; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = 123456789; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = 2147483648*2; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = 2147483648*1024; +SELECT @@global.rpl_recovery_rank; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = 2147483648*2147483648; +SELECT @@global.rpl_recovery_rank; + + +--echo '#--------------------FN_DYNVARS_142_03-------------------------#' +################################################################################# +# Check if variable can be access with session scope # +################################################################################# + +--Error ER_GLOBAL_VARIABLE +SET @@rpl_recovery_rank = 2; + +--Error ER_GLOBAL_VARIABLE +SET @@session.rpl_recovery_rank = 3; + +--Error ER_GLOBAL_VARIABLE +SET @@local.rpl_recovery_rank = 4; + + + +--echo '#------------------FN_DYNVARS_142_04-----------------------#' +#################################################################### +# Change the value of rpl_recovery_rank to an invalid value # +#################################################################### + +SET @@global.rpl_recovery_rank = -1; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = -2147483648; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = -2147483649; +SELECT @@global.rpl_recovery_rank; +--Error ER_PARSE_ERROR +SET @@global.rpl_recovery_rank = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.rpl_recovery_rank = 2147483649.56; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.rpl_recovery_rank = 1G; + + +--echo '#------------------FN_DYNVARS_142_05-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SET @@global.rpl_recovery_rank = 3000; +SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='rpl_recovery_rank'; + + +--echo '#------------------FN_DYNVARS_142_06-----------------------#' +########################################################################### +# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # +########################################################################### + +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='rpl_recovery_rank'; + + +--echo '#------------------FN_DYNVARS_142_07-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.rpl_recovery_rank = TRUE; +SELECT @@global.rpl_recovery_rank; +SET @@global.rpl_recovery_rank = FALSE; +SELECT @@global.rpl_recovery_rank; + + +--echo '#---------------------FN_DYNVARS_001_08----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + + +SET @@global.rpl_recovery_rank = 512; +SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +################################################################################## +# Check if rpl_recovery_rank can be accessed without @@ sign and scope # +################################################################################## + +--Error ER_GLOBAL_VARIABLE +SET rpl_recovery_rank = 2048; +--Error ER_BAD_FIELD_ERROR +SELECT rpl_recovery_rank; + +SELECT @@rpl_recovery_rank; + +#verifying another another syntax for setting value +SET global rpl_recovery_rank = 64; + +#################################### +# Restore initial value # +#################################### + +SET @@global.rpl_recovery_rank = @start_global_value; +SELECT @@global.rpl_recovery_rank; + +######################################################## +# END OF rpl_recovery_rank TESTS # +######################################################## + diff --git a/mysql-test/suite/sys_vars/inc/server_id_basic.inc b/mysql-test/suite/sys_vars/inc/server_id_basic.inc new file mode 100644 index 00000000000..47afadb5016 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/server_id_basic.inc @@ -0,0 +1,190 @@ +############## mysql-test\t\server_id_basic.test ################ +# # +# Variable Name: server_id # +# Scope: GLOBAL & SESSION # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 1 # +# Range: 1 - 65536 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan Maredia # +# # +# Description: Test Cases of Dynamic System Variable server_id # +# that checks the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +################################################################################ + +--source include/load_sysvars.inc + +################################################################### +# START OF server_id TESTS # +################################################################### + + +############################################################# +# Save initial value # +############################################################# + +let $save_general_log= `SELECT @@global.general_log`; +SET @@global.general_log= 0; +SET @start_global_value = @@global.server_id; +SELECT @start_global_value; + +--echo '#--------------------FN_DYNVARS_144_01-------------------------#' +################################################################### +# Display the DEFAULT value of server_id # +################################################################### + +SET @@global.server_id = 500000; +SET @@global.server_id = DEFAULT; +SELECT @@global.server_id; + +--echo '#--------------------FN_DYNVARS_144_02-------------------------#' +################################################################### +# Check the DEFAULT value of server_id # +################################################################### + +SET @@global.server_id = DEFAULT; +SELECT @@global.server_id = 0; + +--echo '#--------------------FN_DYNVARS_144_03-------------------------#' +################################################################################## +# Change the value of server_id to a valid value for GLOBAL Scope # +################################################################################## + +SET @@global.server_id = 0; +SELECT @@global.server_id; +SET @@global.server_id = 1; +SELECT @@global.server_id; +SET @@global.server_id = 15; +SELECT @@global.server_id; +SET @@global.server_id = 1024; +SELECT @@global.server_id; +SET @@global.server_id = 123456789; +SELECT @@global.server_id; +SET @@global.server_id = 2147483648; +SELECT @@global.server_id; +SET @@global.server_id = 2147483648*2-1; +SELECT @@global.server_id; + + +--echo '#--------------------FN_DYNVARS_144_04-------------------------#' +################################################################################# +# Check if variable can be access with session scope # +################################################################################# + +--Error ER_GLOBAL_VARIABLE +SET @@server_id = 2; + +--Error ER_GLOBAL_VARIABLE +SET @@session.server_id = 3; + +--Error ER_GLOBAL_VARIABLE +SET @@local.server_id = 4; + + + +--echo '#------------------FN_DYNVARS_144_05-----------------------#' +#################################################################### +# Change the value of server_id to an invalid value # +#################################################################### + +SET @@global.server_id = -1; +SELECT @@global.server_id; + +SET @@global.server_id = -2147483648; +SELECT @@global.server_id; + +SET @@global.server_id = 2147483649*2; +SELECT @@global.server_id; + +--Error ER_PARSE_ERROR +SET @@global.server_id = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.server_id = '125'; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.server_id = 7483649.56; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.server_id = 1G; + +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#------------------FN_DYNVARS_144_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SET @@global.server_id = 3000; +SELECT @@global.server_id = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='server_id'; + + +--echo '#------------------FN_DYNVARS_144_07-----------------------#' +########################################################################### +# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # +########################################################################### + +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='server_id'; + + +--echo '#------------------FN_DYNVARS_144_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.server_id = TRUE; +SELECT @@global.server_id; +SET @@global.server_id = FALSE; +SELECT @@global.server_id; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +################################################################################# +# Check if accessing variable with and without GLOBAL point to same variable # +################################################################################# + + +SET @@global.server_id = 512; +SELECT @@server_id = @@global.server_id; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +################################################################################## +# Check if server_id can be accessed without @@ sign and scope # +################################################################################## + +--Error ER_GLOBAL_VARIABLE +SET server_id = 2048; +--Error ER_BAD_FIELD_ERROR +SELECT server_id; + +SELECT @@server_id; + +#verifying another another syntax for setting value +SET global server_id = 99; + +#################################### +# Restore initial value # +#################################### + +SET @@global.server_id = @start_global_value; +SELECT @@global.server_id; + +eval SET @@global.general_log= $save_general_log; +######################################################## +# END OF server_id TESTS # +######################################################## + diff --git a/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc new file mode 100644 index 00000000000..6bbed3b1982 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/slave_transaction_retries_basic.inc @@ -0,0 +1,188 @@ +############# mysql-test\t\slave_transaction_retries_basic.test ############### +# # +# Variable Name: slave_transaction_retries # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 10 # +# Range: # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +# Description: Test Cases of Dynamic System Variable slave_transaction_retries# +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +################################################################### +# START OF slave_transaction_retries TESTS # +################################################################### + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.slave_transaction_retries; +SELECT @start_global_value; + +--echo '#--------------------FN_DYNVARS_149_01-------------------------#' +################################################################### +# Display the DEFAULT value of slave_transaction_retries # +################################################################### + +SET @@global.slave_transaction_retries = 50; +SET @@global.slave_transaction_retries = DEFAULT; +SELECT @@global.slave_transaction_retries; + +--echo '#--------------------FN_DYNVARS_149_02-------------------------#' +################################################################### +# Check the DEFAULT value of slave_transaction_retries # +################################################################### + +SET @@global.slave_transaction_retries = DEFAULT; +SELECT @@global.slave_transaction_retries = 10; + +--echo '#--------------------FN_DYNVARS_149_03-------------------------#' +################################################################################ +# Change the value of slave_transaction_retries to a valid value for +# GLOBAL Scope +################################################################################ + +SET @@global.slave_transaction_retries = 0; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = 1; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = 15; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = 1024; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = 2147483648; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = 2147483648*2-1; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = 2147483649*2; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = 4294967295; +SELECT @@global.slave_transaction_retries; + +--echo '#--------------------FN_DYNVARS_149_04-------------------------#' +############################################################################### +# Check if variable can be access with session scope # +############################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@slave_transaction_retries = 2; + +--Error ER_GLOBAL_VARIABLE +SET @@session.slave_transaction_retries = 3; + +--Error ER_GLOBAL_VARIABLE +SET @@local.slave_transaction_retries = 4; + + + +--echo '#------------------FN_DYNVARS_149_05-----------------------#' +#################################################################### +# Change the value of slave_transaction_retries to an invalid value# +#################################################################### + +SET @@global.slave_transaction_retries = -1; +SELECT @@global.slave_transaction_retries; + +SET @@global.slave_transaction_retries = 2147483649*2147483649; +SELECT @@global.slave_transaction_retries; + +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + +--Error ER_PARSE_ERROR +SET @@global.slave_transaction_retries = 65530.34.; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_transaction_retries = '100'; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_transaction_retries = 7483649.56; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_transaction_retries = ON; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.slave_transaction_retries = OFF; + +--echo '#------------------FN_DYNVARS_149_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SET @@global.slave_transaction_retries = 3000; +SELECT @@global.slave_transaction_retries = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_transaction_retries'; + + +--echo '#------------------FN_DYNVARS_149_07-----------------------#' +########################################################################### +# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES # +########################################################################### + +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_transaction_retries'; + + +--echo '#------------------FN_DYNVARS_149_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.slave_transaction_retries = TRUE; +SELECT @@global.slave_transaction_retries; +SET @@global.slave_transaction_retries = FALSE; +SELECT @@global.slave_transaction_retries; + + +--echo '#---------------------FN_DYNVARS_149_09----------------------#' +############################################################################### +# Check if accessing variable with and without GLOBAL point to same variable # +############################################################################### + + +SET @@global.slave_transaction_retries = 60*60; +SELECT @@slave_transaction_retries = @@global.slave_transaction_retries; + + +--echo '#---------------------FN_DYNVARS_149_10----------------------#' +############################################################################### +# Check if slave_transaction_retries can be accessed without @@ sign +# and scope +############################################################################### + +--Error ER_GLOBAL_VARIABLE +SET slave_transaction_retries = 2048; +--Error ER_BAD_FIELD_ERROR +SELECT slave_transaction_retries; + +SELECT @@slave_transaction_retries; + +#verifying another another syntax for setting value +SET global slave_transaction_retries = 99; + +#################################### +# Restore initial value # +#################################### + +SET @@global.slave_transaction_retries = @start_global_value; +SELECT @@global.slave_transaction_retries; + +######################################################## +# END OF slave_transaction_retries TESTS # +######################################################## + diff --git a/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc new file mode 100644 index 00000000000..4dbae7c8847 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/sort_buffer_size_basic.inc @@ -0,0 +1,213 @@ +############## mysql-test\t\sort_buffer_size_basic.test ####################### +# # +# Variable Name: sort_buffer_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 2097144 # +# Range:max value:4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable sort_buffer_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## + + +###################################################################### +# START OF sort_buffer_size TESTS # +###################################################################### + + +############################################################# +# Save initial value # +############################################################# + +# due to difference when running on Windows (bug filed) +--source include/not_windows.inc + +SET @start_global_value = @@global.sort_buffer_size; +SELECT @start_global_value; +SET @start_session_value = @@session.sort_buffer_size; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_151_01-------------------------#' +###################################################################### +# Display the DEFAULT value of sort_buffer_size # +###################################################################### + +SET @@global.sort_buffer_size = 1000; +SET @@global.sort_buffer_size = DEFAULT; +SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116; + +SET @@session.sort_buffer_size = 2000; +SET @@session.sort_buffer_size = DEFAULT; +SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116; + + +--echo '#--------------------FN_DYNVARS_151_02-------------------------#' +###################################################################### +# Check the DEFAULT value of sort_buffer_size # +###################################################################### + +SET @@global.sort_buffer_size = DEFAULT; +SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116; + +SET @@session.sort_buffer_size = DEFAULT; +SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116; + + +--echo '#--------------------FN_DYNVARS_151_03-------------------------#' +################################################################################ +# Change the value of sort_buffer_size to a valid value for GLOBAL Scope # +################################################################################ + +SET @@global.sort_buffer_size = 32776; +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +SET @@global.sort_buffer_size = 32777; +SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804; +SET @@global.sort_buffer_size = 4294967295; +SELECT @@global.sort_buffer_size; +SET @@global.sort_buffer_size = 4294967294; +SELECT @@global.sort_buffer_size; +--echo 'Bug# 34877: Invalid Values are showing in variable on assigning valid values.'; + +--echo '#--------------------FN_DYNVARS_151_04-------------------------#' +################################################################################### +# Change the value of sort_buffer_size to a valid value for SESSION Scope # +################################################################################### + +SET @@session.sort_buffer_size = 32776; +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +SET @@session.sort_buffer_size = 32777; +SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804; +SET @@session.sort_buffer_size = 4294967295; +SELECT @@session.sort_buffer_size; +SET @@session.sort_buffer_size = 4294967294; +SELECT @@session.sort_buffer_size; + + +--echo '#------------------FN_DYNVARS_151_05-----------------------#' +################################################################## +# Change the value of sort_buffer_size to an invalid value # +################################################################## + +SET @@global.sort_buffer_size = 32775; +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +SET @@global.sort_buffer_size = -1024; +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +SET @@global.sort_buffer_size = 4294967296; +SELECT @@global.sort_buffer_size; +--Error ER_PARSE_ERROR +SET @@global.sort_buffer_size = 65530.34.; +SELECT @@global.sort_buffer_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.sort_buffer_size = test; +SELECT @@global.sort_buffer_size; + +SET @@session.sort_buffer_size = 32775; +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +SET @@session.sort_buffer_size = -2; +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +--Error ER_PARSE_ERROR +SET @@session.sort_buffer_size = 65530.34.; +SET @@session.sort_buffer_size = 4294967296; +SELECT @@session.sort_buffer_size; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.sort_buffer_size = test; +SELECT @@session.sort_buffer_size; + + +--echo '#------------------FN_DYNVARS_151_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; + +--echo '#------------------FN_DYNVARS_151_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; + + +--echo '#------------------FN_DYNVARS_151_08-----------------------#' +#################################################################### +# Check if TRUE and FALSE values can be used on variable # +#################################################################### + +SET @@global.sort_buffer_size = TRUE; +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +SET @@global.sort_buffer_size = FALSE; +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +echo 'Bug: Errors should be displayed on assigning TRUE/FALSE to variable'; + + +--echo '#---------------------FN_DYNVARS_151_09----------------------#' +#################################################################################### +# Check if accessing variable with and without GLOBAL point to same variable # +#################################################################################### + +SET @@global.sort_buffer_size = 9000; +SELECT @@sort_buffer_size = @@global.sort_buffer_size; + + +--echo '#---------------------FN_DYNVARS_151_10----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@sort_buffer_size = 9000; +SELECT @@sort_buffer_size = @@local.sort_buffer_size; +SELECT @@local.sort_buffer_size = @@session.sort_buffer_size; + + +--echo '#---------------------FN_DYNVARS_151_11----------------------#' +################################################################################### +# Check if sort_buffer_size can be accessed with and without @@ sign # +################################################################################### + +SET sort_buffer_size = 9100; +SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804; +SELECT @@sort_buffer_size; +--Error ER_UNKNOWN_TABLE +SELECT local.sort_buffer_size; +--Error ER_UNKNOWN_TABLE +SELECT session.sort_buffer_size; +--Error ER_BAD_FIELD_ERROR +SELECT sort_buffer_size = @@session.sort_buffer_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.sort_buffer_size = @start_global_value; +SELECT @@global.sort_buffer_size; +SET @@session.sort_buffer_size = @start_session_value; +SELECT @@session.sort_buffer_size; + + +############################################################# +# END OF sort_buffer_size TESTS # +############################################################# diff --git a/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc b/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc new file mode 100644 index 00000000000..b66509bbb5e --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/sync_binlog_basic.inc @@ -0,0 +1,156 @@ +#################### mysql-test\t\sync_binlog_basic.test ###################### +# # +# Variable Name: sync_binlog # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 0 # +# Range: 0 - 4294967295 # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Salman Rawala # +# # +# Description: Test Cases of Dynamic System Variable sync_binlog # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +################################################################## +# START OF sync_binlog TESTS # +################################################################## + + +################################################################## +# Saving initial value of sync_binlog in a temporary variable # +################################################################## + +SET @start_value = @@global.sync_binlog; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_168_01------------------------#' +################################################################## +# Display the DEFAULT value of sync_binlog # +################################################################## + +SET @@global.sync_binlog = 99; +SET @@global.sync_binlog = DEFAULT; +SELECT @@global.sync_binlog; + + +--echo '#---------------------FN_DYNVARS_168_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.sync_binlog = @start_value; +SELECT @@global.sync_binlog = 0; + + +--echo '#--------------------FN_DYNVARS_168_03------------------------#' +################################################################### +# Change the value of sync_binlog to a valid value # +################################################################### + +SET @@global.sync_binlog = 0; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = 1; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = 4294967295; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = 4294967294; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = 65536; +SELECT @@global.sync_binlog; + + +--echo '#--------------------FN_DYNVARS_168_04-------------------------#' +###################################################################### +# Change the value of sync_binlog to invalid value # +###################################################################### + +SET @@global.sync_binlog = -1; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = 4294967296; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = 10240022115; +SELECT @@global.sync_binlog; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.sync_binlog = 10000.01; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = -1024; +SELECT @@global.sync_binlog; +SET @@global.sync_binlog = 42949672950; +SELECT @@global.sync_binlog; +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.sync_binlog = ON; +SELECT @@global.sync_binlog; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.sync_binlog = 'test'; +SELECT @@global.sync_binlog; + + +--echo '#-------------------FN_DYNVARS_168_05----------------------------#' +########################################################################### +# Test if accessing session sync_binlog gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.sync_binlog = 0; +SELECT @@sync_binlog; + + +--echo '#----------------------FN_DYNVARS_168_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.sync_binlog = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='sync_binlog'; + + + +--echo '#---------------------FN_DYNVARS_168_07----------------------#' +########################################################################## +# Check if sync_binlog can be accessed with and without @@ sign # +########################################################################## + +--Error ER_GLOBAL_VARIABLE +SET sync_binlog = 1; +SELECT @@sync_binlog; +--Error ER_PARSE_ERROR +SET local.sync_binlog = 1; +--Error ER_UNKNOWN_TABLE +SELECT local.sync_binlog; +--Error ER_PARSE_ERROR +SET global.sync_binlog = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.sync_binlog; +--Error ER_BAD_FIELD_ERROR +SELECT sync_binlog = @@session.sync_binlog; + + +############################## +# Restore initial value # +############################## + +SET @@global.sync_binlog = @start_value; +SELECT @@global.sync_binlog; + + +######################################################################## +# END OF sync_binlog TESTS # +######################################################################## diff --git a/mysql-test/suite/sys_vars/inc/timestamp_basic.inc b/mysql-test/suite/sys_vars/inc/timestamp_basic.inc new file mode 100644 index 00000000000..d7ad620ec26 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/timestamp_basic.inc @@ -0,0 +1,162 @@ +################## mysql-test\t\timestamp_basic.test ########################## +# # +# Variable Name: timestamp # +# Scope: SESSION # +# Access Type: Dynamic # +# Data Type: string # +# Default Value: # +# Range: # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Rizwan # +# # +# Description: Test Cases of Dynamic System Variable timestamp # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +####################################################################### +# START OF timestamp TESTS # +####################################################################### + + +####################################################################### +# Saving initial value of timestamp in a temporary variable # +####################################################################### + +SET @session_start_value = @@session.timestamp; + +--echo '#--------------------FN_DYNVARS_001_01------------------------#' +######################################################################## +# Display the DEFAULT value of timestamp # +######################################################################## + + +SET @@timestamp = DEFAULT; +#SELECT @@timestamp; + +--echo 'timestamp does not have any DEFAULT value' + +--echo '#---------------------FN_DYNVARS_001_02-------------------------#' +############################################################## +# see if accessable using global scope # +############################################################## + +--Error ER_LOCAL_VARIABLE +SET @@global.timestamp = "1000"; + + +--echo '#--------------------FN_DYNVARS_001_03------------------------#' +######################################################################## +# Change the value of timestamp to a valid value # +######################################################################## + +SET @@timestamp = 0; +#SELECT @@timestamp; + +--echo 'Setting 0 resets timestamp to session default timestamp' + +SET @@timestamp = 123456789123456; +SELECT @@timestamp; +SET @@timestamp = 60*60*60*60*365; +SELECT @@timestamp; +SET @@timestamp = -1000000000; +SELECT @@timestamp; + +SET @temp_ts = @@timestamp - @@timestamp; +SELECT @temp_ts; + +--echo '#--------------------FN_DYNVARS_001_04-------------------------#' +########################################################################### +# Change the value of timestamp to invalid value # +########################################################################### + +# for session scope +--Error ER_WRONG_TYPE_FOR_VAR +SET @@timestamp = "100"; +--echo 'Bug# 34836: Documentation says its a string variable but infact its numeric' + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@timestamp = " "; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@timestamp = 1.1; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@timestamp = 9999999999999999999999; + + + +--echo '#----------------------FN_DYNVARS_001_06------------------------#' +######################################################################### +# Check if the value in SESSION Table matches value in variable # +######################################################################### + +SELECT @@timestamp = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='timestamp'; + +--echo '#---------------------FN_DYNVARS_001_08-------------------------#' +############################################################################# +# Check if ON, OFF, TRUE and FALSE values can be used on variable # +############################################################################# +--Error ER_WRONG_TYPE_FOR_VAR +SET @@timestamp = OFF; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@timestamp = ON; + +SET @@timestamp = TRUE; +SELECT @@timestamp; + +SET @@timestamp = FALSE; +#SELECT @@timestamp; + + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +############################################################################# +# Check if accessing variable with SESSION,LOCAL and without SCOPE points +# to same session variable +############################################################################# + +SET @@timestamp = 123456; +SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; +SET @@timestamp = 654321; +SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +##################################################################### +# Check if timestamp can be accessed with and without @@ sign # +##################################################################### + +SET timestamp = 1; +SELECT @@timestamp; +--Error ER_UNKNOWN_TABLE +SELECT local.timestamp; +--Error ER_UNKNOWN_TABLE +SELECT session.timestamp; +--Error ER_BAD_FIELD_ERROR +SELECT timestamp = @@session.timestamp; + +############################## +# Restore initial value # +############################## + +SET @@timestamp = @session_start_value; + +####################################################################### +# END OF timestamp TESTS # +####################################################################### + diff --git a/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc b/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc new file mode 100644 index 00000000000..7f69bcd1f8c --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/tmp_table_size_basic.inc @@ -0,0 +1,233 @@ +############## mysql-test\t\tmp_table_size_basic.test ######################### +# # +# Variable Name: tmp_table_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 33554432 # +# Range: 1024-4294967295 # +# # +# # +# Creation Date: 2008-02-13 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable tmp_table_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_tmp_table_size # +# # +############################################################################### + +--source include/load_sysvars.inc + +############################################################## +# START OF tmp_table_size TESTS # +############################################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.tmp_table_size; +SELECT @start_global_value; +SET @start_session_value = @@session.tmp_table_size; +SELECT @start_session_value; + +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +############################################################## +# Display the DEFAULT value of tmp_table_size # +############################################################## + +SET @@global.tmp_table_size = 100; +SET @@global.tmp_table_size = DEFAULT; +SELECT @@global.tmp_table_size; + +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; +SET @@session.tmp_table_size = 200; +SET @@session.tmp_table_size = DEFAULT; +SELECT @@session.tmp_table_size; +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of tmp_table_size # +######################################################################## + +SET @@global.tmp_table_size = DEFAULT; +SELECT @@global.tmp_table_size = 33554432; + +SET @@session.tmp_table_size = DEFAULT; +SELECT @@session.tmp_table_size = 33554432; + +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +######################################################################## +# Change the value of tmp_table_size to a valid value for GLOBAL Scope # +######################################################################## + +SET @@global.tmp_table_size = 1024; +SELECT @@global.tmp_table_size; +SET @@global.tmp_table_size = 60020; +SELECT @@global.tmp_table_size; +SET @@global.tmp_table_size = 4294967295; +SELECT @@global.tmp_table_size; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +######################################################################### +# Change the value of tmp_table_size to a valid value for SESSION Scope # +######################################################################### + +SET @@session.tmp_table_size = 1024; +SELECT @@session.tmp_table_size; + +SET @@session.tmp_table_size =4294967295; +SELECT @@session.tmp_table_size; +SET @@session.tmp_table_size = 65535; +SELECT @@session.tmp_table_size; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +########################################################## +# Change the value of tmp_table_size to an invalid value # +########################################################## + +SET @@global.tmp_table_size = 0; +SELECT @@global.tmp_table_size; + +SET @@global.tmp_table_size = -1024; +SELECT @@global.tmp_table_size; + +SET @@global.tmp_table_size = 1000; +SELECT @@global.tmp_table_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_table_size = ON; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_table_size = OFF; + + +SET @@global.tmp_table_size = True; +SELECT @@global.tmp_table_size; + +SET @@global.tmp_table_size = False; +SELECT @@global.tmp_table_size; +--echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value'; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_table_size = 65530.34; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.tmp_table_size ="Test"; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_table_size = ON; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_table_size = OFF; + +SET @@session.tmp_table_size = True; +SELECT @@session.tmp_table_size; + +SET @@session.tmp_table_size = False; +SELECT @@session.tmp_table_size; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.tmp_table_size = "Test"; + +SET @@session.tmp_table_size = 12345678901; +SELECT @@session.tmp_table_size; + + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.tmp_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='tmp_table_size'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.tmp_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='tmp_table_size'; + + + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +######################################################################## +# Check if global and session variables are independent of each other # +######################################################################## + +SET @@global.tmp_table_size = 1024; +SET @@tmp_table_size = 4294967295; +SELECT @@tmp_table_size = @@global.tmp_table_size; + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +################################################################## +# Check if accessing variable with SESSION,LOCAL and without # +# SCOPE points to same session variable # +################################################################## + +SET @@tmp_table_size = 100; +SELECT @@tmp_table_size = @@local.tmp_table_size; +SELECT @@local.tmp_table_size = @@session.tmp_table_size; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +######################################################################### +# Check if tmp_table_size can be accessed with and without @@ sign # +######################################################################### + +SET tmp_table_size = 1027; +SELECT @@tmp_table_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.tmp_table_size; + +--Error ER_UNKNOWN_TABLE +SELECT global.tmp_table_size; + +--Error ER_BAD_FIELD_ERROR +SELECT tmp_table_size = @@session.tmp_table_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.tmp_table_size = @start_global_value; +SELECT @@global.tmp_table_size; +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.tmp_table_size; + + +################################################### +# END OF tmp_table_size TESTS # +################################################### + diff --git a/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc new file mode 100644 index 00000000000..c14383b86c6 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/transaction_alloc_block_size_basic.inc @@ -0,0 +1,240 @@ +############## mysql-test\t\transaction_alloc_block_size_basic.test ########### +# # +# Variable Name: transaction_alloc_block_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 8192 # +# Range: 1024-4294967295 # +# # +# # +# Creation Date: 2008-02-14 # +# Author: Salman # +# # +# Description: Test Cases of Dynamic System Variable # +# transaction_alloc_block_size # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF transaction_alloc_block_size TESTS # +######################################################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.transaction_alloc_block_size; +SELECT @start_global_value; +SET @start_session_value = @@session.transaction_alloc_block_size; +SELECT @start_session_value; + + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +######################################################################## +# Display the DEFAULT value of transaction_alloc_block_size # +######################################################################## + +SET @@global.transaction_alloc_block_size = 100; +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size; + + +SET @@session.transaction_alloc_block_size = 200; +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size; + + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of transaction_alloc_block_size # +######################################################################## + +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size = 8192; + +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size = 8192; + + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +################################################################## +# Change the value of variable to a valid value for GLOBAL Scope # +################################################################## + +SET @@global.transaction_alloc_block_size = 1024; +SELECT @@global.transaction_alloc_block_size; + +SET @@global.transaction_alloc_block_size = 60020; +SELECT @@global.transaction_alloc_block_size; + +SET @@global.transaction_alloc_block_size = 4294967295; +SELECT @@global.transaction_alloc_block_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +################################################################### +# Change the value of variable to a valid value for SESSION Scope # +################################################################### + +SET @@session.transaction_alloc_block_size = 1024; +SELECT @@session.transaction_alloc_block_size; + +SET @@session.transaction_alloc_block_size =4294967295; +SELECT @@session.transaction_alloc_block_size; + +SET @@session.transaction_alloc_block_size = 65535; +SELECT @@session.transaction_alloc_block_size; +--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +######################################################################## +# Change the value of transaction_alloc_block_size to an invalid value # +######################################################################## + +SET @@global.transaction_alloc_block_size = 0; +SELECT @@global.transaction_alloc_block_size; + +SET @@global.transaction_alloc_block_size = -1024; +SELECT @@global.transaction_alloc_block_size; + + +SET @@global.transaction_alloc_block_size = 123456789201; +SELECT @@global.transaction_alloc_block_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size = ON; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size = OFF; + + +SET @@global.transaction_alloc_block_size = True; +SELECT @@global.transaction_alloc_block_size; + +SET @@global.transaction_alloc_block_size = False; +SELECT @@global.transaction_alloc_block_size; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size = 65530.34; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_alloc_block_size ="Test"; + +SET @@global.transaction_alloc_block_size = 1000; +SELECT @@global.transaction_alloc_block_size; + +SET @@session.transaction_alloc_block_size = 12345678901; +SELECT @@session.transaction_alloc_block_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = ON; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = OFF; + +SET @@session.transaction_alloc_block_size = True; +SELECT @@session.transaction_alloc_block_size; + +SET @@session.transaction_alloc_block_size = False; +SELECT @@session.transaction_alloc_block_size; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = "Test"; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_alloc_block_size = 'test'; + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; + + +--echo '#---------------------FN_DYNVARS_001_08----------------------#' +########################################################################### +# Check if global and session variable are independent of each other # +########################################################################### + +SET @@transaction_alloc_block_size = 1024; +SET @@global.transaction_alloc_block_size = 4294967295; +SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +######################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE # +# points to same session variable # +######################################################################## + +SET @@transaction_alloc_block_size = 100; +SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; +SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +################################################################ +# Check if variable can be accessed with and without @@ sign # +################################################################ + +SET transaction_alloc_block_size = 1027; +SELECT @@transaction_alloc_block_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.transaction_alloc_block_size; + +--Error ER_UNKNOWN_TABLE +SELECT session.transaction_alloc_block_size; + +--Error ER_BAD_FIELD_ERROR +SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.transaction_alloc_block_size = @start_global_value; +SELECT @@global.transaction_alloc_block_size; +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.transaction_alloc_block_size; + + +############################################################# +# END OF transaction_alloc_block_size TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc new file mode 100644 index 00000000000..1ca302a19e0 --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/transaction_prealloc_size_basic.inc @@ -0,0 +1,229 @@ +############## mysql-test\t\transaction_prealloc_size_basic.test ############## +# # +# Variable Name: transaction_prealloc_size # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: 4096 # +# Range: # +# # +# # +# Creation Date: 2008-02-14 # +# Author: Sharique Abdullah # +# # +# Description: Test Cases of Dynamic System Variable transaction_prealloc_size# +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_transaction_prealloc_size # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF transaction_prealloc_size TESTS # +######################################################################## + + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.transaction_prealloc_size; +SELECT @start_global_value; +SET @start_session_value = @@session.transaction_prealloc_size; +SELECT @start_session_value; + +--echo 'Bug# 34876: This variable has invalid default value as compared to documentation'; + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +######################################################################## +# Display the DEFAULT value of transaction_prealloc_size # +######################################################################## + +SET @@global.transaction_prealloc_size = 100; +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size; + + +SET @@session.transaction_prealloc_size = 200; +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size; + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +######################################################################## +# Check the DEFAULT value of transaction_prealloc_size # +######################################################################## + +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size = 4096; + +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size = 4096; + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +################################################################## +# Change the value of variable to a valid value for GLOBAL Scope # +################################################################## + +SET @@global.transaction_prealloc_size = 1024; +SELECT @@global.transaction_prealloc_size; + +SET @@global.transaction_prealloc_size = 60020; +SELECT @@global.transaction_prealloc_size; + +SET @@global.transaction_prealloc_size = 4294966272; +SELECT @@global.transaction_prealloc_size; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +################################################################### +# Change the value of variable to a valid value for SESSION Scope # +################################################################### + +SET @@session.transaction_prealloc_size = 1024; +SELECT @@session.transaction_prealloc_size; + +SET @@session.transaction_prealloc_size =4294966272; +SELECT @@session.transaction_prealloc_size; +SET @@session.transaction_prealloc_size = 65535; +SELECT @@session.transaction_prealloc_size; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +##################################################################### +# Change the value of transaction_prealloc_size to an invalid value # +##################################################################### + +SET @@global.transaction_prealloc_size = 0; +SELECT @@global.transaction_prealloc_size; + +SET @@global.transaction_prealloc_size = -1024; +SELECT @@global.transaction_prealloc_size; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size = ON; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size = OFF; + + +SET @@global.transaction_prealloc_size = True; +SELECT @@global.transaction_prealloc_size; + +SET @@global.transaction_prealloc_size = False; +SELECT @@global.transaction_prealloc_size; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size = 65530.34; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@global.transaction_prealloc_size ="Test"; + +SET @@global.transaction_prealloc_size = 1000; +SELECT @@global.transaction_prealloc_size; + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_prealloc_size = ON; + + +-- Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_prealloc_size = OFF; + +SET @@session.transaction_prealloc_size = True; +SELECT @@session.transaction_prealloc_size; + +SET @@session.transaction_prealloc_size = False; +SELECT @@session.transaction_prealloc_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.transaction_prealloc_size = "Test"; + +SET @@session.transaction_prealloc_size = 123456789031; +SELECT @@session.transaction_prealloc_size; + + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + + +SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; + + + + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +########################################################################### +# Check if global and session variable are independent of each other # +########################################################################### + +SET @@global.transaction_prealloc_size = 1024; +SET @@global.transaction_prealloc_size = 10; + +SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; + + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +######################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE # +# points to same session variable # +######################################################################## + +SET @@transaction_prealloc_size = 100; +SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; +SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; + + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +############################################################################### +# Check if transaction_prealloc_size can be accessed with and without @@ sign # +############################################################################### + +SET transaction_prealloc_size = 1027; +SELECT @@transaction_prealloc_size; + +--Error ER_UNKNOWN_TABLE +SELECT local.transaction_prealloc_size; + +--Error ER_UNKNOWN_TABLE +SELECT session.transaction_prealloc_size; + +--Error ER_BAD_FIELD_ERROR +SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; + +#################################### +# Restore initial value # +#################################### + +SET @@global.transaction_prealloc_size = @start_global_value; +SELECT @@global.transaction_prealloc_size; +SET @@session.transaction_prealloc_size = @start_session_value; +SELECT @@session.transaction_prealloc_size; + + +############################################################# +# END OF transaction_prealloc_size TESTS # +############################################################# + diff --git a/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc b/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc new file mode 100644 index 00000000000..b6e19e235ba --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/wait_timeout_basic.inc @@ -0,0 +1,218 @@ +############## mysql-test\t\wait_timeout_basic.test ########################### +# # +# Variable Name: wait_timeout # +# Scope: GLOBAL | SESSION # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value: # +# Range: # +# # +# # +# Creation Date: 2008-02-07 # +# Author: Sharique Abdullah # +# # +# Description: Test Cases of Dynamic System Variable wait_timeout # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # +# server-system-variables.html#option_mysqld_wait_timeouts # +# # +############################################################################### +# Due to differnces between linux and windows in the results + +--source include/not_windows.inc +--source include/load_sysvars.inc + +############################################################ +# START OF wait_timeout TESTS # +############################################################ + +############################################################# +# Save initial value # +############################################################# + +SET @start_global_value = @@global.wait_timeout; +SET @start_session_value = @@session.wait_timeout; + +--echo '#--------------------FN_DYNVARS_005_01-------------------------#' +############################################################ +# Display the DEFAULT value of wait_timeout # +############################################################ + +SET @@global.wait_timeout = 100; +SET @@global.wait_timeout = DEFAULT; +SELECT @@global.wait_timeout; + +SET @@session.wait_timeout = 200; +SET @@session.wait_timeout = DEFAULT; +SELECT @@session.wait_timeout; + + +--echo '#--------------------FN_DYNVARS_005_02-------------------------#' +############################################################ +# Check the DEFAULT value of wait_timeout # +############################################################ + +SET @@global.wait_timeout = DEFAULT; +SELECT @@global.wait_timeout = @default_wait_timeout; + +SET @@session.wait_timeout = DEFAULT; +SELECT @@session.wait_timeout = @default_wait_timeout; + + + +--echo '#--------------------FN_DYNVARS_005_03-------------------------#' +###################################################################### +# Change the value of wait_timeout to a valid value for GLOBAL Scope # +###################################################################### + +#SET @@global.wait_timeout= @min_wait_timeout; +SET @@global.wait_timeout= 1; +SELECT @@global.wait_timeout; + +SET @@global.wait_timeout = 60020; +SELECT @@global.wait_timeout; + +#SET @@global.wait_timeout = @max_wait_timeout; +SET @@global.wait_timeout = 31536000; +SELECT @@global.wait_timeout = @max_wait_timeout; + + +--echo '#--------------------FN_DYNVARS_005_04-------------------------#' +####################################################################### +# Change the value of wait_timeout to a valid value for SESSION Scope # +####################################################################### +#SET @@session.wait_timeout = @min_wait_timeout; +#SELECT @@session.wait_timeout; + +SET @@session.wait_timeout =6000; +SELECT @@session.wait_timeout; + +#SET @@session.wait_timeout = @max_wait_timeout; +#SELECT @@session.wait_timeout = @max_wait_timeout; + + +--echo '#------------------FN_DYNVARS_005_05-----------------------#' +######################################################## +# Change the value of wait_timeout to an invalid value # +######################################################## + +SET @@global.wait_timeout = 0; +SET @@global.wait_timeout = -1024; + +--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.wait_timeout = ON; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.wait_timeout = OFF; + +SET @@global.wait_timeout = True; +SELECT @@global.wait_timeout; + +SET @@global.wait_timeout = False; +SELECT @@global.wait_timeout; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.wait_timeout = 65530.34; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.wait_timeout ="Test"; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.wait_timeout = ON; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.wait_timeout = OFF; + +SET @@session.wait_timeout = True; +SELECT @@session.wait_timeout; + +SET @@session.wait_timeout = False; +SELECT @@session.wait_timeout; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.wait_timeout = "Test"; + + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@session.wait_timeout = 'test'; + +SET @@session.wait_timeout = 123456789031; +SELECT @@session.wait_timeout = @max_wait_timeout; + + +--echo '#------------------FN_DYNVARS_005_06-----------------------#' +#################################################################### +# Check if the value in GLOBAL Table matches value in variable # +#################################################################### + +SELECT @@global.wait_timeout = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='wait_timeout'; + +--echo '#------------------FN_DYNVARS_005_07-----------------------#' +#################################################################### +# Check if the value in SESSION Table matches value in variable # +#################################################################### + +SELECT @@session.wait_timeout = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='wait_timeout'; + +--echo '#---------------------FN_DYNVARS_001_09----------------------#' +########################################################################### +# Check if global and session variable are independent of each other # +########################################################################### + +SET @@global.wait_timeout = 30000; +SET @@global.wait_timeout = 40000; +SELECT @@wait_timeout = @@global.wait_timeout; + +--echo '#---------------------FN_DYNVARS_001_10----------------------#' +######################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE # +# points to same session variable # +######################################################################## + +SET @@wait_timeout = 100; +SELECT @@wait_timeout = @@local.wait_timeout; +SELECT @@local.wait_timeout = @@session.wait_timeout; + +--echo '#---------------------FN_DYNVARS_001_11----------------------#' +####################################################################### +# Check if wait_timeout can be accessed with and without @@ sign # +####################################################################### + +SET wait_timeout = 1027; +SELECT @@wait_timeout; + + +--Error ER_UNKNOWN_TABLE +SELECT local.wait_timeout; + +--Error ER_UNKNOWN_TABLE +SELECT session.wait_timeout; + +--Error ER_BAD_FIELD_ERROR +SELECT wait_timeout = @@session.wait_timeout; + + +#################################### +# Restore initial value # +#################################### + +SET @@global.wait_timeout = @start_global_value; +SET @@session.wait_timeout = @start_session_value; + +################################################# +# END OF wait_timeout TESTS # +################################################# diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result new file mode 100644 index 00000000000..6267c5493da --- /dev/null +++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_32.result @@ -0,0 +1,102 @@ +SET @start_value = @@global.binlog_cache_size; +SELECT @start_value; +@start_value +32768 +'#--------------------FN_DYNVARS_006_01------------------------#' +SET @@global.binlog_cache_size = 100; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '100' +SET @@global.binlog_cache_size = DEFAULT; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +32768 +'#---------------------FN_DYNVARS_006_02-------------------------#' +SET @@global.binlog_cache_size = @start_value; +SELECT @@global.binlog_cache_size = 32768; +@@global.binlog_cache_size = 32768 +1 +'#--------------------FN_DYNVARS_006_03------------------------#' +SET @@global.binlog_cache_size = 4096; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = 4294967295; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4294963200 +SET @@global.binlog_cache_size = 10000; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +8192 +SET @@global.binlog_cache_size = 21221204; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +21217280 +'Bug: Invalid values are coming in variable on assigning valid values' +'#--------------------FN_DYNVARS_006_04-------------------------#' +SET @@global.binlog_cache_size = 1024; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '1024' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' +SET @@global.binlog_cache_size = -1024; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '0' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '42949672950' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4294963200 +'Bug: Errors are not coming on assigning invalid values to variable' +SET @@global.binlog_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' +SET @@global.binlog_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' +'#-------------------FN_DYNVARS_006_05----------------------------#' +SET @@session.binlog_cache_size = 0; +ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +'#----------------------FN_DYNVARS_006_06------------------------#' +SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size'; +@@global.binlog_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_006_07----------------------#' +SET @@global.binlog_cache_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '1' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '0' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +'Bug: Errors are not coming on assigning TRUE/FALSE to variable' +'#---------------------FN_DYNVARS_006_08----------------------#' +SET @@global.binlog_cache_size = 1; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '1' +SELECT @@binlog_cache_size = @@global.binlog_cache_size; +@@binlog_cache_size = @@global.binlog_cache_size +1 +'#---------------------FN_DYNVARS_006_09----------------------#' +SET binlog_cache_size = 1; +ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SET global.binlog_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1 +SELECT global.binlog_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT binlog_cache_size = @@session.binlog_cache_size; +ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list' +SET @@global.binlog_cache_size = @start_value; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +32768 diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result new file mode 100644 index 00000000000..45ed43589a3 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_basic_64.result @@ -0,0 +1,100 @@ +SET @start_value = @@global.binlog_cache_size; +SELECT @start_value; +@start_value +32768 +'#--------------------FN_DYNVARS_006_01------------------------#' +SET @@global.binlog_cache_size = 100; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '100' +SET @@global.binlog_cache_size = DEFAULT; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +32768 +'#---------------------FN_DYNVARS_006_02-------------------------#' +SET @@global.binlog_cache_size = @start_value; +SELECT @@global.binlog_cache_size = 32768; +@@global.binlog_cache_size = 32768 +1 +'#--------------------FN_DYNVARS_006_03------------------------#' +SET @@global.binlog_cache_size = 4096; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = 4294967295; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4294963200 +SET @@global.binlog_cache_size = 10000; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +8192 +SET @@global.binlog_cache_size = 21221204; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +21217280 +'Bug: Invalid values are coming in variable on assigning valid values' +'#--------------------FN_DYNVARS_006_04-------------------------#' +SET @@global.binlog_cache_size = 1024; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '1024' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' +SET @@global.binlog_cache_size = -1024; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '0' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = 42949672950; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +42949668864 +'Bug: Errors are not coming on assigning invalid values to variable' +SET @@global.binlog_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' +SET @@global.binlog_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'binlog_cache_size' +'#-------------------FN_DYNVARS_006_05----------------------------#' +SET @@session.binlog_cache_size = 0; +ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +'#----------------------FN_DYNVARS_006_06------------------------#' +SELECT @@global.binlog_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_cache_size'; +@@global.binlog_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_006_07----------------------#' +SET @@global.binlog_cache_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '1' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +SET @@global.binlog_cache_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '0' +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +4096 +'Bug: Errors are not coming on assigning TRUE/FALSE to variable' +'#---------------------FN_DYNVARS_006_08----------------------#' +SET @@global.binlog_cache_size = 1; +Warnings: +Warning 1292 Truncated incorrect binlog_cache_size value: '1' +SELECT @@binlog_cache_size = @@global.binlog_cache_size; +@@binlog_cache_size = @@global.binlog_cache_size +1 +'#---------------------FN_DYNVARS_006_09----------------------#' +SET binlog_cache_size = 1; +ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SET global.binlog_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_cache_size = 1' at line 1 +SELECT global.binlog_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT binlog_cache_size = @@session.binlog_cache_size; +ERROR 42S22: Unknown column 'binlog_cache_size' in 'field list' +SET @@global.binlog_cache_size = @start_value; +SELECT @@global.binlog_cache_size; +@@global.binlog_cache_size +32768 diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result new file mode 100644 index 00000000000..1194a0e7ce7 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_32.result @@ -0,0 +1,154 @@ +SET @start_global_value = @@global.bulk_insert_buffer_size; +SELECT @start_global_value; +@start_global_value +8388608 +SET @start_session_value = @@session.bulk_insert_buffer_size; +SELECT @start_session_value; +@start_session_value +8388608 +'#--------------------FN_DYNVARS_007_01-------------------------#' +SET @@global.bulk_insert_buffer_size = 100; +SET @@global.bulk_insert_buffer_size = DEFAULT; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +8388608 +SET @@session.bulk_insert_buffer_size = 200; +SET @@session.bulk_insert_buffer_size = DEFAULT; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +8388608 +'#--------------------FN_DYNVARS_007_02-------------------------#' +SET @@global.bulk_insert_buffer_size = @start_global_value; +SELECT @@global.bulk_insert_buffer_size = 8388608; +@@global.bulk_insert_buffer_size = 8388608 +1 +SET @@session.bulk_insert_buffer_size = @start_session_value; +SELECT @@session.bulk_insert_buffer_size = 8388608; +@@session.bulk_insert_buffer_size = 8388608 +1 +'#--------------------FN_DYNVARS_007_03-------------------------#' +SET @@global.bulk_insert_buffer_size = 0; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +0 +SET @@global.bulk_insert_buffer_size = 1; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +1 +SET @@global.bulk_insert_buffer_size = 4294967295; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +4294967295 +SET @@global.bulk_insert_buffer_size = 429496; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +429496 +'#--------------------FN_DYNVARS_007_04-------------------------#' +SET @@session.bulk_insert_buffer_size = 0; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +0 +SET @@session.bulk_insert_buffer_size = 1; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +1 +SET @@session.bulk_insert_buffer_size = 4294967295; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +4294967295 +SET @@session.bulk_insert_buffer_size = 429496; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +429496 +'#------------------FN_DYNVARS_007_05-----------------------#' +SET @@global.bulk_insert_buffer_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '42949672950' +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +4294967295 +SET @@global.bulk_insert_buffer_size = -1024; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +0 +SET @@global.bulk_insert_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@global.bulk_insert_buffer_size = ON; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@global.bulk_insert_buffer_size = 429496.10; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@session.bulk_insert_buffer_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect bulk_insert_buffer_size value: '42949672950' +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +4294967295 +SET @@session.bulk_insert_buffer_size = -2; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +0 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@session.bulk_insert_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@session.bulk_insert_buffer_size = 429496.10; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +'#------------------FN_DYNVARS_007_06-----------------------#' +SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='bulk_insert_buffer_size'; +@@global.bulk_insert_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_007_07-----------------------#' +SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='bulk_insert_buffer_size'; +@@session.bulk_insert_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_007_08-----------------------#' +SET @@global.bulk_insert_buffer_size = TRUE; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +1 +SET @@global.bulk_insert_buffer_size = FALSE; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +0 +SET @@session.bulk_insert_buffer_size = TRUE; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +1 +SET @@session.bulk_insert_buffer_size = FALSE; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +0 +'#---------------------FN_DYNVARS_007_09----------------------#' +SET @@bulk_insert_buffer_size = 100; +SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size; +@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size +1 +SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; +@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size +1 +'#---------------------FN_DYNVARS_007_10----------------------#' +SET bulk_insert_buffer_size = 1; +SELECT @@bulk_insert_buffer_size; +@@bulk_insert_buffer_size +1 +SET local.bulk_insert_buffer_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 +SELECT local.bulk_insert_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SET session.bulk_insert_buffer_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 +SELECT session.bulk_insert_buffer_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; +ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list' +SET @@global.bulk_insert_buffer_size = @start_global_value; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +8388608 +SET @@session.bulk_insert_buffer_size = @start_session_value; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +8388608 diff --git a/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result new file mode 100644 index 00000000000..9e0e8e07470 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/bulk_insert_buffer_size_basic_64.result @@ -0,0 +1,150 @@ +SET @start_global_value = @@global.bulk_insert_buffer_size; +SELECT @start_global_value; +@start_global_value +8388608 +SET @start_session_value = @@session.bulk_insert_buffer_size; +SELECT @start_session_value; +@start_session_value +8388608 +'#--------------------FN_DYNVARS_007_01-------------------------#' +SET @@global.bulk_insert_buffer_size = 100; +SET @@global.bulk_insert_buffer_size = DEFAULT; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +8388608 +SET @@session.bulk_insert_buffer_size = 200; +SET @@session.bulk_insert_buffer_size = DEFAULT; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +8388608 +'#--------------------FN_DYNVARS_007_02-------------------------#' +SET @@global.bulk_insert_buffer_size = @start_global_value; +SELECT @@global.bulk_insert_buffer_size = 8388608; +@@global.bulk_insert_buffer_size = 8388608 +1 +SET @@session.bulk_insert_buffer_size = @start_session_value; +SELECT @@session.bulk_insert_buffer_size = 8388608; +@@session.bulk_insert_buffer_size = 8388608 +1 +'#--------------------FN_DYNVARS_007_03-------------------------#' +SET @@global.bulk_insert_buffer_size = 0; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +0 +SET @@global.bulk_insert_buffer_size = 1; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +1 +SET @@global.bulk_insert_buffer_size = 4294967295; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +4294967295 +SET @@global.bulk_insert_buffer_size = 429496; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +429496 +'#--------------------FN_DYNVARS_007_04-------------------------#' +SET @@session.bulk_insert_buffer_size = 0; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +0 +SET @@session.bulk_insert_buffer_size = 1; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +1 +SET @@session.bulk_insert_buffer_size = 4294967295; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +4294967295 +SET @@session.bulk_insert_buffer_size = 429496; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +429496 +'#------------------FN_DYNVARS_007_05-----------------------#' +SET @@global.bulk_insert_buffer_size = 42949672950; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +42949672950 +SET @@global.bulk_insert_buffer_size = -1024; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +0 +SET @@global.bulk_insert_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@global.bulk_insert_buffer_size = ON; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@global.bulk_insert_buffer_size = 429496.10; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@session.bulk_insert_buffer_size = 42949672950; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +42949672950 +SET @@session.bulk_insert_buffer_size = -2; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +0 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@session.bulk_insert_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +SET @@session.bulk_insert_buffer_size = 429496.10; +ERROR 42000: Incorrect argument type to variable 'bulk_insert_buffer_size' +'#------------------FN_DYNVARS_007_06-----------------------#' +SELECT @@global.bulk_insert_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='bulk_insert_buffer_size'; +@@global.bulk_insert_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_007_07-----------------------#' +SELECT @@session.bulk_insert_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='bulk_insert_buffer_size'; +@@session.bulk_insert_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_007_08-----------------------#' +SET @@global.bulk_insert_buffer_size = TRUE; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +1 +SET @@global.bulk_insert_buffer_size = FALSE; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +0 +SET @@session.bulk_insert_buffer_size = TRUE; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +1 +SET @@session.bulk_insert_buffer_size = FALSE; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +0 +'#---------------------FN_DYNVARS_007_09----------------------#' +SET @@bulk_insert_buffer_size = 100; +SELECT @@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size; +@@bulk_insert_buffer_size = @@local.bulk_insert_buffer_size +1 +SELECT @@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; +@@local.bulk_insert_buffer_size = @@session.bulk_insert_buffer_size +1 +'#---------------------FN_DYNVARS_007_10----------------------#' +SET bulk_insert_buffer_size = 1; +SELECT @@bulk_insert_buffer_size; +@@bulk_insert_buffer_size +1 +SET local.bulk_insert_buffer_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 +SELECT local.bulk_insert_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SET session.bulk_insert_buffer_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bulk_insert_buffer_size = 1' at line 1 +SELECT session.bulk_insert_buffer_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT bulk_insert_buffer_size = @@session.bulk_insert_buffer_size; +ERROR 42S22: Unknown column 'bulk_insert_buffer_size' in 'field list' +SET @@global.bulk_insert_buffer_size = @start_global_value; +SELECT @@global.bulk_insert_buffer_size; +@@global.bulk_insert_buffer_size +8388608 +SET @@session.bulk_insert_buffer_size = @start_session_value; +SELECT @@session.bulk_insert_buffer_size; +@@session.bulk_insert_buffer_size +8388608 diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result new file mode 100644 index 00000000000..cb6820b2941 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_32.result @@ -0,0 +1,112 @@ +SET @start_value = @@global.delayed_insert_limit; +SELECT @start_value; +@start_value +100 +'#--------------------FN_DYNVARS_024_01------------------------#' +SET @@global.delayed_insert_limit = 100; +SET @@global.delayed_insert_limit = DEFAULT; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +100 +'#---------------------FN_DYNVARS_024_02-------------------------#' +SET @@global.delayed_insert_limit = @start_value; +SELECT @@global.delayed_insert_limit = 100; +@@global.delayed_insert_limit = 100 +1 +'#--------------------FN_DYNVARS_024_03------------------------#' +SET @@global.delayed_insert_limit = 10000; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +10000 +SET @@global.delayed_insert_limit = 4294967295; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +4294967295 +SET @@global.delayed_insert_limit = 1; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +'#--------------------FN_DYNVARS_024_04-------------------------#' +SET @@global.delayed_insert_limit = 0; +Warnings: +Warning 1292 Truncated incorrect delayed_insert_limit value: '0' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +SET @@global.delayed_insert_limit = -1024; +Warnings: +Warning 1292 Truncated incorrect delayed_insert_limit value: '0' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +SET @@global.delayed_insert_limit = 42949672950; +Warnings: +Warning 1292 Truncated incorrect delayed_insert_limit value: '42949672950' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.delayed_insert_limit = 429496729.5; +ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +4294967295 +SET @@global.delayed_insert_limit = ON; +ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +4294967295 +'#-------------------FN_DYNVARS_024_05----------------------------#' +SET @@session.delayed_insert_limit = 0; +ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@Session.delayed_insert_limit; +ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable +'#----------------------FN_DYNVARS_024_06------------------------#' +SELECT @@global.delayed_insert_limit = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='delayed_insert_limit'; +@@global.delayed_insert_limit = +VARIABLE_VALUE +1 +SELECT @@delayed_insert_limit = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='delayed_insert_limit'; +@@delayed_insert_limit = +VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_024_07----------------------#' +SET @@global.delayed_insert_limit = TRUE; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +SET @@global.delayed_insert_limit = FALSE; +Warnings: +Warning 1292 Truncated incorrect delayed_insert_limit value: '0' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +'#---------------------FN_DYNVARS_024_08----------------------#' +SET @@global.delayed_insert_limit = 1; +SELECT @@delayed_insert_limit = @@global.delayed_insert_limit; +@@delayed_insert_limit = @@global.delayed_insert_limit +1 +'#---------------------FN_DYNVARS_024_09----------------------#' +SET delayed_insert_limit = 1; +ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@delayed_insert_limit; +@@delayed_insert_limit +1 +SET local.delayed_insert_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 +SELECT local.delayed_insert_limit; +ERROR 42S02: Unknown table 'local' in field list +SET global.delayed_insert_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 +SELECT global.delayed_insert_limit; +ERROR 42S02: Unknown table 'global' in field list +SELECT delayed_insert_limit = @@session.delayed_insert_limit; +ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list' +SET @@global.delayed_insert_limit = @start_value; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +100 diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result new file mode 100644 index 00000000000..246bf0e8734 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_basic_64.result @@ -0,0 +1,110 @@ +SET @start_value = @@global.delayed_insert_limit; +SELECT @start_value; +@start_value +100 +'#--------------------FN_DYNVARS_024_01------------------------#' +SET @@global.delayed_insert_limit = 100; +SET @@global.delayed_insert_limit = DEFAULT; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +100 +'#---------------------FN_DYNVARS_024_02-------------------------#' +SET @@global.delayed_insert_limit = @start_value; +SELECT @@global.delayed_insert_limit = 100; +@@global.delayed_insert_limit = 100 +1 +'#--------------------FN_DYNVARS_024_03------------------------#' +SET @@global.delayed_insert_limit = 10000; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +10000 +SET @@global.delayed_insert_limit = 4294967295; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +4294967295 +SET @@global.delayed_insert_limit = 1; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +'#--------------------FN_DYNVARS_024_04-------------------------#' +SET @@global.delayed_insert_limit = 0; +Warnings: +Warning 1292 Truncated incorrect delayed_insert_limit value: '0' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +SET @@global.delayed_insert_limit = -1024; +Warnings: +Warning 1292 Truncated incorrect delayed_insert_limit value: '0' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +SET @@global.delayed_insert_limit = 42949672950; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +42949672950 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.delayed_insert_limit = 429496729.5; +ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +42949672950 +SET @@global.delayed_insert_limit = ON; +ERROR 42000: Incorrect argument type to variable 'delayed_insert_limit' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +42949672950 +'#-------------------FN_DYNVARS_024_05----------------------------#' +SET @@session.delayed_insert_limit = 0; +ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@Session.delayed_insert_limit; +ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable +'#----------------------FN_DYNVARS_024_06------------------------#' +SELECT @@global.delayed_insert_limit = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='delayed_insert_limit'; +@@global.delayed_insert_limit = +VARIABLE_VALUE +1 +SELECT @@delayed_insert_limit = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='delayed_insert_limit'; +@@delayed_insert_limit = +VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_024_07----------------------#' +SET @@global.delayed_insert_limit = TRUE; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +SET @@global.delayed_insert_limit = FALSE; +Warnings: +Warning 1292 Truncated incorrect delayed_insert_limit value: '0' +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +1 +'#---------------------FN_DYNVARS_024_08----------------------#' +SET @@global.delayed_insert_limit = 1; +SELECT @@delayed_insert_limit = @@global.delayed_insert_limit; +@@delayed_insert_limit = @@global.delayed_insert_limit +1 +'#---------------------FN_DYNVARS_024_09----------------------#' +SET delayed_insert_limit = 1; +ERROR HY000: Variable 'delayed_insert_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@delayed_insert_limit; +@@delayed_insert_limit +1 +SET local.delayed_insert_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 +SELECT local.delayed_insert_limit; +ERROR 42S02: Unknown table 'local' in field list +SET global.delayed_insert_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_insert_limit = 1' at line 1 +SELECT global.delayed_insert_limit; +ERROR 42S02: Unknown table 'global' in field list +SELECT delayed_insert_limit = @@session.delayed_insert_limit; +ERROR 42S22: Unknown column 'delayed_insert_limit' in 'field list' +SET @@global.delayed_insert_limit = @start_value; +SELECT @@global.delayed_insert_limit; +@@global.delayed_insert_limit +100 diff --git a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result new file mode 100644 index 00000000000..6bfa6f0de40 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_32.result @@ -0,0 +1,110 @@ +SET @start_value = @@global.delayed_queue_size; +SELECT @start_value; +@start_value +1000 +'#--------------------FN_DYNVARS_026_01------------------------#' +SET @@global.delayed_queue_size = 100; +SET @@global.delayed_queue_size = DEFAULT; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1000 +'#---------------------FN_DYNVARS_026_02-------------------------#' +SET @@global.delayed_queue_size = @start_value; +SELECT @@global.delayed_queue_size = 1000; +@@global.delayed_queue_size = 1000 +1 +'#--------------------FN_DYNVARS_026_03------------------------#' +SET @@global.delayed_queue_size = 10000; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +10000 +SET @@global.delayed_queue_size = 4294967295; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +4294967295 +SET @@global.delayed_queue_size = 1; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +'#--------------------FN_DYNVARS_026_04-------------------------#' +SET @@global.delayed_queue_size = 0; +Warnings: +Warning 1292 Truncated incorrect delayed_queue_size value: '0' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +SET @@global.delayed_queue_size = -1024; +Warnings: +Warning 1292 Truncated incorrect delayed_queue_size value: '0' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +SET @@global.delayed_queue_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect delayed_queue_size value: '42949672950' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.delayed_queue_size = 429496729.5; +ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +4294967295 +SET @@global.delayed_queue_size = ON; +ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' +SELECT @@delayed_queue_size; +@@delayed_queue_size +4294967295 +'#-------------------FN_DYNVARS_026_05----------------------------#' +SET @@session.delayed_queue_size = 0; +ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.delayed_queue_size; +ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable +'#----------------------FN_DYNVARS_026_06------------------------#' +SELECT @@global.delayed_queue_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='delayed_queue_size'; +@@global.delayed_queue_size = VARIABLE_VALUE +1 +SELECT @@delayed_queue_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='delayed_queue_size'; +@@delayed_queue_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_026_07----------------------#' +SET @@global.delayed_queue_size = TRUE; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +SET @@global.delayed_queue_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect delayed_queue_size value: '0' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +'#---------------------FN_DYNVARS_026_08----------------------#' +SET @@global.delayed_queue_size = 1; +SELECT @@delayed_queue_size = @@global.delayed_queue_size; +@@delayed_queue_size = @@global.delayed_queue_size +1 +'#---------------------FN_DYNVARS_026_09----------------------#' +SET delayed_queue_size = 1; +ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@delayed_queue_size; +@@delayed_queue_size +1 +SET local.delayed_queue_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 +SELECT local.delayed_queue_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.delayed_queue_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 +SELECT global.delayed_queue_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT delayed_queue_size = @@session.delayed_queue_size; +ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list' +SET @@global.delayed_queue_size = @start_value; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1000 diff --git a/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result new file mode 100644 index 00000000000..d575626b0a1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/delayed_queue_size_basic_64.result @@ -0,0 +1,108 @@ +SET @start_value = @@global.delayed_queue_size; +SELECT @start_value; +@start_value +1000 +'#--------------------FN_DYNVARS_026_01------------------------#' +SET @@global.delayed_queue_size = 100; +SET @@global.delayed_queue_size = DEFAULT; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1000 +'#---------------------FN_DYNVARS_026_02-------------------------#' +SET @@global.delayed_queue_size = @start_value; +SELECT @@global.delayed_queue_size = 1000; +@@global.delayed_queue_size = 1000 +1 +'#--------------------FN_DYNVARS_026_03------------------------#' +SET @@global.delayed_queue_size = 10000; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +10000 +SET @@global.delayed_queue_size = 4294967295; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +4294967295 +SET @@global.delayed_queue_size = 1; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +'#--------------------FN_DYNVARS_026_04-------------------------#' +SET @@global.delayed_queue_size = 0; +Warnings: +Warning 1292 Truncated incorrect delayed_queue_size value: '0' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +SET @@global.delayed_queue_size = -1024; +Warnings: +Warning 1292 Truncated incorrect delayed_queue_size value: '0' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +SET @@global.delayed_queue_size = 42949672950; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +42949672950 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.delayed_queue_size = 429496729.5; +ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +42949672950 +SET @@global.delayed_queue_size = ON; +ERROR 42000: Incorrect argument type to variable 'delayed_queue_size' +SELECT @@delayed_queue_size; +@@delayed_queue_size +42949672950 +'#-------------------FN_DYNVARS_026_05----------------------------#' +SET @@session.delayed_queue_size = 0; +ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.delayed_queue_size; +ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable +'#----------------------FN_DYNVARS_026_06------------------------#' +SELECT @@global.delayed_queue_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='delayed_queue_size'; +@@global.delayed_queue_size = VARIABLE_VALUE +1 +SELECT @@delayed_queue_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='delayed_queue_size'; +@@delayed_queue_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_026_07----------------------#' +SET @@global.delayed_queue_size = TRUE; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +SET @@global.delayed_queue_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect delayed_queue_size value: '0' +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1 +'#---------------------FN_DYNVARS_026_08----------------------#' +SET @@global.delayed_queue_size = 1; +SELECT @@delayed_queue_size = @@global.delayed_queue_size; +@@delayed_queue_size = @@global.delayed_queue_size +1 +'#---------------------FN_DYNVARS_026_09----------------------#' +SET delayed_queue_size = 1; +ERROR HY000: Variable 'delayed_queue_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@delayed_queue_size; +@@delayed_queue_size +1 +SET local.delayed_queue_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 +SELECT local.delayed_queue_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.delayed_queue_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delayed_queue_size = 1' at line 1 +SELECT global.delayed_queue_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT delayed_queue_size = @@session.delayed_queue_size; +ERROR 42S22: Unknown column 'delayed_queue_size' in 'field list' +SET @@global.delayed_queue_size = @start_value; +SELECT @@global.delayed_queue_size; +@@global.delayed_queue_size +1000 diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result new file mode 100644 index 00000000000..1d1317d0d5e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_32.result @@ -0,0 +1,100 @@ +SET @global_start_value = @@global.innodb_concurrency_tickets; +SELECT @global_start_value; +@global_start_value +500 +'#--------------------FN_DYNVARS_046_01------------------------#' +SET @@global.innodb_concurrency_tickets = 0; +Warnings: +Warning 1292 Truncated incorrect concurrency_tickets value: '0' +SET @@global.innodb_concurrency_tickets = DEFAULT; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +500 +'#---------------------FN_DYNVARS_046_02-------------------------#' +SET innodb_concurrency_tickets = 1; +ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@innodb_concurrency_tickets; +@@innodb_concurrency_tickets +500 +SELECT local.innodb_concurrency_tickets; +ERROR 42S02: Unknown table 'local' in field list +SET global innodb_concurrency_tickets = 0; +Warnings: +Warning 1292 Truncated incorrect concurrency_tickets value: '0' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +'#--------------------FN_DYNVARS_046_03------------------------#' +SET @@global.innodb_concurrency_tickets = 1; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +SET @@global.innodb_concurrency_tickets = 1000; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1000 +SET @@global.innodb_concurrency_tickets = 4294967295; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +4294967295 +'#--------------------FN_DYNVARS_046_04-------------------------#' +SET @@global.innodb_concurrency_tickets = -1; +Warnings: +Warning 1292 Truncated incorrect concurrency_tickets value: '18446744073709551615' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +4294967295 +SET @@global.innodb_concurrency_tickets = "T"; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +4294967295 +SET @@global.innodb_concurrency_tickets = "Y"; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +4294967295 +SET @@global.innodb_concurrency_tickets = 1001; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +'#----------------------FN_DYNVARS_046_05------------------------#' +SELECT @@global.innodb_concurrency_tickets = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_concurrency_tickets'; +@@global.innodb_concurrency_tickets = +VARIABLE_VALUE +1 +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_concurrency_tickets'; +VARIABLE_VALUE +1001 +'#---------------------FN_DYNVARS_046_06-------------------------#' +SET @@global.innodb_concurrency_tickets = OFF; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +SET @@global.innodb_concurrency_tickets = ON; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +'#---------------------FN_DYNVARS_046_07----------------------#' +SET @@global.innodb_concurrency_tickets = TRUE; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +SET @@global.innodb_concurrency_tickets = FALSE; +Warnings: +Warning 1292 Truncated incorrect concurrency_tickets value: '0' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +SET @@global.innodb_concurrency_tickets = @global_start_value; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +500 diff --git a/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result new file mode 100644 index 00000000000..40d307d8733 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_concurrency_tickets_basic_64.result @@ -0,0 +1,98 @@ +SET @global_start_value = @@global.innodb_concurrency_tickets; +SELECT @global_start_value; +@global_start_value +500 +'#--------------------FN_DYNVARS_046_01------------------------#' +SET @@global.innodb_concurrency_tickets = 0; +Warnings: +Warning 1292 Truncated incorrect concurrency_tickets value: '0' +SET @@global.innodb_concurrency_tickets = DEFAULT; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +500 +'#---------------------FN_DYNVARS_046_02-------------------------#' +SET innodb_concurrency_tickets = 1; +ERROR HY000: Variable 'innodb_concurrency_tickets' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@innodb_concurrency_tickets; +@@innodb_concurrency_tickets +500 +SELECT local.innodb_concurrency_tickets; +ERROR 42S02: Unknown table 'local' in field list +SET global innodb_concurrency_tickets = 0; +Warnings: +Warning 1292 Truncated incorrect concurrency_tickets value: '0' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +'#--------------------FN_DYNVARS_046_03------------------------#' +SET @@global.innodb_concurrency_tickets = 1; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +SET @@global.innodb_concurrency_tickets = 1000; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1000 +SET @@global.innodb_concurrency_tickets = 4294967295; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +4294967295 +'#--------------------FN_DYNVARS_046_04-------------------------#' +SET @@global.innodb_concurrency_tickets = -1; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +18446744073709551615 +SET @@global.innodb_concurrency_tickets = "T"; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +18446744073709551615 +SET @@global.innodb_concurrency_tickets = "Y"; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +18446744073709551615 +SET @@global.innodb_concurrency_tickets = 1001; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +'#----------------------FN_DYNVARS_046_05------------------------#' +SELECT @@global.innodb_concurrency_tickets = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_concurrency_tickets'; +@@global.innodb_concurrency_tickets = +VARIABLE_VALUE +1 +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_concurrency_tickets'; +VARIABLE_VALUE +1001 +'#---------------------FN_DYNVARS_046_06-------------------------#' +SET @@global.innodb_concurrency_tickets = OFF; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +SET @@global.innodb_concurrency_tickets = ON; +ERROR 42000: Incorrect argument type to variable 'innodb_concurrency_tickets' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1001 +'#---------------------FN_DYNVARS_046_07----------------------#' +SET @@global.innodb_concurrency_tickets = TRUE; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +SET @@global.innodb_concurrency_tickets = FALSE; +Warnings: +Warning 1292 Truncated incorrect concurrency_tickets value: '0' +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +1 +SET @@global.innodb_concurrency_tickets = @global_start_value; +SELECT @@global.innodb_concurrency_tickets; +@@global.innodb_concurrency_tickets +500 diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result new file mode 100644 index 00000000000..ed960f12ff1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_32.result @@ -0,0 +1,94 @@ +SET @global_start_value = @@global.innodb_max_purge_lag; +SELECT @global_start_value; +@global_start_value +0 +'#--------------------FN_DYNVARS_046_01------------------------#' +SET @@global.innodb_max_purge_lag = 0; +SET @@global.innodb_max_purge_lag = DEFAULT; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +'#---------------------FN_DYNVARS_046_02-------------------------#' +SET innodb_max_purge_lag = 1; +ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@innodb_max_purge_lag; +@@innodb_max_purge_lag +0 +SELECT local.innodb_max_purge_lag; +ERROR 42S02: Unknown table 'local' in field list +SET global innodb_max_purge_lag = 0; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +'#--------------------FN_DYNVARS_046_03------------------------#' +SET @@global.innodb_max_purge_lag = 0; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +SET @@global.innodb_max_purge_lag = 1; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1 +SET @@global.innodb_max_purge_lag = 4294967295; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +4294967295 +'#--------------------FN_DYNVARS_046_04-------------------------#' +SET @@global.innodb_max_purge_lag = -1; +Warnings: +Warning 1292 Truncated incorrect max_purge_lag value: '18446744073709551615' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +4294967295 +SET @@global.innodb_max_purge_lag = "T"; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +4294967295 +SET @@global.innodb_max_purge_lag = "Y"; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +4294967295 +SET @@global.innodb_max_purge_lag = 1001; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +'#----------------------FN_DYNVARS_046_05------------------------#' +SELECT @@global.innodb_max_purge_lag = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_max_purge_lag'; +@@global.innodb_max_purge_lag = +VARIABLE_VALUE +1 +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_max_purge_lag'; +VARIABLE_VALUE +1001 +'#---------------------FN_DYNVARS_046_06-------------------------#' +SET @@global.innodb_max_purge_lag = OFF; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +SET @@global.innodb_max_purge_lag = ON; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +'#---------------------FN_DYNVARS_046_07----------------------#' +SET @@global.innodb_max_purge_lag = TRUE; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1 +SET @@global.innodb_max_purge_lag = FALSE; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +SET @@global.innodb_max_purge_lag = @global_start_value; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result new file mode 100644 index 00000000000..a6b669dde83 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_basic_64.result @@ -0,0 +1,92 @@ +SET @global_start_value = @@global.innodb_max_purge_lag; +SELECT @global_start_value; +@global_start_value +0 +'#--------------------FN_DYNVARS_046_01------------------------#' +SET @@global.innodb_max_purge_lag = 0; +SET @@global.innodb_max_purge_lag = DEFAULT; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +'#---------------------FN_DYNVARS_046_02-------------------------#' +SET innodb_max_purge_lag = 1; +ERROR HY000: Variable 'innodb_max_purge_lag' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@innodb_max_purge_lag; +@@innodb_max_purge_lag +0 +SELECT local.innodb_max_purge_lag; +ERROR 42S02: Unknown table 'local' in field list +SET global innodb_max_purge_lag = 0; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +'#--------------------FN_DYNVARS_046_03------------------------#' +SET @@global.innodb_max_purge_lag = 0; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +SET @@global.innodb_max_purge_lag = 1; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1 +SET @@global.innodb_max_purge_lag = 4294967295; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +4294967295 +'#--------------------FN_DYNVARS_046_04-------------------------#' +SET @@global.innodb_max_purge_lag = -1; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +18446744073709551615 +SET @@global.innodb_max_purge_lag = "T"; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +18446744073709551615 +SET @@global.innodb_max_purge_lag = "Y"; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +18446744073709551615 +SET @@global.innodb_max_purge_lag = 1001; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +'#----------------------FN_DYNVARS_046_05------------------------#' +SELECT @@global.innodb_max_purge_lag = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_max_purge_lag'; +@@global.innodb_max_purge_lag = +VARIABLE_VALUE +1 +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_max_purge_lag'; +VARIABLE_VALUE +1001 +'#---------------------FN_DYNVARS_046_06-------------------------#' +SET @@global.innodb_max_purge_lag = OFF; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +SET @@global.innodb_max_purge_lag = ON; +ERROR 42000: Incorrect argument type to variable 'innodb_max_purge_lag' +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1001 +'#---------------------FN_DYNVARS_046_07----------------------#' +SET @@global.innodb_max_purge_lag = TRUE; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +1 +SET @@global.innodb_max_purge_lag = FALSE; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 +SET @@global.innodb_max_purge_lag = @global_start_value; +SELECT @@global.innodb_max_purge_lag; +@@global.innodb_max_purge_lag +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result new file mode 100644 index 00000000000..2b976e65b14 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_32.result @@ -0,0 +1,94 @@ +SET @global_start_value = @@global.innodb_sync_spin_loops; +SELECT @global_start_value; +@global_start_value +20 +'#--------------------FN_DYNVARS_046_01------------------------#' +SET @@global.innodb_sync_spin_loops = 0; +SET @@global.innodb_sync_spin_loops = DEFAULT; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +20 +'#---------------------FN_DYNVARS_046_02-------------------------#' +SET innodb_sync_spin_loops = 1; +ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@innodb_sync_spin_loops; +@@innodb_sync_spin_loops +20 +SELECT local.innodb_sync_spin_loops; +ERROR 42S02: Unknown table 'local' in field list +SET global innodb_sync_spin_loops = 0; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +0 +'#--------------------FN_DYNVARS_046_03------------------------#' +SET @@global.innodb_sync_spin_loops = 0; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +0 +SET @@global.innodb_sync_spin_loops = 1; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1 +SET @@global.innodb_sync_spin_loops = 1000; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1000 +'#--------------------FN_DYNVARS_046_04-------------------------#' +SET @@global.innodb_sync_spin_loops = -1; +Warnings: +Warning 1292 Truncated incorrect sync_spin_loops value: '18446744073709551615' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +4294967295 +SET @@global.innodb_sync_spin_loops = "T"; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +4294967295 +SET @@global.innodb_sync_spin_loops = "Y"; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +4294967295 +SET @@global.innodb_sync_spin_loops = 1001; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +'#----------------------FN_DYNVARS_046_05------------------------#' +SELECT @@global.innodb_sync_spin_loops = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_sync_spin_loops'; +@@global.innodb_sync_spin_loops = +VARIABLE_VALUE +1 +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_sync_spin_loops'; +VARIABLE_VALUE +1001 +'#---------------------FN_DYNVARS_046_06-------------------------#' +SET @@global.innodb_sync_spin_loops = OFF; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +SET @@global.innodb_sync_spin_loops = ON; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +'#---------------------FN_DYNVARS_046_07----------------------#' +SET @@global.innodb_sync_spin_loops = TRUE; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1 +SET @@global.innodb_sync_spin_loops = FALSE; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +0 +SET @@global.innodb_sync_spin_loops = @global_start_value; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +20 diff --git a/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result new file mode 100644 index 00000000000..1b99ad8e3db --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_sync_spin_loops_basic_64.result @@ -0,0 +1,92 @@ +SET @global_start_value = @@global.innodb_sync_spin_loops; +SELECT @global_start_value; +@global_start_value +20 +'#--------------------FN_DYNVARS_046_01------------------------#' +SET @@global.innodb_sync_spin_loops = 0; +SET @@global.innodb_sync_spin_loops = DEFAULT; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +20 +'#---------------------FN_DYNVARS_046_02-------------------------#' +SET innodb_sync_spin_loops = 1; +ERROR HY000: Variable 'innodb_sync_spin_loops' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@innodb_sync_spin_loops; +@@innodb_sync_spin_loops +20 +SELECT local.innodb_sync_spin_loops; +ERROR 42S02: Unknown table 'local' in field list +SET global innodb_sync_spin_loops = 0; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +0 +'#--------------------FN_DYNVARS_046_03------------------------#' +SET @@global.innodb_sync_spin_loops = 0; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +0 +SET @@global.innodb_sync_spin_loops = 1; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1 +SET @@global.innodb_sync_spin_loops = 1000; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1000 +'#--------------------FN_DYNVARS_046_04-------------------------#' +SET @@global.innodb_sync_spin_loops = -1; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +18446744073709551615 +SET @@global.innodb_sync_spin_loops = "T"; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +18446744073709551615 +SET @@global.innodb_sync_spin_loops = "Y"; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +18446744073709551615 +SET @@global.innodb_sync_spin_loops = 1001; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +'#----------------------FN_DYNVARS_046_05------------------------#' +SELECT @@global.innodb_sync_spin_loops = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_sync_spin_loops'; +@@global.innodb_sync_spin_loops = +VARIABLE_VALUE +1 +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='innodb_sync_spin_loops'; +VARIABLE_VALUE +1001 +'#---------------------FN_DYNVARS_046_06-------------------------#' +SET @@global.innodb_sync_spin_loops = OFF; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +SET @@global.innodb_sync_spin_loops = ON; +ERROR 42000: Incorrect argument type to variable 'innodb_sync_spin_loops' +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1001 +'#---------------------FN_DYNVARS_046_07----------------------#' +SET @@global.innodb_sync_spin_loops = TRUE; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +1 +SET @@global.innodb_sync_spin_loops = FALSE; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +0 +SET @@global.innodb_sync_spin_loops = @global_start_value; +SELECT @@global.innodb_sync_spin_loops; +@@global.innodb_sync_spin_loops +20 diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result new file mode 100644 index 00000000000..fc3061d2f59 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_32.result @@ -0,0 +1,198 @@ +SET @start_global_value = @@global.join_buffer_size; +SELECT @start_global_value; +@start_global_value +131072 +SET @start_session_value = @@session.join_buffer_size; +SELECT @start_session_value; +@start_session_value +131072 +'#--------------------FN_DYNVARS_053_01-------------------------#' +SET @@global.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SET @@global.join_buffer_size = DEFAULT; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +131072 +SET @@session.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SET @@session.join_buffer_size = DEFAULT; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +131072 +'#--------------------FN_DYNVARS_053_02-------------------------#' +SET @@global.join_buffer_size = DEFAULT; +SELECT @@global.join_buffer_size = 131072; +@@global.join_buffer_size = 131072 +1 +SET @@session.join_buffer_size = DEFAULT; +SELECT @@session.join_buffer_size = 131072; +@@session.join_buffer_size = 131072 +1 +'#--------------------FN_DYNVARS_053_03-------------------------#' +SET @@global.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = 65536; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +65536 +SET @@global.join_buffer_size = 4294967295; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +4294963200 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +'#--------------------FN_DYNVARS_053_04-------------------------#' +SET @@session.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = 65536; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +65536 +SET @@session.join_buffer_size = 4294967295; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +4294963200 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +'#------------------FN_DYNVARS_053_05-----------------------#' +SET @@global.join_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = -1024; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = 8199; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8199' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = 42949672951; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '42949672951' +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +4294963200 +SET @@global.join_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +4294963200 +SET @@global.join_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'join_buffer_size' +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +4294963200 +SET @@session.join_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = -2; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = 8199; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8199' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = 42949672951; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '42949672951' +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +4294963200 +SET @@session.join_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +4294963200 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@session.join_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'join_buffer_size' +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +4294963200 +'#------------------FN_DYNVARS_053_06-----------------------#' +SELECT @@global.join_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='join_buffer_size'; +@@global.join_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_053_07-----------------------#' +SELECT @@session.join_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='join_buffer_size'; +@@session.join_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_053_08-----------------------#' +SET @@global.join_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '1' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.join_buffer_size = 10; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '10' +SELECT @@join_buffer_size = @@global.join_buffer_size; +@@join_buffer_size = @@global.join_buffer_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@join_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '100' +SELECT @@join_buffer_size = @@local.join_buffer_size; +@@join_buffer_size = @@local.join_buffer_size +1 +SELECT @@local.join_buffer_size = @@session.join_buffer_size; +@@local.join_buffer_size = @@session.join_buffer_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET join_buffer_size = 1; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '1' +SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228; +@@join_buffer_size=8200 OR @@join_buffer_size= 8228 +1 +SELECT local.join_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.join_buffer_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT join_buffer_size = @@session.join_buffer_size; +ERROR 42S22: Unknown column 'join_buffer_size' in 'field list' +SET @@global.join_buffer_size = @start_global_value; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +131072 +SET @@session.join_buffer_size = @start_session_value; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +131072 diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result new file mode 100644 index 00000000000..ed652af67d2 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic_64.result @@ -0,0 +1,194 @@ +SET @start_global_value = @@global.join_buffer_size; +SELECT @start_global_value; +@start_global_value +131072 +SET @start_session_value = @@session.join_buffer_size; +SELECT @start_session_value; +@start_session_value +131072 +'#--------------------FN_DYNVARS_053_01-------------------------#' +SET @@global.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SET @@global.join_buffer_size = DEFAULT; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +131072 +SET @@session.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SET @@session.join_buffer_size = DEFAULT; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +131072 +'#--------------------FN_DYNVARS_053_02-------------------------#' +SET @@global.join_buffer_size = DEFAULT; +SELECT @@global.join_buffer_size = 131072; +@@global.join_buffer_size = 131072 +1 +SET @@session.join_buffer_size = DEFAULT; +SELECT @@session.join_buffer_size = 131072; +@@session.join_buffer_size = 131072 +1 +'#--------------------FN_DYNVARS_053_03-------------------------#' +SET @@global.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = 65536; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +65536 +SET @@global.join_buffer_size = 4294967295; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +4294963200 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +'#--------------------FN_DYNVARS_053_04-------------------------#' +SET @@session.join_buffer_size = 8200; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8200' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = 65536; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +65536 +SET @@session.join_buffer_size = 4294967295; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +4294963200 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +'#------------------FN_DYNVARS_053_05-----------------------#' +SET @@global.join_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = -1024; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = 8199; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8199' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = 42949672951; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +42949668864 +SET @@global.join_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +42949668864 +SET @@global.join_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'join_buffer_size' +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +42949668864 +SET @@session.join_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = -2; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = 8199; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '8199' +SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228; +@@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228 +1 +SET @@session.join_buffer_size = 42949672951; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +42949668864 +SET @@session.join_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +42949668864 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@session.join_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'join_buffer_size' +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +42949668864 +'#------------------FN_DYNVARS_053_06-----------------------#' +SELECT @@global.join_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='join_buffer_size'; +@@global.join_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_053_07-----------------------#' +SELECT @@session.join_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='join_buffer_size'; +@@session.join_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_053_08-----------------------#' +SET @@global.join_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '1' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +SET @@global.join_buffer_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '0' +SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228; +@@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228 +1 +'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.join_buffer_size = 10; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '10' +SELECT @@join_buffer_size = @@global.join_buffer_size; +@@join_buffer_size = @@global.join_buffer_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@join_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '100' +SELECT @@join_buffer_size = @@local.join_buffer_size; +@@join_buffer_size = @@local.join_buffer_size +1 +SELECT @@local.join_buffer_size = @@session.join_buffer_size; +@@local.join_buffer_size = @@session.join_buffer_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET join_buffer_size = 1; +Warnings: +Warning 1292 Truncated incorrect join_buffer_size value: '1' +SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228; +@@join_buffer_size=8200 OR @@join_buffer_size= 8228 +1 +SELECT local.join_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.join_buffer_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT join_buffer_size = @@session.join_buffer_size; +ERROR 42S22: Unknown column 'join_buffer_size' in 'field list' +SET @@global.join_buffer_size = @start_global_value; +SELECT @@global.join_buffer_size; +@@global.join_buffer_size +131072 +SET @@session.join_buffer_size = @start_session_value; +SELECT @@session.join_buffer_size; +@@session.join_buffer_size +131072 diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result new file mode 100644 index 00000000000..981988a1d4d --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_32.result @@ -0,0 +1,111 @@ +SET @start_value = @@global.key_buffer_size; +SELECT @start_value; +@start_value +1048576 +'#--------------------FN_DYNVARS_055_01------------------------#' +SET @@global.key_buffer_size = 99; +SET @@global.key_buffer_size = DEFAULT; +ERROR 42000: Variable 'key_buffer_size' doesn't have a default value +'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'#---------------------FN_DYNVARS_055_02-------------------------#' +SET @@global.key_buffer_size = @start_value; +SELECT @@global.key_buffer_size = @start_value; +@@global.key_buffer_size = @start_value +1 +'#--------------------FN_DYNVARS_055_03------------------------#' +SET @@global.key_buffer_size = @min_key_buffer_size; +SELECT @@global.key_buffer_size= @min_key_buffer_size; +@@global.key_buffer_size= @min_key_buffer_size +1 +SET @@global.key_buffer_size = 1800; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '1800' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +SET @@global.key_buffer_size = 65535; +SELECT @@global.key_buffer_size; +@@global.key_buffer_size +61440 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +'#--------------------FN_DYNVARS_055_04-------------------------#' +SET @@global.key_buffer_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_buffer_size' +SELECT @@global.key_buffer_size; +@@global.key_buffer_size +61440 +SET @@global.key_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '4' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.key_buffer_size = ON; +ERROR 42000: Incorrect argument type to variable 'key_buffer_size' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +SET @@global.key_buffer_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_buffer_size' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'#-------------------FN_DYNVARS_055_05----------------------------#' +SET @@session.key_buffer_size = 0; +ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_buffer_size = @min_key_buffer_size; +@@key_buffer_size = @min_key_buffer_size +1 +'#----------------------FN_DYNVARS_055_06------------------------#' +SELECT @@global.key_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_buffer_size'; +@@global.key_buffer_size = VARIABLE_VALUE +1 +SELECT @@key_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_buffer_size'; +@@key_buffer_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_055_07----------------------#' +SET @@global.key_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '1' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +SET @@global.key_buffer_size = FALSE; +Warnings: +Warning 1438 Cannot drop default keycache +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'#---------------------FN_DYNVARS_055_08----------------------#' +SET @@global.key_buffer_size = @min_key_buffer_size; +SELECT @@key_buffer_size = @@global.key_buffer_size; +@@key_buffer_size = @@global.key_buffer_size +1 +'#---------------------FN_DYNVARS_055_09----------------------#' +SET key_buffer_size = @min_key_buffer_size; +ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_buffer_size = @min_key_buffer_size; +@@key_buffer_size = @min_key_buffer_size +1 +SET local.key_buffer_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 +SELECT local.key_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_buffer_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 +SELECT global.key_buffer_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_buffer_size = @@session.key_buffer_size; +ERROR 42S22: Unknown column 'key_buffer_size' in 'field list' +SET @@global.key_buffer_size = @start_value; +SELECT @@global.key_buffer_size; +@@global.key_buffer_size +1048576 diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result new file mode 100644 index 00000000000..981988a1d4d --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_buffer_size_basic_64.result @@ -0,0 +1,111 @@ +SET @start_value = @@global.key_buffer_size; +SELECT @start_value; +@start_value +1048576 +'#--------------------FN_DYNVARS_055_01------------------------#' +SET @@global.key_buffer_size = 99; +SET @@global.key_buffer_size = DEFAULT; +ERROR 42000: Variable 'key_buffer_size' doesn't have a default value +'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'#---------------------FN_DYNVARS_055_02-------------------------#' +SET @@global.key_buffer_size = @start_value; +SELECT @@global.key_buffer_size = @start_value; +@@global.key_buffer_size = @start_value +1 +'#--------------------FN_DYNVARS_055_03------------------------#' +SET @@global.key_buffer_size = @min_key_buffer_size; +SELECT @@global.key_buffer_size= @min_key_buffer_size; +@@global.key_buffer_size= @min_key_buffer_size +1 +SET @@global.key_buffer_size = 1800; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '1800' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +SET @@global.key_buffer_size = 65535; +SELECT @@global.key_buffer_size; +@@global.key_buffer_size +61440 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +'#--------------------FN_DYNVARS_055_04-------------------------#' +SET @@global.key_buffer_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_buffer_size' +SELECT @@global.key_buffer_size; +@@global.key_buffer_size +61440 +SET @@global.key_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '4' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.key_buffer_size = ON; +ERROR 42000: Incorrect argument type to variable 'key_buffer_size' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +SET @@global.key_buffer_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_buffer_size' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'#-------------------FN_DYNVARS_055_05----------------------------#' +SET @@session.key_buffer_size = 0; +ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_buffer_size = @min_key_buffer_size; +@@key_buffer_size = @min_key_buffer_size +1 +'#----------------------FN_DYNVARS_055_06------------------------#' +SELECT @@global.key_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_buffer_size'; +@@global.key_buffer_size = VARIABLE_VALUE +1 +SELECT @@key_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_buffer_size'; +@@key_buffer_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_055_07----------------------#' +SET @@global.key_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '1' +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +SET @@global.key_buffer_size = FALSE; +Warnings: +Warning 1438 Cannot drop default keycache +SELECT @@global.key_buffer_size = @min_key_buffer_size; +@@global.key_buffer_size = @min_key_buffer_size +1 +'#---------------------FN_DYNVARS_055_08----------------------#' +SET @@global.key_buffer_size = @min_key_buffer_size; +SELECT @@key_buffer_size = @@global.key_buffer_size; +@@key_buffer_size = @@global.key_buffer_size +1 +'#---------------------FN_DYNVARS_055_09----------------------#' +SET key_buffer_size = @min_key_buffer_size; +ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_buffer_size = @min_key_buffer_size; +@@key_buffer_size = @min_key_buffer_size +1 +SET local.key_buffer_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 +SELECT local.key_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_buffer_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size = 10' at line 1 +SELECT global.key_buffer_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_buffer_size = @@session.key_buffer_size; +ERROR 42S22: Unknown column 'key_buffer_size' in 'field list' +SET @@global.key_buffer_size = @start_value; +SELECT @@global.key_buffer_size; +@@global.key_buffer_size +1048576 diff --git a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result new file mode 100644 index 00000000000..023b23ea425 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_32.result @@ -0,0 +1,126 @@ +SET @start_value = @@global.key_cache_age_threshold; +SELECT @start_value; +@start_value +300 +'#--------------------FN_DYNVARS_056_01------------------------#' +SET @@global.key_cache_age_threshold = 99; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' +SET @@global.key_cache_age_threshold = DEFAULT; +ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value +'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'#---------------------FN_DYNVARS_056_02-------------------------#' +SET @@global.key_cache_age_threshold = @start_value; +SELECT @@global.key_cache_age_threshold = 300; +@@global.key_cache_age_threshold = 300 +1 +'#--------------------FN_DYNVARS_056_03------------------------#' +SET @@global.key_cache_age_threshold = 100; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +SET @@global.key_cache_age_threshold = 4294967295; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +4294967200 +SET @@global.key_cache_age_threshold = 1800; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +1800 +SET @@global.key_cache_age_threshold = 65535; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +65500 +'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; +'#--------------------FN_DYNVARS_056_04-------------------------#' +SET @@global.key_cache_age_threshold = -1; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +4294967200 +SET @@global.key_cache_age_threshold = 42949672951; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +4294967200 +SET @@global.key_cache_age_threshold = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +4294967200 +SET @@global.key_cache_age_threshold = -1024; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +4294966200 +SET @@global.key_cache_age_threshold = 99; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.key_cache_age_threshold = ON; +ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +SET @@global.key_cache_age_threshold = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'#-------------------FN_DYNVARS_056_05----------------------------#' +SET @@session.key_cache_age_threshold = 0; +ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.key_cache_age_threshold; +ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable +'#----------------------FN_DYNVARS_056_06------------------------#' +SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_age_threshold'; +@@global.key_cache_age_threshold = VARIABLE_VALUE +1 +SELECT @@key_cache_age_threshold = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_age_threshold'; +@@key_cache_age_threshold = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_056_07----------------------#' +SET @@global.key_cache_age_threshold = TRUE; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '1' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +SET @@global.key_cache_age_threshold = FALSE; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '0' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'#---------------------FN_DYNVARS_056_08----------------------#' +SET @@global.key_cache_age_threshold = 101; +SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold; +@@key_cache_age_threshold = @@global.key_cache_age_threshold +1 +'#---------------------FN_DYNVARS_056_09----------------------#' +SET key_cache_age_threshold = 8000; +ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_cache_age_threshold; +@@key_cache_age_threshold +100 +SET local.key_cache_age_threshold = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 +SELECT local.key_cache_age_threshold; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_cache_age_threshold = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 +SELECT global.key_cache_age_threshold; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_cache_age_threshold = @@session.key_cache_age_threshold; +ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list' +SET @@global.key_cache_age_threshold = @start_value; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +300 diff --git a/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result new file mode 100644 index 00000000000..5e05dd7bacf --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_cache_age_threshold_basic_64.result @@ -0,0 +1,126 @@ +SET @start_value = @@global.key_cache_age_threshold; +SELECT @start_value; +@start_value +300 +'#--------------------FN_DYNVARS_056_01------------------------#' +SET @@global.key_cache_age_threshold = 99; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' +SET @@global.key_cache_age_threshold = DEFAULT; +ERROR 42000: Variable 'key_cache_age_threshold' doesn't have a default value +'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'#---------------------FN_DYNVARS_056_02-------------------------#' +SET @@global.key_cache_age_threshold = @start_value; +SELECT @@global.key_cache_age_threshold = 300; +@@global.key_cache_age_threshold = 300 +1 +'#--------------------FN_DYNVARS_056_03------------------------#' +SET @@global.key_cache_age_threshold = 100; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +SET @@global.key_cache_age_threshold = 4294967295; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +4294967200 +SET @@global.key_cache_age_threshold = 1800; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +1800 +SET @@global.key_cache_age_threshold = 65535; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +65500 +'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; +'#--------------------FN_DYNVARS_056_04-------------------------#' +SET @@global.key_cache_age_threshold = -1; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +18446744073709551600 +SET @@global.key_cache_age_threshold = 42949672951; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +42949672900 +SET @@global.key_cache_age_threshold = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +42949672900 +SET @@global.key_cache_age_threshold = -1024; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +18446744073709550500 +SET @@global.key_cache_age_threshold = 99; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '99' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.key_cache_age_threshold = ON; +ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +SET @@global.key_cache_age_threshold = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_cache_age_threshold' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'#-------------------FN_DYNVARS_056_05----------------------------#' +SET @@session.key_cache_age_threshold = 0; +ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.key_cache_age_threshold; +ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable +'#----------------------FN_DYNVARS_056_06------------------------#' +SELECT @@global.key_cache_age_threshold = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_age_threshold'; +@@global.key_cache_age_threshold = VARIABLE_VALUE +1 +SELECT @@key_cache_age_threshold = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_age_threshold'; +@@key_cache_age_threshold = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_056_07----------------------#' +SET @@global.key_cache_age_threshold = TRUE; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '1' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +SET @@global.key_cache_age_threshold = FALSE; +Warnings: +Warning 1292 Truncated incorrect key_cache_age_threshold value: '0' +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +100 +'#---------------------FN_DYNVARS_056_08----------------------#' +SET @@global.key_cache_age_threshold = 101; +SELECT @@key_cache_age_threshold = @@global.key_cache_age_threshold; +@@key_cache_age_threshold = @@global.key_cache_age_threshold +1 +'#---------------------FN_DYNVARS_056_09----------------------#' +SET key_cache_age_threshold = 8000; +ERROR HY000: Variable 'key_cache_age_threshold' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_cache_age_threshold; +@@key_cache_age_threshold +100 +SET local.key_cache_age_threshold = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 +SELECT local.key_cache_age_threshold; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_cache_age_threshold = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_age_threshold = 10' at line 1 +SELECT global.key_cache_age_threshold; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_cache_age_threshold = @@session.key_cache_age_threshold; +ERROR 42S22: Unknown column 'key_cache_age_threshold' in 'field list' +SET @@global.key_cache_age_threshold = @start_value; +SELECT @@global.key_cache_age_threshold; +@@global.key_cache_age_threshold +300 diff --git a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result new file mode 100644 index 00000000000..ac78acb8244 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_32.result @@ -0,0 +1,142 @@ +SET @start_value = @@global.key_cache_block_size; +SELECT @start_value; +@start_value +1024 +'#--------------------FN_DYNVARS_057_01------------------------#' +SET @@global.key_cache_block_size = 600; +SET @@global.key_cache_block_size = DEFAULT; +ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value +'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +'#---------------------FN_DYNVARS_057_02-------------------------#' +SET @@global.key_cache_block_size = @start_value; +SELECT @@global.key_cache_block_size = 1024; +@@global.key_cache_block_size = 1024 +1 +'#--------------------FN_DYNVARS_057_03------------------------#' +SET @@global.key_cache_block_size = 1024; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +1024 +SET @@global.key_cache_block_size = 16384; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 1800; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +1536 +SET @@global.key_cache_block_size = 16383; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +15872 +'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; +'#--------------------FN_DYNVARS_057_04-------------------------#' +SET @@global.key_cache_block_size = -1; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '4294967295' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 42949672951; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '4294967287' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = -1024; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '4294966272' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 256; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '256' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +SET @@global.key_cache_block_size = 511; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '511' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +SET @@global.key_cache_block_size = 16385; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '16385' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.key_cache_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +'#-------------------FN_DYNVARS_057_05----------------------------#' +SET @@session.key_cache_block_size = 0; +ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.key_cache_block_size; +ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable +'#----------------------FN_DYNVARS_057_06------------------------#' +SELECT @@global.key_cache_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_block_size'; +@@global.key_cache_block_size = VARIABLE_VALUE +1 +SELECT @@key_cache_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_block_size'; +@@key_cache_block_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_057_07----------------------#' +SET @@global.key_cache_block_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '1' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +SET @@global.key_cache_block_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '0' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +'#---------------------FN_DYNVARS_057_08----------------------#' +SET @@global.key_cache_block_size = 1024; +SELECT @@key_cache_block_size = @@global.key_cache_block_size; +@@key_cache_block_size = @@global.key_cache_block_size +1 +'#---------------------FN_DYNVARS_057_09----------------------#' +SET key_cache_block_size = 8000; +ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_cache_block_size; +@@key_cache_block_size +1024 +SET local.key_cache_block_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 +SELECT local.key_cache_block_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_cache_block_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 +SELECT global.key_cache_block_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_cache_block_size = @@session.key_cache_block_size; +ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list' +SET @@global.key_cache_block_size = @start_value; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +1024 diff --git a/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result new file mode 100644 index 00000000000..46ce1f26b29 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_cache_block_size_basic_64.result @@ -0,0 +1,142 @@ +SET @start_value = @@global.key_cache_block_size; +SELECT @start_value; +@start_value +1024 +'#--------------------FN_DYNVARS_057_01------------------------#' +SET @@global.key_cache_block_size = 600; +SET @@global.key_cache_block_size = DEFAULT; +ERROR 42000: Variable 'key_cache_block_size' doesn't have a default value +'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +'#---------------------FN_DYNVARS_057_02-------------------------#' +SET @@global.key_cache_block_size = @start_value; +SELECT @@global.key_cache_block_size = 1024; +@@global.key_cache_block_size = 1024 +1 +'#--------------------FN_DYNVARS_057_03------------------------#' +SET @@global.key_cache_block_size = 1024; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +1024 +SET @@global.key_cache_block_size = 16384; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 1800; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +1536 +SET @@global.key_cache_block_size = 16383; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +15872 +'Bug# 34877 : Invalid Values are coming in variable on assigning valid values and Out Of Memory Warnings are coming'; +'#--------------------FN_DYNVARS_057_04-------------------------#' +SET @@global.key_cache_block_size = -1; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709551615' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 42949672951; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '42949672951' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = -1024; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '18446744073709550592' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 256; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '256' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +SET @@global.key_cache_block_size = 511; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '511' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +SET @@global.key_cache_block_size = 16385; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '16385' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.key_cache_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +SET @@global.key_cache_block_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_cache_block_size' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +16384 +'#-------------------FN_DYNVARS_057_05----------------------------#' +SET @@session.key_cache_block_size = 0; +ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.key_cache_block_size; +ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable +'#----------------------FN_DYNVARS_057_06------------------------#' +SELECT @@global.key_cache_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_block_size'; +@@global.key_cache_block_size = VARIABLE_VALUE +1 +SELECT @@key_cache_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_block_size'; +@@key_cache_block_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_057_07----------------------#' +SET @@global.key_cache_block_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '1' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +SET @@global.key_cache_block_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '0' +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +512 +'#---------------------FN_DYNVARS_057_08----------------------#' +SET @@global.key_cache_block_size = 1024; +SELECT @@key_cache_block_size = @@global.key_cache_block_size; +@@key_cache_block_size = @@global.key_cache_block_size +1 +'#---------------------FN_DYNVARS_057_09----------------------#' +SET key_cache_block_size = 8000; +ERROR HY000: Variable 'key_cache_block_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_cache_block_size; +@@key_cache_block_size +1024 +SET local.key_cache_block_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 +SELECT local.key_cache_block_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_cache_block_size = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_block_size = 10' at line 1 +SELECT global.key_cache_block_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_cache_block_size = @@session.key_cache_block_size; +ERROR 42S22: Unknown column 'key_cache_block_size' in 'field list' +SET @@global.key_cache_block_size = @start_value; +SELECT @@global.key_cache_block_size; +@@global.key_cache_block_size +1024 diff --git a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result new file mode 100644 index 00000000000..5902dbcdf89 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_32.result @@ -0,0 +1,139 @@ +SET @start_value = @@global.key_cache_division_limit; +SELECT @start_value; +@start_value +100 +'#--------------------FN_DYNVARS_058_01------------------------#' +SET @@global.key_cache_division_limit = 50; +SET @@global.key_cache_division_limit = DEFAULT; +ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value +'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +50 +'#---------------------FN_DYNVARS_058_02-------------------------#' +SET @@global.key_cache_division_limit = @start_value; +SELECT @@global.key_cache_division_limit = 100; +@@global.key_cache_division_limit = 100 +1 +'#--------------------FN_DYNVARS_058_03------------------------#' +SET @@global.key_cache_division_limit = 1; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +SET @@global.key_cache_division_limit = 50; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +50 +SET @@global.key_cache_division_limit = 99; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +99 +SET @@global.key_cache_division_limit = 2; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +2 +'#--------------------FN_DYNVARS_058_04-------------------------#' +SET @@global.key_cache_division_limit = -1; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '4294967295' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 101; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '101' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = -1024; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '4294966272' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 0; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '0' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +SET @@global.key_cache_division_limit = 200; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '200' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 65535; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '65535' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.key_cache_division_limit = ON; +ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +'#-------------------FN_DYNVARS_058_05----------------------------#' +SET @@session.key_cache_division_limit = 0; +ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.key_cache_division_limit; +ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable +'#----------------------FN_DYNVARS_058_06------------------------#' +SELECT @@global.key_cache_division_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_division_limit'; +@@global.key_cache_division_limit = VARIABLE_VALUE +1 +SELECT @@key_cache_division_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_division_limit'; +@@key_cache_division_limit = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_058_07----------------------#' +SET @@global.key_cache_division_limit = TRUE; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +SET @@global.key_cache_division_limit = FALSE; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '0' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +'#---------------------FN_DYNVARS_058_08----------------------#' +SET @@global.key_cache_division_limit = 90; +SELECT @@key_cache_division_limit = @@global.key_cache_division_limit; +@@key_cache_division_limit = @@global.key_cache_division_limit +1 +'#---------------------FN_DYNVARS_058_09----------------------#' +SET key_cache_division_limit = 80; +ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_cache_division_limit; +@@key_cache_division_limit +90 +SET local.key_cache_division_limit = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 +SELECT local.key_cache_division_limit; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_cache_division_limit = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 +SELECT global.key_cache_division_limit; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_cache_division_limit = @@session.key_cache_division_limit; +ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list' +SET @@global.key_cache_division_limit = @start_value; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 diff --git a/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result new file mode 100644 index 00000000000..cd0cdcbca05 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/key_cache_division_limit_basic_64.result @@ -0,0 +1,139 @@ +SET @start_value = @@global.key_cache_division_limit; +SELECT @start_value; +@start_value +100 +'#--------------------FN_DYNVARS_058_01------------------------#' +SET @@global.key_cache_division_limit = 50; +SET @@global.key_cache_division_limit = DEFAULT; +ERROR 42000: Variable 'key_cache_division_limit' doesn't have a default value +'Bug# 34878: This variable has default value according to documentation'; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +50 +'#---------------------FN_DYNVARS_058_02-------------------------#' +SET @@global.key_cache_division_limit = @start_value; +SELECT @@global.key_cache_division_limit = 100; +@@global.key_cache_division_limit = 100 +1 +'#--------------------FN_DYNVARS_058_03------------------------#' +SET @@global.key_cache_division_limit = 1; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +SET @@global.key_cache_division_limit = 50; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +50 +SET @@global.key_cache_division_limit = 99; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +99 +SET @@global.key_cache_division_limit = 2; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +2 +'#--------------------FN_DYNVARS_058_04-------------------------#' +SET @@global.key_cache_division_limit = -1; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709551615' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 101; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '101' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 10000.01; +ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = -1024; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '18446744073709550592' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 0; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '0' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +SET @@global.key_cache_division_limit = 200; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '200' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 65535; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '65535' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +'Bug # 34837: Errors are not coming on assigning invalid values to variable' +SET @@global.key_cache_division_limit = ON; +ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +SET @@global.key_cache_division_limit = 'test'; +ERROR 42000: Incorrect argument type to variable 'key_cache_division_limit' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 +'#-------------------FN_DYNVARS_058_05----------------------------#' +SET @@session.key_cache_division_limit = 0; +ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.key_cache_division_limit; +ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable +'#----------------------FN_DYNVARS_058_06------------------------#' +SELECT @@global.key_cache_division_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='key_cache_division_limit'; +@@global.key_cache_division_limit = VARIABLE_VALUE +1 +SELECT @@key_cache_division_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='key_cache_division_limit'; +@@key_cache_division_limit = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_058_07----------------------#' +SET @@global.key_cache_division_limit = TRUE; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +SET @@global.key_cache_division_limit = FALSE; +Warnings: +Warning 1292 Truncated incorrect key_cache_division_limit value: '0' +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +1 +'#---------------------FN_DYNVARS_058_08----------------------#' +SET @@global.key_cache_division_limit = 90; +SELECT @@key_cache_division_limit = @@global.key_cache_division_limit; +@@key_cache_division_limit = @@global.key_cache_division_limit +1 +'#---------------------FN_DYNVARS_058_09----------------------#' +SET key_cache_division_limit = 80; +ERROR HY000: Variable 'key_cache_division_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@key_cache_division_limit; +@@key_cache_division_limit +90 +SET local.key_cache_division_limit = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 +SELECT local.key_cache_division_limit; +ERROR 42S02: Unknown table 'local' in field list +SET global.key_cache_division_limit = 10; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_cache_division_limit = 10' at line 1 +SELECT global.key_cache_division_limit; +ERROR 42S02: Unknown table 'global' in field list +SELECT key_cache_division_limit = @@session.key_cache_division_limit; +ERROR 42S22: Unknown column 'key_cache_division_limit' in 'field list' +SET @@global.key_cache_division_limit = @start_value; +SELECT @@global.key_cache_division_limit; +@@global.key_cache_division_limit +100 diff --git a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result new file mode 100644 index 00000000000..702e95b1383 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result @@ -0,0 +1,162 @@ +SET @start_global_value = @@global.log_warnings; +SELECT @start_global_value; +@start_global_value +1 +SET @start_session_value = @@session.log_warnings; +SELECT @start_session_value; +@start_session_value +1 +'#--------------------FN_DYNVARS_067_01-------------------------#' +SET @@global.log_warnings = 100; +SET @@global.log_warnings = DEFAULT; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@session.log_warnings = 200; +SET @@session.log_warnings = DEFAULT; +SELECT @@session.log_warnings; +@@session.log_warnings +1 +'#--------------------FN_DYNVARS_067_02-------------------------#' +SET @@global.log_warnings = DEFAULT; +SELECT @@global.log_warnings = 1; +@@global.log_warnings = 1 +1 +SET @@session.log_warnings = DEFAULT; +SELECT @@session.log_warnings = 1; +@@session.log_warnings = 1 +1 +'#--------------------FN_DYNVARS_067_03-------------------------#' +SET @@global.log_warnings = 0; +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@global.log_warnings = 1; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@global.log_warnings = 60020; +SELECT @@global.log_warnings; +@@global.log_warnings +60020 +SET @@global.log_warnings = 65535; +SELECT @@global.log_warnings; +@@global.log_warnings +65535 +SET @@global.log_warnings = 65536; +SELECT @@global.log_warnings; +@@global.log_warnings +65536 +'#--------------------FN_DYNVARS_067_04-------------------------#' +SET @@session.log_warnings = 0; +SELECT @@session.log_warnings; +@@session.log_warnings +0 +SET @@session.log_warnings = 1; +SELECT @@session.log_warnings; +@@session.log_warnings +1 +SET @@session.log_warnings = 50050; +SELECT @@session.log_warnings; +@@session.log_warnings +50050 +SET @@session.log_warnings = 65535; +SELECT @@session.log_warnings; +@@session.log_warnings +65535 +SET @@session.log_warnings = 65550; +SELECT @@session.log_warnings; +@@session.log_warnings +65550 +'#------------------FN_DYNVARS_067_05-----------------------#' +SET @@global.log_warnings = 100000000000; +Warnings: +Warning 1292 Truncated incorrect log-warnings value: '100000000000' +SELECT @@global.log_warnings; +@@global.log_warnings +4294967295 +SET @@global.log_warnings = -1024; +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@global.log_warnings = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@global.log_warnings = test; +ERROR 42000: Incorrect argument type to variable 'log_warnings' +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@session.log_warnings = 100000000000; +Warnings: +Warning 1292 Truncated incorrect log-warnings value: '100000000000' +SELECT @@session.log_warnings; +@@session.log_warnings +4294967295 +SET @@session.log_warnings = -2; +SELECT @@session.log_warnings; +@@session.log_warnings +0 +SET @@session.log_warnings = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.log_warnings = test; +ERROR 42000: Incorrect argument type to variable 'log_warnings' +SELECT @@session.log_warnings; +@@session.log_warnings +0 +'#------------------FN_DYNVARS_067_06-----------------------#' +SELECT @@global.log_warnings = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_warnings'; +@@global.log_warnings = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_067_07-----------------------#' +SELECT @@session.log_warnings = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='log_warnings'; +@@session.log_warnings = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_067_08-----------------------#' +SET @@global.log_warnings = TRUE; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@global.log_warnings = FALSE; +SELECT @@global.log_warnings; +@@global.log_warnings +0 +'#---------------------FN_DYNVARS_067_09----------------------#' +SET @@global.log_warnings = 10; +SELECT @@log_warnings = @@global.log_warnings; +@@log_warnings = @@global.log_warnings +0 +'#---------------------FN_DYNVARS_067_10----------------------#' +SET @@log_warnings = 100; +SELECT @@log_warnings = @@local.log_warnings; +@@log_warnings = @@local.log_warnings +1 +SELECT @@local.log_warnings = @@session.log_warnings; +@@local.log_warnings = @@session.log_warnings +1 +'#---------------------FN_DYNVARS_067_11----------------------#' +SET log_warnings = 1; +SELECT @@log_warnings; +@@log_warnings +1 +SELECT local.log_warnings; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.log_warnings; +ERROR 42S02: Unknown table 'session' in field list +SELECT log_warnings = @@session.log_warnings; +ERROR 42S22: Unknown column 'log_warnings' in 'field list' +SET @@global.log_warnings = @start_global_value; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@session.log_warnings = @start_session_value; +SELECT @@session.log_warnings; +@@session.log_warnings +1 diff --git a/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result b/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result new file mode 100644 index 00000000000..ba6671c87a4 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_64.result @@ -0,0 +1,158 @@ +SET @start_global_value = @@global.log_warnings; +SELECT @start_global_value; +@start_global_value +1 +SET @start_session_value = @@session.log_warnings; +SELECT @start_session_value; +@start_session_value +1 +'#--------------------FN_DYNVARS_067_01-------------------------#' +SET @@global.log_warnings = 100; +SET @@global.log_warnings = DEFAULT; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@session.log_warnings = 200; +SET @@session.log_warnings = DEFAULT; +SELECT @@session.log_warnings; +@@session.log_warnings +1 +'#--------------------FN_DYNVARS_067_02-------------------------#' +SET @@global.log_warnings = DEFAULT; +SELECT @@global.log_warnings = 1; +@@global.log_warnings = 1 +1 +SET @@session.log_warnings = DEFAULT; +SELECT @@session.log_warnings = 1; +@@session.log_warnings = 1 +1 +'#--------------------FN_DYNVARS_067_03-------------------------#' +SET @@global.log_warnings = 0; +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@global.log_warnings = 1; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@global.log_warnings = 60020; +SELECT @@global.log_warnings; +@@global.log_warnings +60020 +SET @@global.log_warnings = 65535; +SELECT @@global.log_warnings; +@@global.log_warnings +65535 +SET @@global.log_warnings = 65536; +SELECT @@global.log_warnings; +@@global.log_warnings +65536 +'#--------------------FN_DYNVARS_067_04-------------------------#' +SET @@session.log_warnings = 0; +SELECT @@session.log_warnings; +@@session.log_warnings +0 +SET @@session.log_warnings = 1; +SELECT @@session.log_warnings; +@@session.log_warnings +1 +SET @@session.log_warnings = 50050; +SELECT @@session.log_warnings; +@@session.log_warnings +50050 +SET @@session.log_warnings = 65535; +SELECT @@session.log_warnings; +@@session.log_warnings +65535 +SET @@session.log_warnings = 65550; +SELECT @@session.log_warnings; +@@session.log_warnings +65550 +'#------------------FN_DYNVARS_067_05-----------------------#' +SET @@global.log_warnings = 100000000000; +SELECT @@global.log_warnings; +@@global.log_warnings +100000000000 +SET @@global.log_warnings = -1024; +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@global.log_warnings = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@global.log_warnings = test; +ERROR 42000: Incorrect argument type to variable 'log_warnings' +SELECT @@global.log_warnings; +@@global.log_warnings +0 +SET @@session.log_warnings = 100000000000; +SELECT @@session.log_warnings; +@@session.log_warnings +100000000000 +SET @@session.log_warnings = -2; +SELECT @@session.log_warnings; +@@session.log_warnings +0 +SET @@session.log_warnings = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.log_warnings = test; +ERROR 42000: Incorrect argument type to variable 'log_warnings' +SELECT @@session.log_warnings; +@@session.log_warnings +0 +'#------------------FN_DYNVARS_067_06-----------------------#' +SELECT @@global.log_warnings = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='log_warnings'; +@@global.log_warnings = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_067_07-----------------------#' +SELECT @@session.log_warnings = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='log_warnings'; +@@session.log_warnings = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_067_08-----------------------#' +SET @@global.log_warnings = TRUE; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@global.log_warnings = FALSE; +SELECT @@global.log_warnings; +@@global.log_warnings +0 +'#---------------------FN_DYNVARS_067_09----------------------#' +SET @@global.log_warnings = 10; +SELECT @@log_warnings = @@global.log_warnings; +@@log_warnings = @@global.log_warnings +0 +'#---------------------FN_DYNVARS_067_10----------------------#' +SET @@log_warnings = 100; +SELECT @@log_warnings = @@local.log_warnings; +@@log_warnings = @@local.log_warnings +1 +SELECT @@local.log_warnings = @@session.log_warnings; +@@local.log_warnings = @@session.log_warnings +1 +'#---------------------FN_DYNVARS_067_11----------------------#' +SET log_warnings = 1; +SELECT @@log_warnings; +@@log_warnings +1 +SELECT local.log_warnings; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.log_warnings; +ERROR 42S02: Unknown table 'session' in field list +SELECT log_warnings = @@session.log_warnings; +ERROR 42S22: Unknown column 'log_warnings' in 'field list' +SET @@global.log_warnings = @start_global_value; +SELECT @@global.log_warnings; +@@global.log_warnings +1 +SET @@session.log_warnings = @start_session_value; +SELECT @@session.log_warnings; +@@session.log_warnings +1 diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result new file mode 100644 index 00000000000..1dbeb50ff90 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_32.result @@ -0,0 +1,145 @@ +SET @start_value = @@global.max_binlog_cache_size; +SELECT @start_value; +@start_value +4294967295 +'#--------------------FN_DYNVARS_072_01------------------------#' +SET @@global.max_binlog_cache_size = 5000; +SET @@global.max_binlog_cache_size = DEFAULT; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +'#---------------------FN_DYNVARS_072_02-------------------------#' +SET @@global.max_binlog_cache_size = @start_value; +SELECT @@global.max_binlog_cache_size = 4294967295; +@@global.max_binlog_cache_size = 4294967295 +0 +'Bug# 34876: Incorrect Default Value is assigned to variable'; +'#--------------------FN_DYNVARS_072_03------------------------#' +SET @@global.max_binlog_cache_size = 4096; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 4294967295; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +SET @@global.max_binlog_cache_size = 4294967294; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +SET @@global.max_binlog_cache_size = 4097; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 65535; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +61440 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_072_04-------------------------#' +SET @@global.max_binlog_cache_size = -1; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 100000000000; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '100000000000' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +SET @@global.max_binlog_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +SET @@global.max_binlog_cache_size = -1024; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 1024; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '1024' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 4294967296; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '4294967296' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +SET @@global.max_binlog_cache_size = 4095; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.max_binlog_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +'#-------------------FN_DYNVARS_072_05----------------------------#' +SET @@session.max_binlog_cache_size = 4096; +ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.max_binlog_cache_size; +ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable +'#----------------------FN_DYNVARS_072_06------------------------#' +SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_binlog_cache_size'; +@@global.max_binlog_cache_size = VARIABLE_VALUE +1 +SELECT @@max_binlog_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_binlog_cache_size'; +@@max_binlog_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_072_07----------------------#' +SET @@global.max_binlog_cache_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '1' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +'#---------------------FN_DYNVARS_072_08----------------------#' +SET @@global.max_binlog_cache_size = 5000; +SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size; +@@max_binlog_cache_size = @@global.max_binlog_cache_size +1 +'#---------------------FN_DYNVARS_072_09----------------------#' +SET max_binlog_cache_size = 6000; +ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@max_binlog_cache_size; +@@max_binlog_cache_size +4096 +SET local.max_binlog_cache_size = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1 +SELECT local.max_binlog_cache_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.max_binlog_cache_size = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1 +SELECT global.max_binlog_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT max_binlog_cache_size = @@session.max_binlog_cache_size; +ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list' +SET @@global.max_binlog_cache_size = @start_value; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result new file mode 100644 index 00000000000..30db3f14dd4 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic_64.result @@ -0,0 +1,141 @@ +SET @start_value = @@global.max_binlog_cache_size; +SELECT @start_value; +@start_value +18446744073709551615 +'#--------------------FN_DYNVARS_072_01------------------------#' +SET @@global.max_binlog_cache_size = 5000; +SET @@global.max_binlog_cache_size = DEFAULT; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +18446744073709547520 +'#---------------------FN_DYNVARS_072_02-------------------------#' +SET @@global.max_binlog_cache_size = @start_value; +SELECT @@global.max_binlog_cache_size = 4294967295; +@@global.max_binlog_cache_size = 4294967295 +0 +'Bug# 34876: Incorrect Default Value is assigned to variable'; +'#--------------------FN_DYNVARS_072_03------------------------#' +SET @@global.max_binlog_cache_size = 4096; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 4294967295; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +SET @@global.max_binlog_cache_size = 4294967294; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294963200 +SET @@global.max_binlog_cache_size = 4097; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 65535; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +61440 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_072_04-------------------------#' +SET @@global.max_binlog_cache_size = -1; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 100000000000; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +99999997952 +SET @@global.max_binlog_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +99999997952 +SET @@global.max_binlog_cache_size = -1024; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 1024; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '1024' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 4294967296; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4294967296 +SET @@global.max_binlog_cache_size = 4095; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '4095' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.max_binlog_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'max_binlog_cache_size' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +'#-------------------FN_DYNVARS_072_05----------------------------#' +SET @@session.max_binlog_cache_size = 4096; +ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.max_binlog_cache_size; +ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable +'#----------------------FN_DYNVARS_072_06------------------------#' +SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_binlog_cache_size'; +@@global.max_binlog_cache_size = VARIABLE_VALUE +1 +SELECT @@max_binlog_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_binlog_cache_size'; +@@max_binlog_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_072_07----------------------#' +SET @@global.max_binlog_cache_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '1' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +SET @@global.max_binlog_cache_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '0' +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +4096 +'#---------------------FN_DYNVARS_072_08----------------------#' +SET @@global.max_binlog_cache_size = 5000; +SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size; +@@max_binlog_cache_size = @@global.max_binlog_cache_size +1 +'#---------------------FN_DYNVARS_072_09----------------------#' +SET max_binlog_cache_size = 6000; +ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@max_binlog_cache_size; +@@max_binlog_cache_size +4096 +SET local.max_binlog_cache_size = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 7000' at line 1 +SELECT local.max_binlog_cache_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.max_binlog_cache_size = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_cache_size = 8000' at line 1 +SELECT global.max_binlog_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT max_binlog_cache_size = @@session.max_binlog_cache_size; +ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list' +SET @@global.max_binlog_cache_size = @start_value; +SELECT @@global.max_binlog_cache_size; +@@global.max_binlog_cache_size +18446744073709547520 diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result new file mode 100644 index 00000000000..b786e0ce31a --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_32.result @@ -0,0 +1,137 @@ +SET @start_value = @@global.max_connect_errors; +SELECT @start_value; +@start_value +10 +'#--------------------FN_DYNVARS_073_01------------------------#' +SET @@global.max_connect_errors = 5000; +SET @@global.max_connect_errors = DEFAULT; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +10 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#---------------------FN_DYNVARS_073_02-------------------------#' +SET @@global.max_connect_errors = @start_value; +SELECT @@global.max_connect_errors = 10; +@@global.max_connect_errors = 10 +1 +'#--------------------FN_DYNVARS_073_03------------------------#' +SET @@global.max_connect_errors = 4096; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4096 +SET @@global.max_connect_errors = 4294967294; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967294 +SET @@global.max_connect_errors = 4294967295; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967295 +SET @@global.max_connect_errors = 1; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 2; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +2 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_073_04-------------------------#' +SET @@global.max_connect_errors = -1; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 100000000000; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '100000000000' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967295 +SET @@global.max_connect_errors = 10000.01; +ERROR 42000: Incorrect argument type to variable 'max_connect_errors' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967295 +SET @@global.max_connect_errors = -1024; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 0; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 4294967296; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '4294967296' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.max_connect_errors = ON; +ERROR 42000: Incorrect argument type to variable 'max_connect_errors' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967295 +SET @@global.max_connect_errors = 'test'; +ERROR 42000: Incorrect argument type to variable 'max_connect_errors' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967295 +'#-------------------FN_DYNVARS_073_05----------------------------#' +SET @@session.max_connect_errors = 4096; +ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.max_connect_errors; +ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable +'#----------------------FN_DYNVARS_073_06------------------------#' +SELECT @@global.max_connect_errors = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_connect_errors'; +@@global.max_connect_errors = VARIABLE_VALUE +1 +SELECT @@max_connect_errors = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_connect_errors'; +@@max_connect_errors = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_073_07----------------------#' +SET @@global.max_connect_errors = TRUE; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +'#---------------------FN_DYNVARS_073_08----------------------#' +SET @@global.max_connect_errors = 5000; +SELECT @@max_connect_errors = @@global.max_connect_errors; +@@max_connect_errors = @@global.max_connect_errors +1 +'#---------------------FN_DYNVARS_073_09----------------------#' +SET max_connect_errors = 6000; +ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@max_connect_errors; +@@max_connect_errors +5000 +SET local.max_connect_errors = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1 +SELECT local.max_connect_errors; +ERROR 42S02: Unknown table 'local' in field list +SET global.max_connect_errors = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1 +SELECT global.max_connect_errors; +ERROR 42S02: Unknown table 'global' in field list +SELECT max_connect_errors = @@session.max_connect_errors; +ERROR 42S22: Unknown column 'max_connect_errors' in 'field list' +SET @@global.max_connect_errors = @start_value; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +10 diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result new file mode 100644 index 00000000000..8117b650651 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_connect_errors_basic_64.result @@ -0,0 +1,133 @@ +SET @start_value = @@global.max_connect_errors; +SELECT @start_value; +@start_value +10 +'#--------------------FN_DYNVARS_073_01------------------------#' +SET @@global.max_connect_errors = 5000; +SET @@global.max_connect_errors = DEFAULT; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +10 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#---------------------FN_DYNVARS_073_02-------------------------#' +SET @@global.max_connect_errors = @start_value; +SELECT @@global.max_connect_errors = 10; +@@global.max_connect_errors = 10 +1 +'#--------------------FN_DYNVARS_073_03------------------------#' +SET @@global.max_connect_errors = 4096; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4096 +SET @@global.max_connect_errors = 4294967294; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967294 +SET @@global.max_connect_errors = 4294967295; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967295 +SET @@global.max_connect_errors = 1; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 2; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +2 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_073_04-------------------------#' +SET @@global.max_connect_errors = -1; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 100000000000; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +100000000000 +SET @@global.max_connect_errors = 10000.01; +ERROR 42000: Incorrect argument type to variable 'max_connect_errors' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +100000000000 +SET @@global.max_connect_errors = -1024; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 0; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = 4294967296; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967296 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.max_connect_errors = ON; +ERROR 42000: Incorrect argument type to variable 'max_connect_errors' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967296 +SET @@global.max_connect_errors = 'test'; +ERROR 42000: Incorrect argument type to variable 'max_connect_errors' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +4294967296 +'#-------------------FN_DYNVARS_073_05----------------------------#' +SET @@session.max_connect_errors = 4096; +ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.max_connect_errors; +ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable +'#----------------------FN_DYNVARS_073_06------------------------#' +SELECT @@global.max_connect_errors = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_connect_errors'; +@@global.max_connect_errors = VARIABLE_VALUE +1 +SELECT @@max_connect_errors = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_connect_errors'; +@@max_connect_errors = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_073_07----------------------#' +SET @@global.max_connect_errors = TRUE; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +SET @@global.max_connect_errors = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_connect_errors value: '0' +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +1 +'#---------------------FN_DYNVARS_073_08----------------------#' +SET @@global.max_connect_errors = 5000; +SELECT @@max_connect_errors = @@global.max_connect_errors; +@@max_connect_errors = @@global.max_connect_errors +1 +'#---------------------FN_DYNVARS_073_09----------------------#' +SET max_connect_errors = 6000; +ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@max_connect_errors; +@@max_connect_errors +5000 +SET local.max_connect_errors = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 7000' at line 1 +SELECT local.max_connect_errors; +ERROR 42S02: Unknown table 'local' in field list +SET global.max_connect_errors = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_connect_errors = 8000' at line 1 +SELECT global.max_connect_errors; +ERROR 42S02: Unknown table 'global' in field list +SELECT max_connect_errors = @@session.max_connect_errors; +ERROR 42S22: Unknown column 'max_connect_errors' in 'field list' +SET @@global.max_connect_errors = @start_value; +SELECT @@global.max_connect_errors; +@@global.max_connect_errors +10 diff --git a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result new file mode 100644 index 00000000000..04eaa3ddd19 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_32.result @@ -0,0 +1,196 @@ +SET @start_global_value = @@global.max_heap_table_size; +SELECT @start_global_value; +@start_global_value +1048576 +SET @start_session_value = @@session.max_heap_table_size; +SELECT @start_session_value; +@start_session_value +1048576 +'#--------------------FN_DYNVARS_077_01-------------------------#' +SET @@global.max_heap_table_size = 1677721610; +SET @@global.max_heap_table_size = DEFAULT; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16777216 +SET @@session.max_heap_table_size = 1677721610; +SET @@session.max_heap_table_size = DEFAULT; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16777216 +'#--------------------FN_DYNVARS_077_02-------------------------#' +SET @@global.max_heap_table_size = DEFAULT; +SELECT @@global.max_heap_table_size = 16777216; +@@global.max_heap_table_size = 16777216 +1 +SET @@session.max_heap_table_size = DEFAULT; +SELECT @@session.max_heap_table_size = 16777216; +@@session.max_heap_table_size = 16777216 +1 +'#--------------------FN_DYNVARS_077_03-------------------------#' +SET @@global.max_heap_table_size = 16384; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 16385; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 65535; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +64512 +SET @@global.max_heap_table_size = 4294967294; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294966272 +SET @@global.max_heap_table_size = 4294967295; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_077_04-------------------------#' +SET @@session.max_heap_table_size = 16384; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 16385; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 65535; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +64512 +SET @@session.max_heap_table_size = 4294967294; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294966272 +SET @@session.max_heap_table_size = 4294967295; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#------------------FN_DYNVARS_077_05-----------------------#' +SET @@global.max_heap_table_size = -1; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = -1024; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 1024; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '1024' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 16383; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '16383' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 4294967296; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294966272 +SET @@global.max_heap_table_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294966272 +SET @@global.max_heap_table_size = test; +ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294966272 +SET @@session.max_heap_table_size = -1; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 16383; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '16383' +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 4294967296; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294966272 +SET @@session.max_heap_table_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.max_heap_table_size = 10737418241; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294966272 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.max_heap_table_size = test; +ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294966272 +'#------------------FN_DYNVARS_077_06-----------------------#' +SELECT @@global.max_heap_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_heap_table_size'; +@@global.max_heap_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_077_07-----------------------#' +SELECT @@session.max_heap_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_heap_table_size'; +@@session.max_heap_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_077_08-----------------------#' +SET @@global.max_heap_table_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '1' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +'#---------------------FN_DYNVARS_077_09----------------------#' +SET @@global.max_heap_table_size = 163845; +SELECT @@max_heap_table_size = @@global.max_heap_table_size; +@@max_heap_table_size = @@global.max_heap_table_size +0 +'#---------------------FN_DYNVARS_077_10----------------------#' +SET @@max_heap_table_size = 16777216; +SELECT @@max_heap_table_size = @@local.max_heap_table_size; +@@max_heap_table_size = @@local.max_heap_table_size +1 +SELECT @@local.max_heap_table_size = @@session.max_heap_table_size; +@@local.max_heap_table_size = @@session.max_heap_table_size +1 +'#---------------------FN_DYNVARS_077_11----------------------#' +SET max_heap_table_size = 316777216; +SELECT @@max_heap_table_size; +@@max_heap_table_size +316776448 +SELECT local.max_heap_table_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.max_heap_table_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT max_heap_table_size = @@session.max_heap_table_size; +ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list' +SET @@global.max_heap_table_size = @start_global_value; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +1048576 +SET @@session.max_heap_table_size = @start_session_value; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +1048576 diff --git a/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result new file mode 100644 index 00000000000..ebab80f376b --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_heap_table_size_basic_64.result @@ -0,0 +1,196 @@ +SET @start_global_value = @@global.max_heap_table_size; +SELECT @start_global_value; +@start_global_value +1048576 +SET @start_session_value = @@session.max_heap_table_size; +SELECT @start_session_value; +@start_session_value +1048576 +'#--------------------FN_DYNVARS_077_01-------------------------#' +SET @@global.max_heap_table_size = 1677721610; +SET @@global.max_heap_table_size = DEFAULT; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16777216 +SET @@session.max_heap_table_size = 1677721610; +SET @@session.max_heap_table_size = DEFAULT; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16777216 +'#--------------------FN_DYNVARS_077_02-------------------------#' +SET @@global.max_heap_table_size = DEFAULT; +SELECT @@global.max_heap_table_size = 16777216; +@@global.max_heap_table_size = 16777216 +1 +SET @@session.max_heap_table_size = DEFAULT; +SELECT @@session.max_heap_table_size = 16777216; +@@session.max_heap_table_size = 16777216 +1 +'#--------------------FN_DYNVARS_077_03-------------------------#' +SET @@global.max_heap_table_size = 16384; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 16385; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 65535; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +64512 +SET @@global.max_heap_table_size = 4294967294; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294966272 +SET @@global.max_heap_table_size = 4294967295; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_077_04-------------------------#' +SET @@session.max_heap_table_size = 16384; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 16385; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 65535; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +64512 +SET @@session.max_heap_table_size = 4294967294; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294966272 +SET @@session.max_heap_table_size = 4294967295; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#------------------FN_DYNVARS_077_05-----------------------#' +SET @@global.max_heap_table_size = -1; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = -1024; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 1024; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '1024' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 16383; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '16383' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = 4294967296; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294967296 +SET @@global.max_heap_table_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294967296 +SET @@global.max_heap_table_size = test; +ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +4294967296 +SET @@session.max_heap_table_size = -1; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 16383; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '16383' +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +16384 +SET @@session.max_heap_table_size = 4294967296; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +4294967296 +SET @@session.max_heap_table_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.max_heap_table_size = 10737418241; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +10737418240 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.max_heap_table_size = test; +ERROR 42000: Incorrect argument type to variable 'max_heap_table_size' +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +10737418240 +'#------------------FN_DYNVARS_077_06-----------------------#' +SELECT @@global.max_heap_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_heap_table_size'; +@@global.max_heap_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_077_07-----------------------#' +SELECT @@session.max_heap_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_heap_table_size'; +@@session.max_heap_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_077_08-----------------------#' +SET @@global.max_heap_table_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '1' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +SET @@global.max_heap_table_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_heap_table_size value: '0' +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +16384 +'#---------------------FN_DYNVARS_077_09----------------------#' +SET @@global.max_heap_table_size = 163845; +SELECT @@max_heap_table_size = @@global.max_heap_table_size; +@@max_heap_table_size = @@global.max_heap_table_size +0 +'#---------------------FN_DYNVARS_077_10----------------------#' +SET @@max_heap_table_size = 16777216; +SELECT @@max_heap_table_size = @@local.max_heap_table_size; +@@max_heap_table_size = @@local.max_heap_table_size +1 +SELECT @@local.max_heap_table_size = @@session.max_heap_table_size; +@@local.max_heap_table_size = @@session.max_heap_table_size +1 +'#---------------------FN_DYNVARS_077_11----------------------#' +SET max_heap_table_size = 316777216; +SELECT @@max_heap_table_size; +@@max_heap_table_size +316776448 +SELECT local.max_heap_table_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.max_heap_table_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT max_heap_table_size = @@session.max_heap_table_size; +ERROR 42S22: Unknown column 'max_heap_table_size' in 'field list' +SET @@global.max_heap_table_size = @start_global_value; +SELECT @@global.max_heap_table_size; +@@global.max_heap_table_size +1048576 +SET @@session.max_heap_table_size = @start_session_value; +SELECT @@session.max_heap_table_size; +@@session.max_heap_table_size +1048576 diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result new file mode 100644 index 00000000000..64828fbe619 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_32.result @@ -0,0 +1,180 @@ +SET @start_global_value = @@global.max_seeks_for_key; +SELECT @start_global_value; +@start_global_value +4294967295 +SET @start_session_value = @@session.max_seeks_for_key; +SELECT @start_session_value; +@start_session_value +4294967295 +'#--------------------FN_DYNVARS_083_01-------------------------#' +SET @@global.max_seeks_for_key = 100; +SET @@global.max_seeks_for_key = DEFAULT; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967295 +SET @@session.max_seeks_for_key = 200; +SET @@session.max_seeks_for_key = DEFAULT; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967295 +'#--------------------FN_DYNVARS_083_02-------------------------#' +SET @@global.max_seeks_for_key = DEFAULT; +SELECT @@global.max_seeks_for_key = 4294967295; +@@global.max_seeks_for_key = 4294967295 +1 +SET @@session.max_seeks_for_key = DEFAULT; +SELECT @@session.max_seeks_for_key = 4294967295; +@@session.max_seeks_for_key = 4294967295 +1 +'#--------------------FN_DYNVARS_083_03-------------------------#' +SET @@global.max_seeks_for_key = 1; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = 2; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +2 +SET @@global.max_seeks_for_key = 65536; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +65536 +SET @@global.max_seeks_for_key = 4294967295; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967295 +SET @@global.max_seeks_for_key = 4294967294; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967294 +'#--------------------FN_DYNVARS_083_04-------------------------#' +SET @@session.max_seeks_for_key = 1; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +1 +SET @@session.max_seeks_for_key = 2; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +2 +SET @@session.max_seeks_for_key = 4294967295; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967295 +SET @@session.max_seeks_for_key = 4294967294; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967294 +SET @@session.max_seeks_for_key = 65535; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +65535 +'#------------------FN_DYNVARS_083_05-----------------------#' +SET @@global.max_seeks_for_key = 0; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = -1024; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = 4294967296; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '4294967296' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967295 +SET @@global.max_seeks_for_key = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967295 +SET @@global.max_seeks_for_key = test; +ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967295 +SET @@session.max_seeks_for_key = 0; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +1 +SET @@session.max_seeks_for_key = -2; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +1 +SET @@session.max_seeks_for_key = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.max_seeks_for_key = 4294967296; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '4294967296' +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.max_seeks_for_key = test; +ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967295 +'#------------------FN_DYNVARS_083_06-----------------------#' +SELECT @@global.max_seeks_for_key = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_seeks_for_key'; +@@global.max_seeks_for_key = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_083_07-----------------------#' +SELECT @@session.max_seeks_for_key = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_seeks_for_key'; +@@session.max_seeks_for_key = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_083_08-----------------------#' +SET @@global.max_seeks_for_key = TRUE; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +'#---------------------FN_DYNVARS_083_09----------------------#' +SET @@global.max_seeks_for_key = 10; +SELECT @@max_seeks_for_key = @@global.max_seeks_for_key; +@@max_seeks_for_key = @@global.max_seeks_for_key +0 +'#---------------------FN_DYNVARS_083_10----------------------#' +SET @@max_seeks_for_key = 100; +SELECT @@max_seeks_for_key = @@local.max_seeks_for_key; +@@max_seeks_for_key = @@local.max_seeks_for_key +1 +SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key; +@@local.max_seeks_for_key = @@session.max_seeks_for_key +1 +'#---------------------FN_DYNVARS_083_11----------------------#' +SET max_seeks_for_key = 1; +SELECT @@max_seeks_for_key; +@@max_seeks_for_key +1 +SELECT local.max_seeks_for_key; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.max_seeks_for_key; +ERROR 42S02: Unknown table 'session' in field list +SELECT max_seeks_for_key = @@session.max_seeks_for_key; +ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list' +SET @@global.max_seeks_for_key = @start_global_value; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967295 +SET @@session.max_seeks_for_key = @start_session_value; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967295 diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result new file mode 100644 index 00000000000..eefb829cdae --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_basic_64.result @@ -0,0 +1,176 @@ +SET @start_global_value = @@global.max_seeks_for_key; +SELECT @start_global_value; +@start_global_value +18446744073709551615 +SET @start_session_value = @@session.max_seeks_for_key; +SELECT @start_session_value; +@start_session_value +18446744073709551615 +'#--------------------FN_DYNVARS_083_01-------------------------#' +SET @@global.max_seeks_for_key = 100; +SET @@global.max_seeks_for_key = DEFAULT; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +18446744073709551615 +SET @@session.max_seeks_for_key = 200; +SET @@session.max_seeks_for_key = DEFAULT; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +18446744073709551615 +'#--------------------FN_DYNVARS_083_02-------------------------#' +SET @@global.max_seeks_for_key = DEFAULT; +SELECT @@global.max_seeks_for_key = 4294967295; +@@global.max_seeks_for_key = 4294967295 +0 +SET @@session.max_seeks_for_key = DEFAULT; +SELECT @@session.max_seeks_for_key = 4294967295; +@@session.max_seeks_for_key = 4294967295 +0 +'#--------------------FN_DYNVARS_083_03-------------------------#' +SET @@global.max_seeks_for_key = 1; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = 2; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +2 +SET @@global.max_seeks_for_key = 65536; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +65536 +SET @@global.max_seeks_for_key = 4294967295; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967295 +SET @@global.max_seeks_for_key = 4294967294; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967294 +'#--------------------FN_DYNVARS_083_04-------------------------#' +SET @@session.max_seeks_for_key = 1; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +1 +SET @@session.max_seeks_for_key = 2; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +2 +SET @@session.max_seeks_for_key = 4294967295; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967295 +SET @@session.max_seeks_for_key = 4294967294; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967294 +SET @@session.max_seeks_for_key = 65535; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +65535 +'#------------------FN_DYNVARS_083_05-----------------------#' +SET @@global.max_seeks_for_key = 0; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = -1024; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = 4294967296; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967296 +SET @@global.max_seeks_for_key = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967296 +SET @@global.max_seeks_for_key = test; +ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +4294967296 +SET @@session.max_seeks_for_key = 0; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +1 +SET @@session.max_seeks_for_key = -2; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +1 +SET @@session.max_seeks_for_key = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.max_seeks_for_key = 4294967296; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967296 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.max_seeks_for_key = test; +ERROR 42000: Incorrect argument type to variable 'max_seeks_for_key' +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +4294967296 +'#------------------FN_DYNVARS_083_06-----------------------#' +SELECT @@global.max_seeks_for_key = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_seeks_for_key'; +@@global.max_seeks_for_key = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_083_07-----------------------#' +SELECT @@session.max_seeks_for_key = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_seeks_for_key'; +@@session.max_seeks_for_key = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_083_08-----------------------#' +SET @@global.max_seeks_for_key = TRUE; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +SET @@global.max_seeks_for_key = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_seeks_for_key value: '0' +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +1 +'#---------------------FN_DYNVARS_083_09----------------------#' +SET @@global.max_seeks_for_key = 10; +SELECT @@max_seeks_for_key = @@global.max_seeks_for_key; +@@max_seeks_for_key = @@global.max_seeks_for_key +0 +'#---------------------FN_DYNVARS_083_10----------------------#' +SET @@max_seeks_for_key = 100; +SELECT @@max_seeks_for_key = @@local.max_seeks_for_key; +@@max_seeks_for_key = @@local.max_seeks_for_key +1 +SELECT @@local.max_seeks_for_key = @@session.max_seeks_for_key; +@@local.max_seeks_for_key = @@session.max_seeks_for_key +1 +'#---------------------FN_DYNVARS_083_11----------------------#' +SET max_seeks_for_key = 1; +SELECT @@max_seeks_for_key; +@@max_seeks_for_key +1 +SELECT local.max_seeks_for_key; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.max_seeks_for_key; +ERROR 42S02: Unknown table 'session' in field list +SELECT max_seeks_for_key = @@session.max_seeks_for_key; +ERROR 42S22: Unknown column 'max_seeks_for_key' in 'field list' +SET @@global.max_seeks_for_key = @start_global_value; +SELECT @@global.max_seeks_for_key; +@@global.max_seeks_for_key +18446744073709551615 +SET @@session.max_seeks_for_key = @start_session_value; +SELECT @@session.max_seeks_for_key; +@@session.max_seeks_for_key +18446744073709551615 diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result new file mode 100644 index 00000000000..5f959069661 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_32.result @@ -0,0 +1,197 @@ +SET @start_global_value = @@global.max_tmp_tables; +SELECT @start_global_value; +@start_global_value +32 +SET @start_session_value = @@session.max_tmp_tables; +SELECT @start_session_value; +@start_session_value +32 +'#--------------------FN_DYNVARS_086_01-------------------------#' +SET @@global.max_tmp_tables = 1000; +SET @@global.max_tmp_tables = DEFAULT; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +32 +SET @@session.max_tmp_tables = 1000; +SET @@session.max_tmp_tables = DEFAULT; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +32 +'#--------------------FN_DYNVARS_086_02-------------------------#' +SET @@global.max_tmp_tables = DEFAULT; +SELECT @@global.max_tmp_tables = 32; +@@global.max_tmp_tables = 32 +1 +SET @@session.max_tmp_tables = DEFAULT; +SELECT @@session.max_tmp_tables = 32; +@@session.max_tmp_tables = 32 +1 +'#--------------------FN_DYNVARS_086_03-------------------------#' +SET @@global.max_tmp_tables = 1; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = 2; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +2 +SET @@global.max_tmp_tables = 65536; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +65536 +SET @@global.max_tmp_tables = 4294967295; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967295 +SET @@global.max_tmp_tables = 4294967294; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967294 +'#--------------------FN_DYNVARS_086_04-------------------------#' +SET @@session.max_tmp_tables = 1; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +1 +SET @@session.max_tmp_tables = 2; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +2 +SET @@session.max_tmp_tables = 65536; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +65536 +SET @@session.max_tmp_tables = 4294967295; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967295 +SET @@session.max_tmp_tables = 4294967294; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967294 +'#------------------FN_DYNVARS_086_05-----------------------#' +SET @@global.max_tmp_tables = -1024; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = 4294967296; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967295 +SET @@global.max_tmp_tables = -1; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = 429496729500; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967295 +SET @@global.max_tmp_tables = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967295 +SET @@global.max_tmp_tables = test; +ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967295 +SET @@session.max_tmp_tables = 4294967296; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967295 +SET @@session.max_tmp_tables = -1; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +1 +SET @@session.max_tmp_tables = 429496729500; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967295 +SET @@session.max_tmp_tables = -001; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +1 +SET @@session.max_tmp_tables = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.max_tmp_tables = 10737418241; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '10737418241' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967295 +SET @@session.max_tmp_tables = test; +ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967295 +'#------------------FN_DYNVARS_086_06-----------------------#' +SELECT @@global.max_tmp_tables = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_tmp_tables'; +@@global.max_tmp_tables = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_086_07-----------------------#' +SELECT @@session.max_tmp_tables = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_tmp_tables'; +@@session.max_tmp_tables = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_086_08-----------------------#' +SET @@global.max_tmp_tables = TRUE; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +'#---------------------FN_DYNVARS_086_09----------------------#' +SET @@global.max_tmp_tables = 20; +SELECT @@max_tmp_tables = @@global.max_tmp_tables; +@@max_tmp_tables = @@global.max_tmp_tables +0 +'#---------------------FN_DYNVARS_086_10----------------------#' +SET @@max_tmp_tables = 255; +SELECT @@max_tmp_tables = @@local.max_tmp_tables; +@@max_tmp_tables = @@local.max_tmp_tables +1 +SELECT @@local.max_tmp_tables = @@session.max_tmp_tables; +@@local.max_tmp_tables = @@session.max_tmp_tables +1 +'#---------------------FN_DYNVARS_086_11----------------------#' +SET max_tmp_tables = 102; +SELECT @@max_tmp_tables; +@@max_tmp_tables +102 +SELECT local.max_tmp_tables; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.max_tmp_tables; +ERROR 42S02: Unknown table 'session' in field list +SELECT max_tmp_tables = @@session.max_tmp_tables; +ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list' +SET @@global.max_tmp_tables = @start_global_value; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +32 +SET @@session.max_tmp_tables = @start_session_value; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +32 diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result new file mode 100644 index 00000000000..4b9f68c509e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic_64.result @@ -0,0 +1,187 @@ +SET @start_global_value = @@global.max_tmp_tables; +SELECT @start_global_value; +@start_global_value +32 +SET @start_session_value = @@session.max_tmp_tables; +SELECT @start_session_value; +@start_session_value +32 +'#--------------------FN_DYNVARS_086_01-------------------------#' +SET @@global.max_tmp_tables = 1000; +SET @@global.max_tmp_tables = DEFAULT; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +32 +SET @@session.max_tmp_tables = 1000; +SET @@session.max_tmp_tables = DEFAULT; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +32 +'#--------------------FN_DYNVARS_086_02-------------------------#' +SET @@global.max_tmp_tables = DEFAULT; +SELECT @@global.max_tmp_tables = 32; +@@global.max_tmp_tables = 32 +1 +SET @@session.max_tmp_tables = DEFAULT; +SELECT @@session.max_tmp_tables = 32; +@@session.max_tmp_tables = 32 +1 +'#--------------------FN_DYNVARS_086_03-------------------------#' +SET @@global.max_tmp_tables = 1; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = 2; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +2 +SET @@global.max_tmp_tables = 65536; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +65536 +SET @@global.max_tmp_tables = 4294967295; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967295 +SET @@global.max_tmp_tables = 4294967294; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967294 +'#--------------------FN_DYNVARS_086_04-------------------------#' +SET @@session.max_tmp_tables = 1; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +1 +SET @@session.max_tmp_tables = 2; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +2 +SET @@session.max_tmp_tables = 65536; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +65536 +SET @@session.max_tmp_tables = 4294967295; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967295 +SET @@session.max_tmp_tables = 4294967294; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967294 +'#------------------FN_DYNVARS_086_05-----------------------#' +SET @@global.max_tmp_tables = -1024; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = 4294967296; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +4294967296 +SET @@global.max_tmp_tables = -1; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = 429496729500; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +429496729500 +SET @@global.max_tmp_tables = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +429496729500 +SET @@global.max_tmp_tables = test; +ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +429496729500 +SET @@session.max_tmp_tables = 4294967296; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +4294967296 +SET @@session.max_tmp_tables = -1; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +1 +SET @@session.max_tmp_tables = 429496729500; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +429496729500 +SET @@session.max_tmp_tables = -001; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +1 +SET @@session.max_tmp_tables = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.max_tmp_tables = 10737418241; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +10737418241 +SET @@session.max_tmp_tables = test; +ERROR 42000: Incorrect argument type to variable 'max_tmp_tables' +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +10737418241 +'#------------------FN_DYNVARS_086_06-----------------------#' +SELECT @@global.max_tmp_tables = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_tmp_tables'; +@@global.max_tmp_tables = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_086_07-----------------------#' +SELECT @@session.max_tmp_tables = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_tmp_tables'; +@@session.max_tmp_tables = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_086_08-----------------------#' +SET @@global.max_tmp_tables = TRUE; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +SET @@global.max_tmp_tables = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_tmp_tables value: '0' +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +1 +'#---------------------FN_DYNVARS_086_09----------------------#' +SET @@global.max_tmp_tables = 20; +SELECT @@max_tmp_tables = @@global.max_tmp_tables; +@@max_tmp_tables = @@global.max_tmp_tables +0 +'#---------------------FN_DYNVARS_086_10----------------------#' +SET @@max_tmp_tables = 255; +SELECT @@max_tmp_tables = @@local.max_tmp_tables; +@@max_tmp_tables = @@local.max_tmp_tables +1 +SELECT @@local.max_tmp_tables = @@session.max_tmp_tables; +@@local.max_tmp_tables = @@session.max_tmp_tables +1 +'#---------------------FN_DYNVARS_086_11----------------------#' +SET max_tmp_tables = 102; +SELECT @@max_tmp_tables; +@@max_tmp_tables +102 +SELECT local.max_tmp_tables; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.max_tmp_tables; +ERROR 42S02: Unknown table 'session' in field list +SELECT max_tmp_tables = @@session.max_tmp_tables; +ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list' +SET @@global.max_tmp_tables = @start_global_value; +SELECT @@global.max_tmp_tables; +@@global.max_tmp_tables +32 +SET @@session.max_tmp_tables = @start_session_value; +SELECT @@session.max_tmp_tables; +@@session.max_tmp_tables +32 diff --git a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result new file mode 100644 index 00000000000..0c9c3c00c1f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_32.result @@ -0,0 +1,108 @@ +SET @start_global_value = @@global.max_write_lock_count; +SELECT @start_global_value; +@start_global_value +4294967295 +'#--------------------FN_DYNVARS_088_01-------------------------#' +SET @@global.max_write_lock_count = 1000; +SET @@global.max_write_lock_count = DEFAULT; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 +'#--------------------FN_DYNVARS_088_02-------------------------#' +SET @@global.max_write_lock_count = DEFAULT; +SELECT @@global.max_write_lock_count = 4294967295; +@@global.max_write_lock_count = 4294967295 +1 +'#--------------------FN_DYNVARS_088_03-------------------------#' +SET @@global.max_write_lock_count = 1; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = 2; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +2 +SET @@global.max_write_lock_count = 65536; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +65536 +SET @@global.max_write_lock_count = 4294967295; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 +SET @@global.max_write_lock_count = 4294967294; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967294 +'#------------------FN_DYNVARS_088_04-----------------------#' +SET @@global.max_write_lock_count = -1024; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '0' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = 4294967296; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '4294967296' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 +SET @@global.max_write_lock_count = -1; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '0' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = 429496729500; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '429496729500' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 +SET @@global.max_write_lock_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 +SET @@global.max_write_lock_count = test; +ERROR 42000: Incorrect argument type to variable 'max_write_lock_count' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 +'#------------------FN_DYNVARS_088_05-----------------------#' +SELECT @@global.max_write_lock_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_write_lock_count'; +@@global.max_write_lock_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_088_06-----------------------#' +SET @@global.max_write_lock_count = TRUE; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '0' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +'#---------------------FN_DYNVARS_088_07----------------------#' +SET @@global.max_write_lock_count = 20; +SELECT @@max_write_lock_count = @@global.max_write_lock_count; +@@max_write_lock_count = @@global.max_write_lock_count +1 +'#---------------------FN_DYNVARS_088_08----------------------#' +SET @@global.max_write_lock_count = 102; +SELECT @@max_write_lock_count; +@@max_write_lock_count +102 +SELECT local.max_write_lock_count; +ERROR 42S02: Unknown table 'local' in field list +SELECT global.max_write_lock_count; +ERROR 42S02: Unknown table 'global' in field list +SELECT max_write_lock_count = @@global.max_write_lock_count; +ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list' +SET @@global.max_write_lock_count = @start_global_value; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 diff --git a/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result new file mode 100644 index 00000000000..d74586841dd --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_write_lock_count_basic_64.result @@ -0,0 +1,104 @@ +SET @start_global_value = @@global.max_write_lock_count; +SELECT @start_global_value; +@start_global_value +18446744073709551615 +'#--------------------FN_DYNVARS_088_01-------------------------#' +SET @@global.max_write_lock_count = 1000; +SET @@global.max_write_lock_count = DEFAULT; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +18446744073709551615 +'#--------------------FN_DYNVARS_088_02-------------------------#' +SET @@global.max_write_lock_count = DEFAULT; +SELECT @@global.max_write_lock_count = 4294967295; +@@global.max_write_lock_count = 4294967295 +0 +'#--------------------FN_DYNVARS_088_03-------------------------#' +SET @@global.max_write_lock_count = 1; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = 2; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +2 +SET @@global.max_write_lock_count = 65536; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +65536 +SET @@global.max_write_lock_count = 4294967295; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967295 +SET @@global.max_write_lock_count = 4294967294; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967294 +'#------------------FN_DYNVARS_088_04-----------------------#' +SET @@global.max_write_lock_count = -1024; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '0' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = 4294967296; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +4294967296 +SET @@global.max_write_lock_count = -1; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '0' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = 429496729500; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +429496729500 +SET @@global.max_write_lock_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +429496729500 +SET @@global.max_write_lock_count = test; +ERROR 42000: Incorrect argument type to variable 'max_write_lock_count' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +429496729500 +'#------------------FN_DYNVARS_088_05-----------------------#' +SELECT @@global.max_write_lock_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_write_lock_count'; +@@global.max_write_lock_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_088_06-----------------------#' +SET @@global.max_write_lock_count = TRUE; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +SET @@global.max_write_lock_count = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_write_lock_count value: '0' +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +1 +'#---------------------FN_DYNVARS_088_07----------------------#' +SET @@global.max_write_lock_count = 20; +SELECT @@max_write_lock_count = @@global.max_write_lock_count; +@@max_write_lock_count = @@global.max_write_lock_count +1 +'#---------------------FN_DYNVARS_088_08----------------------#' +SET @@global.max_write_lock_count = 102; +SELECT @@max_write_lock_count; +@@max_write_lock_count +102 +SELECT local.max_write_lock_count; +ERROR 42S02: Unknown table 'local' in field list +SELECT global.max_write_lock_count; +ERROR 42S02: Unknown table 'global' in field list +SELECT max_write_lock_count = @@global.max_write_lock_count; +ERROR 42S22: Unknown column 'max_write_lock_count' in 'field list' +SET @@global.max_write_lock_count = @start_global_value; +SELECT @@global.max_write_lock_count; +@@global.max_write_lock_count +18446744073709551615 diff --git a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result new file mode 100644 index 00000000000..c0315944a8a --- /dev/null +++ b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_32.result @@ -0,0 +1,180 @@ +SET @start_global_value = @@global.min_examined_row_limit; +SELECT @start_global_value; +@start_global_value +0 +SET @start_session_value = @@session.min_examined_row_limit; +SELECT @start_session_value; +@start_session_value +0 +'#--------------------FN_DYNVARS_089_01-------------------------#' +SET @@global.min_examined_row_limit = 100; +SET @@global.min_examined_row_limit = DEFAULT; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = 200; +SET @@session.min_examined_row_limit = DEFAULT; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 +'#--------------------FN_DYNVARS_089_02-------------------------#' +SET @@global.min_examined_row_limit = DEFAULT; +SELECT @@global.min_examined_row_limit = 0; +@@global.min_examined_row_limit = 0 +1 +SET @@session.min_examined_row_limit = DEFAULT; +SELECT @@session.min_examined_row_limit = 0; +@@session.min_examined_row_limit = 0 +1 +'#--------------------FN_DYNVARS_089_03-------------------------#' +SET @@global.min_examined_row_limit = 0; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@global.min_examined_row_limit = 1; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +1 +SET @@global.min_examined_row_limit = 60020; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +60020 +SET @@global.min_examined_row_limit = 65535; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +65535 +SET @@global.min_examined_row_limit = 4294967295; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +4294967295 +SET @@global.min_examined_row_limit = 4294967294; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +4294967294 +'#--------------------FN_DYNVARS_089_04-------------------------#' +SET @@session.min_examined_row_limit = 0; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = 1; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +1 +SET @@session.min_examined_row_limit = 50050; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +50050 +SET @@session.min_examined_row_limit = 65535; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +65535 +SET @@session.min_examined_row_limit = 4294967295; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967295 +SET @@session.min_examined_row_limit = 4294967294; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967294 +'#------------------FN_DYNVARS_089_05-----------------------#' +SET @@global.min_examined_row_limit = 429496726; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +429496726 +SET @@global.min_examined_row_limit = -1024; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@global.min_examined_row_limit = 429496729500; +Warnings: +Warning 1292 Truncated incorrect min_examined_row_limit value: '429496729500' +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +4294967295 +SET @@global.min_examined_row_limit = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +4294967295 +SET @@global.min_examined_row_limit = test; +ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +4294967295 +SET @@session.min_examined_row_limit = 4294967296; +Warnings: +Warning 1292 Truncated incorrect min_examined_row_limit value: '4294967296' +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967295 +SET @@session.min_examined_row_limit = -1; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.min_examined_row_limit = 4294967295021; +Warnings: +Warning 1292 Truncated incorrect min_examined_row_limit value: '4294967295021' +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.min_examined_row_limit = test; +ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967295 +'#------------------FN_DYNVARS_089_06-----------------------#' +SELECT @@global.min_examined_row_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='min_examined_row_limit'; +@@global.min_examined_row_limit = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_089_07-----------------------#' +SELECT @@session.min_examined_row_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='min_examined_row_limit'; +@@session.min_examined_row_limit = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_089_08-----------------------#' +SET @@global.min_examined_row_limit = TRUE; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +1 +SET @@global.min_examined_row_limit = FALSE; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +'#---------------------FN_DYNVARS_089_09----------------------#' +SET @@global.min_examined_row_limit = 10; +SELECT @@min_examined_row_limit = @@global.min_examined_row_limit; +@@min_examined_row_limit = @@global.min_examined_row_limit +0 +'#---------------------FN_DYNVARS_089_10----------------------#' +SET @@min_examined_row_limit = 100; +SELECT @@min_examined_row_limit = @@local.min_examined_row_limit; +@@min_examined_row_limit = @@local.min_examined_row_limit +1 +SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit; +@@local.min_examined_row_limit = @@session.min_examined_row_limit +1 +'#---------------------FN_DYNVARS_089_11----------------------#' +SET min_examined_row_limit = 1; +SELECT @@min_examined_row_limit; +@@min_examined_row_limit +1 +SELECT local.min_examined_row_limit; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.min_examined_row_limit; +ERROR 42S02: Unknown table 'session' in field list +SELECT min_examined_row_limit = @@session.min_examined_row_limit; +ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list' +SET @@global.min_examined_row_limit = @start_global_value; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = @start_session_value; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 diff --git a/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result new file mode 100644 index 00000000000..fa11659c6c5 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/min_examined_row_limit_basic_64.result @@ -0,0 +1,174 @@ +SET @start_global_value = @@global.min_examined_row_limit; +SELECT @start_global_value; +@start_global_value +0 +SET @start_session_value = @@session.min_examined_row_limit; +SELECT @start_session_value; +@start_session_value +0 +'#--------------------FN_DYNVARS_089_01-------------------------#' +SET @@global.min_examined_row_limit = 100; +SET @@global.min_examined_row_limit = DEFAULT; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = 200; +SET @@session.min_examined_row_limit = DEFAULT; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 +'#--------------------FN_DYNVARS_089_02-------------------------#' +SET @@global.min_examined_row_limit = DEFAULT; +SELECT @@global.min_examined_row_limit = 0; +@@global.min_examined_row_limit = 0 +1 +SET @@session.min_examined_row_limit = DEFAULT; +SELECT @@session.min_examined_row_limit = 0; +@@session.min_examined_row_limit = 0 +1 +'#--------------------FN_DYNVARS_089_03-------------------------#' +SET @@global.min_examined_row_limit = 0; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@global.min_examined_row_limit = 1; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +1 +SET @@global.min_examined_row_limit = 60020; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +60020 +SET @@global.min_examined_row_limit = 65535; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +65535 +SET @@global.min_examined_row_limit = 4294967295; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +4294967295 +SET @@global.min_examined_row_limit = 4294967294; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +4294967294 +'#--------------------FN_DYNVARS_089_04-------------------------#' +SET @@session.min_examined_row_limit = 0; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = 1; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +1 +SET @@session.min_examined_row_limit = 50050; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +50050 +SET @@session.min_examined_row_limit = 65535; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +65535 +SET @@session.min_examined_row_limit = 4294967295; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967295 +SET @@session.min_examined_row_limit = 4294967294; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967294 +'#------------------FN_DYNVARS_089_05-----------------------#' +SET @@global.min_examined_row_limit = 429496726; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +429496726 +SET @@global.min_examined_row_limit = -1024; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@global.min_examined_row_limit = 429496729500; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +429496729500 +SET @@global.min_examined_row_limit = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +429496729500 +SET @@global.min_examined_row_limit = test; +ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +429496729500 +SET @@session.min_examined_row_limit = 4294967296; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967296 +SET @@session.min_examined_row_limit = -1; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.min_examined_row_limit = 4294967295021; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967295021 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.min_examined_row_limit = test; +ERROR 42000: Incorrect argument type to variable 'min_examined_row_limit' +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +4294967295021 +'#------------------FN_DYNVARS_089_06-----------------------#' +SELECT @@global.min_examined_row_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='min_examined_row_limit'; +@@global.min_examined_row_limit = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_089_07-----------------------#' +SELECT @@session.min_examined_row_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='min_examined_row_limit'; +@@session.min_examined_row_limit = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_089_08-----------------------#' +SET @@global.min_examined_row_limit = TRUE; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +1 +SET @@global.min_examined_row_limit = FALSE; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +'#---------------------FN_DYNVARS_089_09----------------------#' +SET @@global.min_examined_row_limit = 10; +SELECT @@min_examined_row_limit = @@global.min_examined_row_limit; +@@min_examined_row_limit = @@global.min_examined_row_limit +0 +'#---------------------FN_DYNVARS_089_10----------------------#' +SET @@min_examined_row_limit = 100; +SELECT @@min_examined_row_limit = @@local.min_examined_row_limit; +@@min_examined_row_limit = @@local.min_examined_row_limit +1 +SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit; +@@local.min_examined_row_limit = @@session.min_examined_row_limit +1 +'#---------------------FN_DYNVARS_089_11----------------------#' +SET min_examined_row_limit = 1; +SELECT @@min_examined_row_limit; +@@min_examined_row_limit +1 +SELECT local.min_examined_row_limit; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.min_examined_row_limit; +ERROR 42S02: Unknown table 'session' in field list +SELECT min_examined_row_limit = @@session.min_examined_row_limit; +ERROR 42S22: Unknown column 'min_examined_row_limit' in 'field list' +SET @@global.min_examined_row_limit = @start_global_value; +SELECT @@global.min_examined_row_limit; +@@global.min_examined_row_limit +0 +SET @@session.min_examined_row_limit = @start_session_value; +SELECT @@session.min_examined_row_limit; +@@session.min_examined_row_limit +0 diff --git a/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result b/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result new file mode 100644 index 00000000000..f6ac6490479 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/multi_range_count_basic_32.result @@ -0,0 +1,192 @@ +SET @start_global_value = @@global.multi_range_count; +SELECT @start_global_value; +@start_global_value +256 +SET @start_session_value = @@session.multi_range_count; +SELECT @start_session_value; +@start_session_value +256 +'#--------------------FN_DYNVARS_090_01-------------------------#' +SET @@global.multi_range_count = 100; +SET @@global.multi_range_count = DEFAULT; +SELECT @@global.multi_range_count; +@@global.multi_range_count +256 +SET @@session.multi_range_count = 200; +SET @@session.multi_range_count = DEFAULT; +SELECT @@session.multi_range_count; +@@session.multi_range_count +256 +'#--------------------FN_DYNVARS_090_02-------------------------#' +SET @@global.multi_range_count = DEFAULT; +SELECT @@global.multi_range_count = 256; +@@global.multi_range_count = 256 +1 +SET @@session.multi_range_count = DEFAULT; +SELECT @@session.multi_range_count = 256; +@@session.multi_range_count = 256 +1 +'#--------------------FN_DYNVARS_090_03-------------------------#' +SET @@global.multi_range_count = 1; +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = 60020; +SELECT @@global.multi_range_count; +@@global.multi_range_count +60020 +SET @@global.multi_range_count = 65535; +SELECT @@global.multi_range_count; +@@global.multi_range_count +65535 +SET @@global.multi_range_count = 4294967295; +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967295 +SET @@global.multi_range_count = 4294967294; +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967294 +'#--------------------FN_DYNVARS_090_04-------------------------#' +SET @@session.multi_range_count = 1; +SELECT @@session.multi_range_count; +@@session.multi_range_count +1 +SET @@session.multi_range_count = 50050; +SELECT @@session.multi_range_count; +@@session.multi_range_count +50050 +SET @@session.multi_range_count = 65535; +SELECT @@session.multi_range_count; +@@session.multi_range_count +65535 +SET @@session.multi_range_count = 4294967295; +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967295 +SET @@session.multi_range_count = 4294967294; +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967294 +'#------------------FN_DYNVARS_090_05-----------------------#' +SET @@global.multi_range_count = 0; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = 4294967296; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '4294967296' +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967295 +SET @@global.multi_range_count = -1024; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = 429496729500; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '429496729500' +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967295 +SET @@global.multi_range_count = 65530.34; +ERROR 42000: Incorrect argument type to variable 'multi_range_count' +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967295 +SET @@global.multi_range_count = test; +ERROR 42000: Incorrect argument type to variable 'multi_range_count' +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967295 +SET @@session.multi_range_count = 0; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@session.multi_range_count; +@@session.multi_range_count +1 +SET @@session.multi_range_count = 4294967296; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '4294967296' +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967295 +SET @@session.multi_range_count = -1; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@session.multi_range_count; +@@session.multi_range_count +1 +SET @@session.multi_range_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.multi_range_count = 4294967295021; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '4294967295021' +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.multi_range_count = test; +ERROR 42000: Incorrect argument type to variable 'multi_range_count' +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967295 +'#------------------FN_DYNVARS_090_06-----------------------#' +SELECT @@global.multi_range_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='multi_range_count'; +@@global.multi_range_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_090_07-----------------------#' +SELECT @@session.multi_range_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='multi_range_count'; +@@session.multi_range_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_090_08-----------------------#' +SET @@global.multi_range_count = TRUE; +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = FALSE; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +'#---------------------FN_DYNVARS_090_09----------------------#' +SET @@global.multi_range_count = 10; +SELECT @@multi_range_count = @@global.multi_range_count; +@@multi_range_count = @@global.multi_range_count +0 +'#---------------------FN_DYNVARS_090_10----------------------#' +SET @@multi_range_count = 100; +SELECT @@multi_range_count = @@local.multi_range_count; +@@multi_range_count = @@local.multi_range_count +1 +SELECT @@local.multi_range_count = @@session.multi_range_count; +@@local.multi_range_count = @@session.multi_range_count +1 +'#---------------------FN_DYNVARS_090_11----------------------#' +SET multi_range_count = 1; +SELECT @@multi_range_count; +@@multi_range_count +1 +SELECT local.multi_range_count; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.multi_range_count; +ERROR 42S02: Unknown table 'session' in field list +SELECT multi_range_count = @@session.multi_range_count; +ERROR 42S22: Unknown column 'multi_range_count' in 'field list' +SET @@global.multi_range_count = @start_global_value; +SELECT @@global.multi_range_count; +@@global.multi_range_count +256 +SET @@session.multi_range_count = @start_session_value; +SELECT @@session.multi_range_count; +@@session.multi_range_count +256 diff --git a/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result b/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result new file mode 100644 index 00000000000..f2115aec2e2 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result @@ -0,0 +1,184 @@ +SET @start_global_value = @@global.multi_range_count; +SELECT @start_global_value; +@start_global_value +256 +SET @start_session_value = @@session.multi_range_count; +SELECT @start_session_value; +@start_session_value +256 +'#--------------------FN_DYNVARS_090_01-------------------------#' +SET @@global.multi_range_count = 100; +SET @@global.multi_range_count = DEFAULT; +SELECT @@global.multi_range_count; +@@global.multi_range_count +256 +SET @@session.multi_range_count = 200; +SET @@session.multi_range_count = DEFAULT; +SELECT @@session.multi_range_count; +@@session.multi_range_count +256 +'#--------------------FN_DYNVARS_090_02-------------------------#' +SET @@global.multi_range_count = DEFAULT; +SELECT @@global.multi_range_count = 256; +@@global.multi_range_count = 256 +1 +SET @@session.multi_range_count = DEFAULT; +SELECT @@session.multi_range_count = 256; +@@session.multi_range_count = 256 +1 +'#--------------------FN_DYNVARS_090_03-------------------------#' +SET @@global.multi_range_count = 1; +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = 60020; +SELECT @@global.multi_range_count; +@@global.multi_range_count +60020 +SET @@global.multi_range_count = 65535; +SELECT @@global.multi_range_count; +@@global.multi_range_count +65535 +SET @@global.multi_range_count = 4294967295; +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967295 +SET @@global.multi_range_count = 4294967294; +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967294 +'#--------------------FN_DYNVARS_090_04-------------------------#' +SET @@session.multi_range_count = 1; +SELECT @@session.multi_range_count; +@@session.multi_range_count +1 +SET @@session.multi_range_count = 50050; +SELECT @@session.multi_range_count; +@@session.multi_range_count +50050 +SET @@session.multi_range_count = 65535; +SELECT @@session.multi_range_count; +@@session.multi_range_count +65535 +SET @@session.multi_range_count = 4294967295; +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967295 +SET @@session.multi_range_count = 4294967294; +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967294 +'#------------------FN_DYNVARS_090_05-----------------------#' +SET @@global.multi_range_count = 0; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = 4294967296; +SELECT @@global.multi_range_count; +@@global.multi_range_count +4294967296 +SET @@global.multi_range_count = -1024; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = 429496729500; +SELECT @@global.multi_range_count; +@@global.multi_range_count +429496729500 +SET @@global.multi_range_count = 65530.34; +ERROR 42000: Incorrect argument type to variable 'multi_range_count' +SELECT @@global.multi_range_count; +@@global.multi_range_count +429496729500 +SET @@global.multi_range_count = test; +ERROR 42000: Incorrect argument type to variable 'multi_range_count' +SELECT @@global.multi_range_count; +@@global.multi_range_count +429496729500 +SET @@session.multi_range_count = 0; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@session.multi_range_count; +@@session.multi_range_count +1 +SET @@session.multi_range_count = 4294967296; +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967296 +SET @@session.multi_range_count = -1; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@session.multi_range_count; +@@session.multi_range_count +1 +SET @@session.multi_range_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.multi_range_count = 4294967295021; +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967295021 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.multi_range_count = test; +ERROR 42000: Incorrect argument type to variable 'multi_range_count' +SELECT @@session.multi_range_count; +@@session.multi_range_count +4294967295021 +'#------------------FN_DYNVARS_090_06-----------------------#' +SELECT @@global.multi_range_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='multi_range_count'; +@@global.multi_range_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_090_07-----------------------#' +SELECT @@session.multi_range_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='multi_range_count'; +@@session.multi_range_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_090_08-----------------------#' +SET @@global.multi_range_count = TRUE; +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +SET @@global.multi_range_count = FALSE; +Warnings: +Warning 1292 Truncated incorrect multi_range_count value: '0' +SELECT @@global.multi_range_count; +@@global.multi_range_count +1 +'#---------------------FN_DYNVARS_090_09----------------------#' +SET @@global.multi_range_count = 10; +SELECT @@multi_range_count = @@global.multi_range_count; +@@multi_range_count = @@global.multi_range_count +0 +'#---------------------FN_DYNVARS_090_10----------------------#' +SET @@multi_range_count = 100; +SELECT @@multi_range_count = @@local.multi_range_count; +@@multi_range_count = @@local.multi_range_count +1 +SELECT @@local.multi_range_count = @@session.multi_range_count; +@@local.multi_range_count = @@session.multi_range_count +1 +'#---------------------FN_DYNVARS_090_11----------------------#' +SET multi_range_count = 1; +SELECT @@multi_range_count; +@@multi_range_count +1 +SELECT local.multi_range_count; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.multi_range_count; +ERROR 42S02: Unknown table 'session' in field list +SELECT multi_range_count = @@session.multi_range_count; +ERROR 42S22: Unknown column 'multi_range_count' in 'field list' +SET @@global.multi_range_count = @start_global_value; +SELECT @@global.multi_range_count; +@@global.multi_range_count +256 +SET @@session.multi_range_count = @start_session_value; +SELECT @@session.multi_range_count; +@@session.multi_range_count +256 diff --git a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result new file mode 100644 index 00000000000..64d1168685c --- /dev/null +++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_32.result @@ -0,0 +1,114 @@ +SET @start_global_value = @@global.myisam_max_sort_file_size; +SELECT @start_global_value; +@start_global_value +2147483647 +'#--------------------FN_DYNVARS_094_01-------------------------#' +SET @@global.myisam_max_sort_file_size = 500000; +SET @@global.myisam_max_sort_file_size = DEFAULT; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +2146435072 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_094_02-------------------------#' +SET @@global.myisam_max_sort_file_size = DEFAULT; +SELECT @@global.myisam_max_sort_file_size = 2147483648; +@@global.myisam_max_sort_file_size = 2147483648 +0 +'#--------------------FN_DYNVARS_094_03-------------------------#' +SET @@global.myisam_max_sort_file_size = 0; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 1024; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 123456789; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +122683392 +SET @@global.myisam_max_sort_file_size = 2147483648*2; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +4294967296 +SET @@global.myisam_max_sort_file_size = 2147483648*1024; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +2199023255552 +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +2199023255552 +SET @@global.myisam_max_sort_file_size = 2147483648*2147483648; +'#--------------------FN_DYNVARS_094_04-------------------------#' +SET @@myisam_max_sort_file_size = 2; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.myisam_max_sort_file_size = 3; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.myisam_max_sort_file_size = 4; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_094_05-----------------------#' +SET @@global.myisam_max_sort_file_size = -1; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = -2147483648; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = -2147483649; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 2147483649.56; +ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 1G; +ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +'#------------------FN_DYNVARS_094_06-----------------------#' +SET @@global.myisam_max_sort_file_size = 3000; +SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_max_sort_file_size'; +@@global.myisam_max_sort_file_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_094_07-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_max_sort_file_size'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_094_08-----------------------#' +SET @@global.myisam_max_sort_file_size = TRUE; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = FALSE; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.myisam_max_sort_file_size = 512; +SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size; +@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET myisam_max_sort_file_size = 2048; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT myisam_max_sort_file_size; +ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list' +SELECT @@myisam_max_sort_file_size; +@@myisam_max_sort_file_size +0 +SET global myisam_max_sort_file_size = 64; +SET @@global.myisam_max_sort_file_size = @start_global_value; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +2146435072 diff --git a/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result new file mode 100644 index 00000000000..00ff1dfc1ab --- /dev/null +++ b/mysql-test/suite/sys_vars/r/myisam_max_sort_file_size_basic_64.result @@ -0,0 +1,114 @@ +SET @start_global_value = @@global.myisam_max_sort_file_size; +SELECT @start_global_value; +@start_global_value +9223372036854775807 +'#--------------------FN_DYNVARS_094_01-------------------------#' +SET @@global.myisam_max_sort_file_size = 500000; +SET @@global.myisam_max_sort_file_size = DEFAULT; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +9223372036853727232 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_094_02-------------------------#' +SET @@global.myisam_max_sort_file_size = DEFAULT; +SELECT @@global.myisam_max_sort_file_size = 2147483648; +@@global.myisam_max_sort_file_size = 2147483648 +0 +'#--------------------FN_DYNVARS_094_03-------------------------#' +SET @@global.myisam_max_sort_file_size = 0; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 1024; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 123456789; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +122683392 +SET @@global.myisam_max_sort_file_size = 2147483648*2; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +4294967296 +SET @@global.myisam_max_sort_file_size = 2147483648*1024; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +2199023255552 +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +2199023255552 +SET @@global.myisam_max_sort_file_size = 2147483648*2147483648; +'#--------------------FN_DYNVARS_094_04-------------------------#' +SET @@myisam_max_sort_file_size = 2; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.myisam_max_sort_file_size = 3; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.myisam_max_sort_file_size = 4; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_094_05-----------------------#' +SET @@global.myisam_max_sort_file_size = -1; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = -2147483648; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = -2147483649; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 2147483649.56; +ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = 1G; +ERROR 42000: Incorrect argument type to variable 'myisam_max_sort_file_size' +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +'#------------------FN_DYNVARS_094_06-----------------------#' +SET @@global.myisam_max_sort_file_size = 3000; +SELECT @@global.myisam_max_sort_file_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_max_sort_file_size'; +@@global.myisam_max_sort_file_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_094_07-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_max_sort_file_size'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_094_08-----------------------#' +SET @@global.myisam_max_sort_file_size = TRUE; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +SET @@global.myisam_max_sort_file_size = FALSE; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +0 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.myisam_max_sort_file_size = 512; +SELECT @@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size; +@@myisam_max_sort_file_size = @@global.myisam_max_sort_file_size +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET myisam_max_sort_file_size = 2048; +ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT myisam_max_sort_file_size; +ERROR 42S22: Unknown column 'myisam_max_sort_file_size' in 'field list' +SELECT @@myisam_max_sort_file_size; +@@myisam_max_sort_file_size +0 +SET global myisam_max_sort_file_size = 64; +SET @@global.myisam_max_sort_file_size = @start_global_value; +SELECT @@global.myisam_max_sort_file_size; +@@global.myisam_max_sort_file_size +9223372036853727232 diff --git a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result new file mode 100644 index 00000000000..c91128e3f4c --- /dev/null +++ b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_32.result @@ -0,0 +1,180 @@ +SET @start_global_value = @@global.myisam_repair_threads; +SELECT @start_global_value; +@start_global_value +1 +SET @start_session_value = @@session.myisam_repair_threads; +SELECT @start_session_value; +@start_session_value +1 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.myisam_repair_threads = 100; +SET @@global.myisam_repair_threads = DEFAULT; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = 200; +SET @@session.myisam_repair_threads = DEFAULT; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.myisam_repair_threads = DEFAULT; +SELECT @@global.myisam_repair_threads = 1; +@@global.myisam_repair_threads = 1 +1 +SET @@session.myisam_repair_threads = DEFAULT; +SELECT @@session.myisam_repair_threads = 1; +@@session.myisam_repair_threads = 1 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.myisam_repair_threads = 1; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = 4294967295; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@global.myisam_repair_threads = 655354; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +655354 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.myisam_repair_threads = 1; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = 4294967295; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +4294967295 +SET @@session.myisam_repair_threads = 655345; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +655345 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.myisam_repair_threads = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = -1024; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = 429496729533; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '429496729533' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@global.myisam_repair_threads = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@global.myisam_repair_threads = test; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@global.myisam_repair_threads = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@global.myisam_repair_threads = 'test'; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@global.myisam_repair_threads = ON; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@session.myisam_repair_threads = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = -2; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = test; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.myisam_repair_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_repair_threads '; +@@global.myisam_repair_threads = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.myisam_repair_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_repair_threads '; +@@session.myisam_repair_threads = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_08-----------------------#' +SET @@global.myisam_repair_threads = TRUE; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = FALSE; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.myisam_repair_threads = 10; +SELECT @@myisam_repair_threads = @@global.myisam_repair_threads ; +@@myisam_repair_threads = @@global.myisam_repair_threads +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@myisam_repair_threads = 100; +SELECT @@myisam_repair_threads = @@local.myisam_repair_threads ; +@@myisam_repair_threads = @@local.myisam_repair_threads +1 +SELECT @@local.myisam_repair_threads = @@session.myisam_repair_threads ; +@@local.myisam_repair_threads = @@session.myisam_repair_threads +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET myisam_repair_threads = 1; +SELECT @@myisam_repair_threads ; +@@myisam_repair_threads +1 +SELECT local.myisam_repair_threads ; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.myisam_repair_threads ; +ERROR 42S02: Unknown table 'session' in field list +SELECT myisam_repair_threads = @@session.myisam_repair_threads ; +ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list' +SET @@global.myisam_repair_threads = @start_global_value; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = @start_session_value; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 diff --git a/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result new file mode 100644 index 00000000000..8271451cc9e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/myisam_repair_threads_basic_64.result @@ -0,0 +1,178 @@ +SET @start_global_value = @@global.myisam_repair_threads; +SELECT @start_global_value; +@start_global_value +1 +SET @start_session_value = @@session.myisam_repair_threads; +SELECT @start_session_value; +@start_session_value +1 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.myisam_repair_threads = 100; +SET @@global.myisam_repair_threads = DEFAULT; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = 200; +SET @@session.myisam_repair_threads = DEFAULT; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.myisam_repair_threads = DEFAULT; +SELECT @@global.myisam_repair_threads = 1; +@@global.myisam_repair_threads = 1 +1 +SET @@session.myisam_repair_threads = DEFAULT; +SELECT @@session.myisam_repair_threads = 1; +@@session.myisam_repair_threads = 1 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.myisam_repair_threads = 1; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = 4294967295; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +4294967295 +SET @@global.myisam_repair_threads = 655354; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +655354 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.myisam_repair_threads = 1; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = 4294967295; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +4294967295 +SET @@session.myisam_repair_threads = 655345; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +655345 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.myisam_repair_threads = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = -1024; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = 429496729533; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +429496729533 +SET @@global.myisam_repair_threads = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +429496729533 +SET @@global.myisam_repair_threads = test; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +429496729533 +SET @@global.myisam_repair_threads = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +429496729533 +SET @@global.myisam_repair_threads = 'test'; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +429496729533 +SET @@global.myisam_repair_threads = ON; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +429496729533 +SET @@session.myisam_repair_threads = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = -2; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = test; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_repair_threads' +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.myisam_repair_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_repair_threads '; +@@global.myisam_repair_threads = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.myisam_repair_threads = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_repair_threads '; +@@session.myisam_repair_threads = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_08-----------------------#' +SET @@global.myisam_repair_threads = TRUE; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@global.myisam_repair_threads = FALSE; +Warnings: +Warning 1292 Truncated incorrect myisam_repair_threads value: '0' +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.myisam_repair_threads = 10; +SELECT @@myisam_repair_threads = @@global.myisam_repair_threads ; +@@myisam_repair_threads = @@global.myisam_repair_threads +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@myisam_repair_threads = 100; +SELECT @@myisam_repair_threads = @@local.myisam_repair_threads ; +@@myisam_repair_threads = @@local.myisam_repair_threads +1 +SELECT @@local.myisam_repair_threads = @@session.myisam_repair_threads ; +@@local.myisam_repair_threads = @@session.myisam_repair_threads +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET myisam_repair_threads = 1; +SELECT @@myisam_repair_threads ; +@@myisam_repair_threads +1 +SELECT local.myisam_repair_threads ; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.myisam_repair_threads ; +ERROR 42S02: Unknown table 'session' in field list +SELECT myisam_repair_threads = @@session.myisam_repair_threads ; +ERROR 42S22: Unknown column 'myisam_repair_threads' in 'field list' +SET @@global.myisam_repair_threads = @start_global_value; +SELECT @@global.myisam_repair_threads ; +@@global.myisam_repair_threads +1 +SET @@session.myisam_repair_threads = @start_session_value; +SELECT @@session.myisam_repair_threads ; +@@session.myisam_repair_threads +1 diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result new file mode 100644 index 00000000000..74d2fb3ec86 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result @@ -0,0 +1,184 @@ +SET @start_global_value = @@global.myisam_sort_buffer_size ; +SELECT @start_global_value; +@start_global_value +8388608 +SET @start_session_value = @@session.myisam_sort_buffer_size ; +SELECT @start_session_value; +@start_session_value +8388608 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.myisam_sort_buffer_size = 100; +SET @@global.myisam_sort_buffer_size = DEFAULT; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +8388608 +SET @@session.myisam_sort_buffer_size = 200; +SET @@session.myisam_sort_buffer_size = DEFAULT; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +8388608 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.myisam_sort_buffer_size = DEFAULT; +SELECT @@global.myisam_sort_buffer_size = 8388608; +@@global.myisam_sort_buffer_size = 8388608 +1 +SET @@session.myisam_sort_buffer_size = DEFAULT; +SELECT @@session.myisam_sort_buffer_size = 8388608; +@@session.myisam_sort_buffer_size = 8388608 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.myisam_sort_buffer_size = 4; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = 4294967295; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@global.myisam_sort_buffer_size = 655354; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +655354 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.myisam_sort_buffer_size = 4; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = 4294967295; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4294967295 +SET @@session.myisam_sort_buffer_size = 655345; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +655345 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.myisam_sort_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = -1024; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = 429496729533; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '429496729533' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@global.myisam_sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@global.myisam_sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@global.myisam_sort_buffer_size = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@global.myisam_sort_buffer_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@global.myisam_sort_buffer_size = ON; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@session.myisam_sort_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = -2; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_sort_buffer_size '; +@@global.myisam_sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_sort_buffer_size '; +@@session.myisam_sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_08-----------------------#' +SET @@global.myisam_sort_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.myisam_sort_buffer_size = 10; +SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; +@@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@myisam_sort_buffer_size = 100; +SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; +@@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size +1 +SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; +@@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET myisam_sort_buffer_size = 1; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' +SELECT @@myisam_sort_buffer_size ; +@@myisam_sort_buffer_size +4 +SELECT local.myisam_sort_buffer_size ; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.myisam_sort_buffer_size ; +ERROR 42S02: Unknown table 'session' in field list +SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; +ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list' +SET @@global.myisam_sort_buffer_size = @start_global_value; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +8388608 +SET @@session.myisam_sort_buffer_size = @start_session_value; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +8388608 diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result new file mode 100644 index 00000000000..bfcada76a46 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_64.result @@ -0,0 +1,182 @@ +SET @start_global_value = @@global.myisam_sort_buffer_size ; +SELECT @start_global_value; +@start_global_value +8388608 +SET @start_session_value = @@session.myisam_sort_buffer_size ; +SELECT @start_session_value; +@start_session_value +8388608 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.myisam_sort_buffer_size = 100; +SET @@global.myisam_sort_buffer_size = DEFAULT; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +8388608 +SET @@session.myisam_sort_buffer_size = 200; +SET @@session.myisam_sort_buffer_size = DEFAULT; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +8388608 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.myisam_sort_buffer_size = DEFAULT; +SELECT @@global.myisam_sort_buffer_size = 8388608; +@@global.myisam_sort_buffer_size = 8388608 +1 +SET @@session.myisam_sort_buffer_size = DEFAULT; +SELECT @@session.myisam_sort_buffer_size = 8388608; +@@session.myisam_sort_buffer_size = 8388608 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.myisam_sort_buffer_size = 4; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = 4294967295; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4294967295 +SET @@global.myisam_sort_buffer_size = 655354; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +655354 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.myisam_sort_buffer_size = 4; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = 4294967295; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4294967295 +SET @@session.myisam_sort_buffer_size = 655345; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +655345 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.myisam_sort_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = -1024; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = 429496729533; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +429496729533 +SET @@global.myisam_sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +429496729533 +SET @@global.myisam_sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +429496729533 +SET @@global.myisam_sort_buffer_size = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +429496729533 +SET @@global.myisam_sort_buffer_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +429496729533 +SET @@global.myisam_sort_buffer_size = ON; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +429496729533 +SET @@session.myisam_sort_buffer_size = 0; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = -2; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +SET @@session.myisam_sort_buffer_size = "test"; +ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +4 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='myisam_sort_buffer_size '; +@@global.myisam_sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.myisam_sort_buffer_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='myisam_sort_buffer_size '; +@@session.myisam_sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_08-----------------------#' +SET @@global.myisam_sort_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +SET @@global.myisam_sort_buffer_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +4 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.myisam_sort_buffer_size = 10; +SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; +@@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@myisam_sort_buffer_size = 100; +SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; +@@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size +1 +SELECT @@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; +@@local.myisam_sort_buffer_size = @@session.myisam_sort_buffer_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET myisam_sort_buffer_size = 1; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' +SELECT @@myisam_sort_buffer_size ; +@@myisam_sort_buffer_size +4 +SELECT local.myisam_sort_buffer_size ; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.myisam_sort_buffer_size ; +ERROR 42S02: Unknown table 'session' in field list +SELECT myisam_sort_buffer_size = @@session.myisam_sort_buffer_size ; +ERROR 42S22: Unknown column 'myisam_sort_buffer_size' in 'field list' +SET @@global.myisam_sort_buffer_size = @start_global_value; +SELECT @@global.myisam_sort_buffer_size ; +@@global.myisam_sort_buffer_size +8388608 +SET @@session.myisam_sort_buffer_size = @start_session_value; +SELECT @@session.myisam_sort_buffer_size ; +@@session.myisam_sort_buffer_size +8388608 diff --git a/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result b/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result new file mode 100644 index 00000000000..3923df539e7 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/net_retry_count_basic_32.result @@ -0,0 +1,192 @@ +SET @start_global_value = @@global.net_retry_count; +SELECT @start_global_value; +@start_global_value +10 +SET @start_session_value = @@session.net_retry_count; +SELECT @start_session_value; +@start_session_value +10 +'#--------------------FN_DYNVARS_111_01-------------------------#' +SET @@global.net_retry_count = 100; +SET @@global.net_retry_count = DEFAULT; +SELECT @@global.net_retry_count; +@@global.net_retry_count +10 +SET @@session.net_retry_count = 200; +SET @@session.net_retry_count = DEFAULT; +SELECT @@session.net_retry_count; +@@session.net_retry_count +10 +'#--------------------FN_DYNVARS_111_02-------------------------#' +SET @@global.net_retry_count = DEFAULT; +SELECT @@global.net_retry_count = 10; +@@global.net_retry_count = 10 +1 +SET @@session.net_retry_count = DEFAULT; +SELECT @@session.net_retry_count = 10; +@@session.net_retry_count = 10 +1 +'#--------------------FN_DYNVARS_111_03-------------------------#' +SET @@global.net_retry_count = 1; +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = 2; +SELECT @@global.net_retry_count; +@@global.net_retry_count +2 +SET @@global.net_retry_count = 4294967295; +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967295 +SET @@global.net_retry_count = 4294967294; +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967294 +SET @@global.net_retry_count = 65536; +SELECT @@global.net_retry_count; +@@global.net_retry_count +65536 +'#--------------------FN_DYNVARS_111_04-------------------------#' +SET @@session.net_retry_count = 1; +SELECT @@session.net_retry_count; +@@session.net_retry_count +1 +SET @@session.net_retry_count = 2; +SELECT @@session.net_retry_count; +@@session.net_retry_count +2 +SET @@session.net_retry_count = 65535; +SELECT @@session.net_retry_count; +@@session.net_retry_count +65535 +SET @@session.net_retry_count = 4294967295; +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967295 +SET @@session.net_retry_count = 4294967294; +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967294 +'#------------------FN_DYNVARS_111_05-----------------------#' +SET @@global.net_retry_count = 0; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = -1024; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = 4294967296; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '4294967296' +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967295 +SET @@global.net_retry_count = 429496729500; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '429496729500' +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967295 +SET @@global.net_retry_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967295 +SET @@global.net_retry_count = test; +ERROR 42000: Incorrect argument type to variable 'net_retry_count' +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967295 +SET @@session.net_retry_count = 0; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@session.net_retry_count; +@@session.net_retry_count +1 +SET @@session.net_retry_count = -2; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@session.net_retry_count; +@@session.net_retry_count +1 +SET @@session.net_retry_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.net_retry_count = 6555015425; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '6555015425' +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967295 +SET @@session.net_retry_count = 4294967296; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '4294967296' +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.net_retry_count = test; +ERROR 42000: Incorrect argument type to variable 'net_retry_count' +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967295 +'#------------------FN_DYNVARS_111_06-----------------------#' +SELECT @@global.net_retry_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='net_retry_count'; +@@global.net_retry_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_111_07-----------------------#' +SELECT @@session.net_retry_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='net_retry_count'; +@@session.net_retry_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_111_08-----------------------#' +SET @@global.net_retry_count = TRUE; +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = FALSE; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +'#---------------------FN_DYNVARS_111_09----------------------#' +SET @@global.net_retry_count = 10; +SELECT @@net_retry_count = @@global.net_retry_count; +@@net_retry_count = @@global.net_retry_count +0 +'#---------------------FN_DYNVARS_111_10----------------------#' +SET @@net_retry_count = 100; +SELECT @@net_retry_count = @@local.net_retry_count; +@@net_retry_count = @@local.net_retry_count +1 +SELECT @@local.net_retry_count = @@session.net_retry_count; +@@local.net_retry_count = @@session.net_retry_count +1 +'#---------------------FN_DYNVARS_111_11----------------------#' +SET net_retry_count = 1; +SELECT @@net_retry_count; +@@net_retry_count +1 +SELECT local.net_retry_count; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.net_retry_count; +ERROR 42S02: Unknown table 'session' in field list +SELECT net_retry_count = @@session.net_retry_count; +ERROR 42S22: Unknown column 'net_retry_count' in 'field list' +SET @@global.net_retry_count = @start_global_value; +SELECT @@global.net_retry_count; +@@global.net_retry_count +10 +SET @@session.net_retry_count = @start_session_value; +SELECT @@session.net_retry_count; +@@session.net_retry_count +10 diff --git a/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result b/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result new file mode 100644 index 00000000000..db133d23f79 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/net_retry_count_basic_64.result @@ -0,0 +1,184 @@ +SET @start_global_value = @@global.net_retry_count; +SELECT @start_global_value; +@start_global_value +10 +SET @start_session_value = @@session.net_retry_count; +SELECT @start_session_value; +@start_session_value +10 +'#--------------------FN_DYNVARS_111_01-------------------------#' +SET @@global.net_retry_count = 100; +SET @@global.net_retry_count = DEFAULT; +SELECT @@global.net_retry_count; +@@global.net_retry_count +10 +SET @@session.net_retry_count = 200; +SET @@session.net_retry_count = DEFAULT; +SELECT @@session.net_retry_count; +@@session.net_retry_count +10 +'#--------------------FN_DYNVARS_111_02-------------------------#' +SET @@global.net_retry_count = DEFAULT; +SELECT @@global.net_retry_count = 10; +@@global.net_retry_count = 10 +1 +SET @@session.net_retry_count = DEFAULT; +SELECT @@session.net_retry_count = 10; +@@session.net_retry_count = 10 +1 +'#--------------------FN_DYNVARS_111_03-------------------------#' +SET @@global.net_retry_count = 1; +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = 2; +SELECT @@global.net_retry_count; +@@global.net_retry_count +2 +SET @@global.net_retry_count = 4294967295; +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967295 +SET @@global.net_retry_count = 4294967294; +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967294 +SET @@global.net_retry_count = 65536; +SELECT @@global.net_retry_count; +@@global.net_retry_count +65536 +'#--------------------FN_DYNVARS_111_04-------------------------#' +SET @@session.net_retry_count = 1; +SELECT @@session.net_retry_count; +@@session.net_retry_count +1 +SET @@session.net_retry_count = 2; +SELECT @@session.net_retry_count; +@@session.net_retry_count +2 +SET @@session.net_retry_count = 65535; +SELECT @@session.net_retry_count; +@@session.net_retry_count +65535 +SET @@session.net_retry_count = 4294967295; +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967295 +SET @@session.net_retry_count = 4294967294; +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967294 +'#------------------FN_DYNVARS_111_05-----------------------#' +SET @@global.net_retry_count = 0; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = -1024; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = 4294967296; +SELECT @@global.net_retry_count; +@@global.net_retry_count +4294967296 +SET @@global.net_retry_count = 429496729500; +SELECT @@global.net_retry_count; +@@global.net_retry_count +429496729500 +SET @@global.net_retry_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.net_retry_count; +@@global.net_retry_count +429496729500 +SET @@global.net_retry_count = test; +ERROR 42000: Incorrect argument type to variable 'net_retry_count' +SELECT @@global.net_retry_count; +@@global.net_retry_count +429496729500 +SET @@session.net_retry_count = 0; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@session.net_retry_count; +@@session.net_retry_count +1 +SET @@session.net_retry_count = -2; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@session.net_retry_count; +@@session.net_retry_count +1 +SET @@session.net_retry_count = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.net_retry_count = 6555015425; +SELECT @@session.net_retry_count; +@@session.net_retry_count +6555015425 +SET @@session.net_retry_count = 4294967296; +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967296 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.net_retry_count = test; +ERROR 42000: Incorrect argument type to variable 'net_retry_count' +SELECT @@session.net_retry_count; +@@session.net_retry_count +4294967296 +'#------------------FN_DYNVARS_111_06-----------------------#' +SELECT @@global.net_retry_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='net_retry_count'; +@@global.net_retry_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_111_07-----------------------#' +SELECT @@session.net_retry_count = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='net_retry_count'; +@@session.net_retry_count = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_111_08-----------------------#' +SET @@global.net_retry_count = TRUE; +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +SET @@global.net_retry_count = FALSE; +Warnings: +Warning 1292 Truncated incorrect net_retry_count value: '0' +SELECT @@global.net_retry_count; +@@global.net_retry_count +1 +'#---------------------FN_DYNVARS_111_09----------------------#' +SET @@global.net_retry_count = 10; +SELECT @@net_retry_count = @@global.net_retry_count; +@@net_retry_count = @@global.net_retry_count +0 +'#---------------------FN_DYNVARS_111_10----------------------#' +SET @@net_retry_count = 100; +SELECT @@net_retry_count = @@local.net_retry_count; +@@net_retry_count = @@local.net_retry_count +1 +SELECT @@local.net_retry_count = @@session.net_retry_count; +@@local.net_retry_count = @@session.net_retry_count +1 +'#---------------------FN_DYNVARS_111_11----------------------#' +SET net_retry_count = 1; +SELECT @@net_retry_count; +@@net_retry_count +1 +SELECT local.net_retry_count; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.net_retry_count; +ERROR 42S02: Unknown table 'session' in field list +SELECT net_retry_count = @@session.net_retry_count; +ERROR 42S22: Unknown column 'net_retry_count' in 'field list' +SET @@global.net_retry_count = @start_global_value; +SELECT @@global.net_retry_count; +@@global.net_retry_count +10 +SET @@session.net_retry_count = @start_session_value; +SELECT @@session.net_retry_count; +@@session.net_retry_count +10 diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result new file mode 100644 index 00000000000..3b7f06c8f81 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_32.result @@ -0,0 +1,203 @@ +SET @start_global_value = @@global.query_alloc_block_size; +SELECT @start_global_value; +@start_global_value +8192 +SET @start_session_value = @@session.query_alloc_block_size; +SELECT @start_session_value; +@start_session_value +8192 +'#--------------------FN_DYNVARS_130_01-------------------------#' +SET @@global.query_alloc_block_size = 10000; +SET @@global.query_alloc_block_size = DEFAULT; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +8192 +SET @@session.query_alloc_block_size = 20000; +SET @@session.query_alloc_block_size = DEFAULT; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +8192 +'#--------------------FN_DYNVARS_130_02-------------------------#' +SET @@global.query_alloc_block_size = DEFAULT; +SELECT @@global.query_alloc_block_size = 8192; +@@global.query_alloc_block_size = 8192 +1 +SET @@session.query_alloc_block_size = DEFAULT; +SELECT @@session.query_alloc_block_size = 8192; +@@session.query_alloc_block_size = 8192 +1 +'#--------------------FN_DYNVARS_130_03-------------------------#' +SET @@global.query_alloc_block_size = 1024; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 1025; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 4294967295; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294966272 +SET @@global.query_alloc_block_size = 4294967294; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294966272 +SET @@global.query_alloc_block_size = 65536; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +65536 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_130_04-------------------------#' +SET @@session.query_alloc_block_size = 1024; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 1025; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 4294967295; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294966272 +SET @@session.query_alloc_block_size = 4294967294; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294966272 +SET @@session.query_alloc_block_size = 655536; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +655360 +'#------------------FN_DYNVARS_130_05-----------------------#' +SET @@global.query_alloc_block_size = 64; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '64' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = -1; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '0' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 1023; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 4294967296; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967296' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294966272 +SET @@global.query_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294966272 +SET @@global.query_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294966272 +SET @@session.query_alloc_block_size = 64; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '64' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = -2; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '0' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.query_alloc_block_size = 1023; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 4294967296; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '4294967296' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294966272 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.query_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294966272 +'#------------------FN_DYNVARS_130_06-----------------------#' +'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement'; +SET @@global.query_alloc_block_size = 1; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1' +SET @@session.query_alloc_block_size = 12; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '12' +SELECT @@global.query_alloc_block_size = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_alloc_block_size'; +@@global.query_alloc_block_size = +VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_130_07-----------------------#' +SELECT @@session.query_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_alloc_block_size'; +@@session.query_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_130_08-----------------------#' +SET @@global.query_alloc_block_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '0' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +'#---------------------FN_DYNVARS_130_09----------------------#' +SET @@global.query_alloc_block_size = 2048; +SELECT @@query_alloc_block_size = @@global.query_alloc_block_size; +@@query_alloc_block_size = @@global.query_alloc_block_size +0 +'#---------------------FN_DYNVARS_130_10----------------------#' +SET @@query_alloc_block_size = 5000; +SELECT @@query_alloc_block_size = @@local.query_alloc_block_size; +@@query_alloc_block_size = @@local.query_alloc_block_size +1 +SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size; +@@local.query_alloc_block_size = @@session.query_alloc_block_size +1 +'#---------------------FN_DYNVARS_130_11----------------------#' +SET query_alloc_block_size = 1024; +SELECT @@query_alloc_block_size; +@@query_alloc_block_size +1024 +SELECT local.query_alloc_block_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.query_alloc_block_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT query_alloc_block_size = @@session.query_alloc_block_size; +ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list' +SET @@global.query_alloc_block_size = @start_global_value; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +8192 +SET @@session.query_alloc_block_size = @start_session_value; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +8192 diff --git a/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result new file mode 100644 index 00000000000..57c96a8168a --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_alloc_block_size_basic_64.result @@ -0,0 +1,199 @@ +SET @start_global_value = @@global.query_alloc_block_size; +SELECT @start_global_value; +@start_global_value +8192 +SET @start_session_value = @@session.query_alloc_block_size; +SELECT @start_session_value; +@start_session_value +8192 +'#--------------------FN_DYNVARS_130_01-------------------------#' +SET @@global.query_alloc_block_size = 10000; +SET @@global.query_alloc_block_size = DEFAULT; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +8192 +SET @@session.query_alloc_block_size = 20000; +SET @@session.query_alloc_block_size = DEFAULT; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +8192 +'#--------------------FN_DYNVARS_130_02-------------------------#' +SET @@global.query_alloc_block_size = DEFAULT; +SELECT @@global.query_alloc_block_size = 8192; +@@global.query_alloc_block_size = 8192 +1 +SET @@session.query_alloc_block_size = DEFAULT; +SELECT @@session.query_alloc_block_size = 8192; +@@session.query_alloc_block_size = 8192 +1 +'#--------------------FN_DYNVARS_130_03-------------------------#' +SET @@global.query_alloc_block_size = 1024; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 1025; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 4294967295; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294966272 +SET @@global.query_alloc_block_size = 4294967294; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294966272 +SET @@global.query_alloc_block_size = 65536; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +65536 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_130_04-------------------------#' +SET @@session.query_alloc_block_size = 1024; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 1025; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 4294967295; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294966272 +SET @@session.query_alloc_block_size = 4294967294; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294966272 +SET @@session.query_alloc_block_size = 655536; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +655360 +'#------------------FN_DYNVARS_130_05-----------------------#' +SET @@global.query_alloc_block_size = 64; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '64' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = -1; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '0' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 1023; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = 4294967296; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294967296 +SET @@global.query_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294967296 +SET @@global.query_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +4294967296 +SET @@session.query_alloc_block_size = 64; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '64' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = -2; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '0' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.query_alloc_block_size = 1023; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1023' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +1024 +SET @@session.query_alloc_block_size = 4294967296; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294967296 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.query_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'query_alloc_block_size' +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +4294967296 +'#------------------FN_DYNVARS_130_06-----------------------#' +'Bug# 34877: OutOFMemeory errors are coming if we dont assign these values to variable before comparision statement'; +SET @@global.query_alloc_block_size = 1; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1' +SET @@session.query_alloc_block_size = 12; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '12' +SELECT @@global.query_alloc_block_size = +VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_alloc_block_size'; +@@global.query_alloc_block_size = +VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_130_07-----------------------#' +SELECT @@session.query_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_alloc_block_size'; +@@session.query_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_130_08-----------------------#' +SET @@global.query_alloc_block_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '1' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +SET @@global.query_alloc_block_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect query_alloc_block_size value: '0' +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +1024 +'#---------------------FN_DYNVARS_130_09----------------------#' +SET @@global.query_alloc_block_size = 2048; +SELECT @@query_alloc_block_size = @@global.query_alloc_block_size; +@@query_alloc_block_size = @@global.query_alloc_block_size +0 +'#---------------------FN_DYNVARS_130_10----------------------#' +SET @@query_alloc_block_size = 5000; +SELECT @@query_alloc_block_size = @@local.query_alloc_block_size; +@@query_alloc_block_size = @@local.query_alloc_block_size +1 +SELECT @@local.query_alloc_block_size = @@session.query_alloc_block_size; +@@local.query_alloc_block_size = @@session.query_alloc_block_size +1 +'#---------------------FN_DYNVARS_130_11----------------------#' +SET query_alloc_block_size = 1024; +SELECT @@query_alloc_block_size; +@@query_alloc_block_size +1024 +SELECT local.query_alloc_block_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.query_alloc_block_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT query_alloc_block_size = @@session.query_alloc_block_size; +ERROR 42S22: Unknown column 'query_alloc_block_size' in 'field list' +SET @@global.query_alloc_block_size = @start_global_value; +SELECT @@global.query_alloc_block_size; +@@global.query_alloc_block_size +8192 +SET @@session.query_alloc_block_size = @start_session_value; +SELECT @@session.query_alloc_block_size; +@@session.query_alloc_block_size +8192 diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result new file mode 100644 index 00000000000..bb66233732d --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_32.result @@ -0,0 +1,126 @@ +SET @start_value = @@global.query_cache_limit; +SELECT @start_value; +@start_value +1048576 +'#--------------------FN_DYNVARS_131_01------------------------#' +SET @@global.query_cache_limit = 99; +SET @@global.query_cache_limit = DEFAULT; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048576 +'#---------------------FN_DYNVARS_131_02-------------------------#' +SET @@global.query_cache_limit = @start_value; +SELECT @@global.query_cache_limit = 1048576; +@@global.query_cache_limit = 1048576 +1 +'#--------------------FN_DYNVARS_131_03------------------------#' +SET @@global.query_cache_limit = 0; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +SET @@global.query_cache_limit = 1; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1 +SET @@global.query_cache_limit = 1048576; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048576 +SET @@global.query_cache_limit = 1048575; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048575 +'#--------------------FN_DYNVARS_131_04-------------------------#' +SET @@global.query_cache_limit = -1; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +SET @@global.query_cache_limit = 4294967296; +Warnings: +Warning 1292 Truncated incorrect query_cache_limit value: '4294967296' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +4294967295 +SET @@global.query_cache_limit = 10240022115; +Warnings: +Warning 1292 Truncated incorrect query_cache_limit value: '10240022115' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +4294967295 +SET @@global.query_cache_limit = 10000.01; +ERROR 42000: Incorrect argument type to variable 'query_cache_limit' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +4294967295 +SET @@global.query_cache_limit = -1024; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +SET @@global.query_cache_limit = 42949672950; +Warnings: +Warning 1292 Truncated incorrect query_cache_limit value: '42949672950' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.query_cache_limit = ON; +ERROR 42000: Incorrect argument type to variable 'query_cache_limit' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +4294967295 +SET @@global.query_cache_limit = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_cache_limit' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +4294967295 +'#-------------------FN_DYNVARS_131_05----------------------------#' +SET @@session.query_cache_limit = 0; +ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_limit; +@@query_cache_limit +4294967295 +'#----------------------FN_DYNVARS_131_06------------------------#' +SELECT @@global.query_cache_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_limit'; +@@global.query_cache_limit = VARIABLE_VALUE +1 +SELECT @@query_cache_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_limit'; +@@query_cache_limit = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_131_07----------------------#' +SET @@global.query_cache_limit = TRUE; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1 +SET @@global.query_cache_limit = FALSE; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +'#---------------------FN_DYNVARS_131_08----------------------#' +SET @@global.query_cache_limit = 1; +SELECT @@query_cache_limit = @@global.query_cache_limit; +@@query_cache_limit = @@global.query_cache_limit +1 +'#---------------------FN_DYNVARS_131_09----------------------#' +SET query_cache_limit = 1; +ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_limit; +@@query_cache_limit +1 +SET local.query_cache_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 +SELECT local.query_cache_limit; +ERROR 42S02: Unknown table 'local' in field list +SET global.query_cache_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 +SELECT global.query_cache_limit; +ERROR 42S02: Unknown table 'global' in field list +SELECT query_cache_limit = @@session.query_cache_limit; +ERROR 42S22: Unknown column 'query_cache_limit' in 'field list' +SET @@global.query_cache_limit = @start_value; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048576 diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result new file mode 100644 index 00000000000..a592883ef91 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_cache_limit_basic_64.result @@ -0,0 +1,120 @@ +SET @start_value = @@global.query_cache_limit; +SELECT @start_value; +@start_value +1048576 +'#--------------------FN_DYNVARS_131_01------------------------#' +SET @@global.query_cache_limit = 99; +SET @@global.query_cache_limit = DEFAULT; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048576 +'#---------------------FN_DYNVARS_131_02-------------------------#' +SET @@global.query_cache_limit = @start_value; +SELECT @@global.query_cache_limit = 1048576; +@@global.query_cache_limit = 1048576 +1 +'#--------------------FN_DYNVARS_131_03------------------------#' +SET @@global.query_cache_limit = 0; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +SET @@global.query_cache_limit = 1; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1 +SET @@global.query_cache_limit = 1048576; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048576 +SET @@global.query_cache_limit = 1048575; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048575 +'#--------------------FN_DYNVARS_131_04-------------------------#' +SET @@global.query_cache_limit = -1; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +SET @@global.query_cache_limit = 4294967296; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +4294967296 +SET @@global.query_cache_limit = 10240022115; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +10240022115 +SET @@global.query_cache_limit = 10000.01; +ERROR 42000: Incorrect argument type to variable 'query_cache_limit' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +10240022115 +SET @@global.query_cache_limit = -1024; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +SET @@global.query_cache_limit = 42949672950; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +42949672950 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.query_cache_limit = ON; +ERROR 42000: Incorrect argument type to variable 'query_cache_limit' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +42949672950 +SET @@global.query_cache_limit = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_cache_limit' +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +42949672950 +'#-------------------FN_DYNVARS_131_05----------------------------#' +SET @@session.query_cache_limit = 0; +ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_limit; +@@query_cache_limit +42949672950 +'#----------------------FN_DYNVARS_131_06------------------------#' +SELECT @@global.query_cache_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_limit'; +@@global.query_cache_limit = VARIABLE_VALUE +1 +SELECT @@query_cache_limit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_limit'; +@@query_cache_limit = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_131_07----------------------#' +SET @@global.query_cache_limit = TRUE; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1 +SET @@global.query_cache_limit = FALSE; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +0 +'#---------------------FN_DYNVARS_131_08----------------------#' +SET @@global.query_cache_limit = 1; +SELECT @@query_cache_limit = @@global.query_cache_limit; +@@query_cache_limit = @@global.query_cache_limit +1 +'#---------------------FN_DYNVARS_131_09----------------------#' +SET query_cache_limit = 1; +ERROR HY000: Variable 'query_cache_limit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_limit; +@@query_cache_limit +1 +SET local.query_cache_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 +SELECT local.query_cache_limit; +ERROR 42S02: Unknown table 'local' in field list +SET global.query_cache_limit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_limit = 1' at line 1 +SELECT global.query_cache_limit; +ERROR 42S02: Unknown table 'global' in field list +SELECT query_cache_limit = @@session.query_cache_limit; +ERROR 42S22: Unknown column 'query_cache_limit' in 'field list' +SET @@global.query_cache_limit = @start_value; +SELECT @@global.query_cache_limit; +@@global.query_cache_limit +1048576 diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result new file mode 100644 index 00000000000..e0d8a0d2a30 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_32.result @@ -0,0 +1,134 @@ +SET @start_value = @@global.query_cache_min_res_unit; +SELECT @start_value; +@start_value +4096 +'#--------------------FN_DYNVARS_132_01------------------------#' +SET @@global.query_cache_min_res_unit = 99; +SET @@global.query_cache_min_res_unit = DEFAULT; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +4096 +'#---------------------FN_DYNVARS_132_02-------------------------#' +SET @@global.query_cache_min_res_unit = @start_value; +SELECT @@global.query_cache_min_res_unit = 4096; +@@global.query_cache_min_res_unit = 4096 +1 +'#--------------------FN_DYNVARS_132_03------------------------#' +SET @@global.query_cache_min_res_unit = 0; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 1; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512'; +SET @@global.query_cache_min_res_unit = 512; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 513; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +520 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.query_cache_min_res_unit = 1048576; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +1048576 +SET @@global.query_cache_min_res_unit = 1048575; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +1048576 +'#--------------------FN_DYNVARS_132_04-------------------------#' +SET @@global.query_cache_min_res_unit = -1; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 4294967296; +Warnings: +Warning 1292 Truncated incorrect query_cache_min_res_unit value: '4294967296' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +0 +SET @@global.query_cache_min_res_unit = 511; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 10000.01; +ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = -1024; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 42949672950; +Warnings: +Warning 1292 Truncated incorrect query_cache_min_res_unit value: '42949672950' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +0 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.query_cache_min_res_unit = ON; +ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +0 +SET @@global.query_cache_min_res_unit = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +0 +'#-------------------FN_DYNVARS_132_05----------------------------#' +SET @@session.query_cache_min_res_unit = 0; +ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_min_res_unit; +@@query_cache_min_res_unit +0 +'#----------------------FN_DYNVARS_132_06------------------------#' +SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_min_res_unit'; +@@global.query_cache_min_res_unit = VARIABLE_VALUE +1 +SELECT @@query_cache_min_res_unit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_min_res_unit'; +@@query_cache_min_res_unit = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_132_07----------------------#' +SET @@global.query_cache_min_res_unit = TRUE; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = FALSE; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +'#---------------------FN_DYNVARS_132_08----------------------#' +SET @@global.query_cache_min_res_unit = 1; +SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit; +@@query_cache_min_res_unit = @@global.query_cache_min_res_unit +1 +'#---------------------FN_DYNVARS_132_09----------------------#' +SET query_cache_min_res_unit = 1; +ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_min_res_unit; +@@query_cache_min_res_unit +512 +SET local.query_cache_min_res_unit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 +SELECT local.query_cache_min_res_unit; +ERROR 42S02: Unknown table 'local' in field list +SET global.query_cache_min_res_unit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 +SELECT global.query_cache_min_res_unit; +ERROR 42S02: Unknown table 'global' in field list +SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit; +ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list' +SET @@global.query_cache_min_res_unit = @start_value; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +4096 diff --git a/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result new file mode 100644 index 00000000000..e1c74d2bbc1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_cache_min_res_unit_basic_64.result @@ -0,0 +1,130 @@ +SET @start_value = @@global.query_cache_min_res_unit; +SELECT @start_value; +@start_value +4096 +'#--------------------FN_DYNVARS_132_01------------------------#' +SET @@global.query_cache_min_res_unit = 99; +SET @@global.query_cache_min_res_unit = DEFAULT; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +4096 +'#---------------------FN_DYNVARS_132_02-------------------------#' +SET @@global.query_cache_min_res_unit = @start_value; +SELECT @@global.query_cache_min_res_unit = 4096; +@@global.query_cache_min_res_unit = 4096 +1 +'#--------------------FN_DYNVARS_132_03------------------------#' +SET @@global.query_cache_min_res_unit = 0; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 1; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +'Bug#34842: FN_DYNVARS_132_03 - Minimum value according to documentation is 0, and here it is 512'; +SET @@global.query_cache_min_res_unit = 512; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 513; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +520 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.query_cache_min_res_unit = 1048576; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +1048576 +SET @@global.query_cache_min_res_unit = 1048575; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +1048576 +'#--------------------FN_DYNVARS_132_04-------------------------#' +SET @@global.query_cache_min_res_unit = -1; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 4294967296; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +4294967296 +SET @@global.query_cache_min_res_unit = 511; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 10000.01; +ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = -1024; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = 42949672950; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +42949672952 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.query_cache_min_res_unit = ON; +ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +42949672952 +SET @@global.query_cache_min_res_unit = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_cache_min_res_unit' +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +42949672952 +'#-------------------FN_DYNVARS_132_05----------------------------#' +SET @@session.query_cache_min_res_unit = 0; +ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_min_res_unit; +@@query_cache_min_res_unit +42949672952 +'#----------------------FN_DYNVARS_132_06------------------------#' +SELECT @@global.query_cache_min_res_unit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_min_res_unit'; +@@global.query_cache_min_res_unit = VARIABLE_VALUE +1 +SELECT @@query_cache_min_res_unit = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_min_res_unit'; +@@query_cache_min_res_unit = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_132_07----------------------#' +SET @@global.query_cache_min_res_unit = TRUE; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +SET @@global.query_cache_min_res_unit = FALSE; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +512 +'#---------------------FN_DYNVARS_132_08----------------------#' +SET @@global.query_cache_min_res_unit = 1; +SELECT @@query_cache_min_res_unit = @@global.query_cache_min_res_unit; +@@query_cache_min_res_unit = @@global.query_cache_min_res_unit +1 +'#---------------------FN_DYNVARS_132_09----------------------#' +SET query_cache_min_res_unit = 1; +ERROR HY000: Variable 'query_cache_min_res_unit' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_min_res_unit; +@@query_cache_min_res_unit +512 +SET local.query_cache_min_res_unit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 +SELECT local.query_cache_min_res_unit; +ERROR 42S02: Unknown table 'local' in field list +SET global.query_cache_min_res_unit = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_min_res_unit = 1' at line 1 +SELECT global.query_cache_min_res_unit; +ERROR 42S02: Unknown table 'global' in field list +SELECT query_cache_min_res_unit = @@session.query_cache_min_res_unit; +ERROR 42S22: Unknown column 'query_cache_min_res_unit' in 'field list' +SET @@global.query_cache_min_res_unit = @start_value; +SELECT @@global.query_cache_min_res_unit; +@@global.query_cache_min_res_unit +4096 diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result new file mode 100644 index 00000000000..1af70b3af84 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic_32.result @@ -0,0 +1,138 @@ +SET @start_value = @@global.query_cache_size; +SELECT @start_value; +@start_value +0 +'#--------------------FN_DYNVARS_133_01------------------------#' +SET @@global.query_cache_size = 99; +SET @@global.query_cache_size = DEFAULT; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'#---------------------FN_DYNVARS_133_02-------------------------#' +SET @@global.query_cache_size = @start_value; +SELECT @@global.query_cache_size = 0; +@@global.query_cache_size = 0 +1 +'#--------------------FN_DYNVARS_133_03------------------------#' +SET @@global.query_cache_size = 0; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 1; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 512; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 1024; +Warnings: +Warning 1282 Query cache failed to set size 1024; new query cache size is 0 +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +: 'Bug#34880: Warnings are coming on assinging valid values to variable +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.query_cache_size = 1048576; +SELECT @@global.query_cache_size; +@@global.query_cache_size +1048576 +SET @@global.query_cache_size = 1048575; +SELECT @@global.query_cache_size; +@@global.query_cache_size +1047552 +'#--------------------FN_DYNVARS_133_04-------------------------#' +SET @@global.query_cache_size = -1; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 4294967296; +Warnings: +Warning 1292 Truncated incorrect query_cache_size value: '4294967296' +Warning 1282 Query cache failed to set size 4294966272; new query cache size is 0 +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 511; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'query_cache_size' +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = -1024; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect query_cache_size value: '42949672950' +Warning 1282 Query cache failed to set size 4294966272; new query cache size is 0 +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.query_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'query_cache_size' +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_cache_size' +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'#-------------------FN_DYNVARS_133_05----------------------------#' +SET @@session.query_cache_size = 0; +ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_size; +@@query_cache_size +0 +'#----------------------FN_DYNVARS_133_06------------------------#' +SELECT @@global.query_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_size'; +@@global.query_cache_size = VARIABLE_VALUE +1 +SELECT @@query_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_size'; +@@query_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_133_07----------------------#' +SET @@global.query_cache_size = TRUE; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = FALSE; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'#---------------------FN_DYNVARS_133_08----------------------#' +SET @@global.query_cache_size = 1; +SELECT @@query_cache_size = @@global.query_cache_size; +@@query_cache_size = @@global.query_cache_size +1 +'#---------------------FN_DYNVARS_133_09----------------------#' +SET query_cache_size = 1; +ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_size; +@@query_cache_size +0 +SET local.query_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 +SELECT local.query_cache_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.query_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 +SELECT global.query_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT query_cache_size = @@session.query_cache_size; +ERROR 42S22: Unknown column 'query_cache_size' in 'field list' +SET @@global.query_cache_size = @start_value; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result new file mode 100644 index 00000000000..0d67eec1ccc --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic_64.result @@ -0,0 +1,134 @@ +SET @start_value = @@global.query_cache_size; +SELECT @start_value; +@start_value +0 +'#--------------------FN_DYNVARS_133_01------------------------#' +SET @@global.query_cache_size = 99; +SET @@global.query_cache_size = DEFAULT; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'#---------------------FN_DYNVARS_133_02-------------------------#' +SET @@global.query_cache_size = @start_value; +SELECT @@global.query_cache_size = 0; +@@global.query_cache_size = 0 +1 +'#--------------------FN_DYNVARS_133_03------------------------#' +SET @@global.query_cache_size = 0; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 1; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 512; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 1024; +Warnings: +Warning 1282 Query cache failed to set size 1024; new query cache size is 0 +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +: 'Bug#34880: Warnings are coming on assinging valid values to variable +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.query_cache_size = 1048576; +SELECT @@global.query_cache_size; +@@global.query_cache_size +1048576 +SET @@global.query_cache_size = 1048575; +SELECT @@global.query_cache_size; +@@global.query_cache_size +1047552 +'#--------------------FN_DYNVARS_133_04-------------------------#' +SET @@global.query_cache_size = -1; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 4294967296; +SELECT @@global.query_cache_size; +@@global.query_cache_size +4294967296 +SET @@global.query_cache_size = 511; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'query_cache_size' +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = -1024; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 42949672950; +Warnings: +Warning 1282 Query cache failed to set size 42949671936; new query cache size is 0 +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.query_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'query_cache_size' +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_cache_size' +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'#-------------------FN_DYNVARS_133_05----------------------------#' +SET @@session.query_cache_size = 0; +ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_size; +@@query_cache_size +0 +'#----------------------FN_DYNVARS_133_06------------------------#' +SELECT @@global.query_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_cache_size'; +@@global.query_cache_size = VARIABLE_VALUE +1 +SELECT @@query_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_cache_size'; +@@query_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_133_07----------------------#' +SET @@global.query_cache_size = TRUE; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +SET @@global.query_cache_size = FALSE; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 +'#---------------------FN_DYNVARS_133_08----------------------#' +SET @@global.query_cache_size = 1; +SELECT @@query_cache_size = @@global.query_cache_size; +@@query_cache_size = @@global.query_cache_size +1 +'#---------------------FN_DYNVARS_133_09----------------------#' +SET query_cache_size = 1; +ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@query_cache_size; +@@query_cache_size +0 +SET local.query_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 +SELECT local.query_cache_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.query_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_cache_size = 1' at line 1 +SELECT global.query_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT query_cache_size = @@session.query_cache_size; +ERROR 42S22: Unknown column 'query_cache_size' in 'field list' +SET @@global.query_cache_size = @start_value; +SELECT @@global.query_cache_size; +@@global.query_cache_size +0 diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result new file mode 100644 index 00000000000..cd5f1727d41 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_32.result @@ -0,0 +1,192 @@ +SET @start_global_value = @@global.query_prealloc_size ; +SELECT @start_global_value; +@start_global_value +8192 +SET @start_session_value = @@session.query_prealloc_size ; +SELECT @start_session_value; +@start_session_value +8192 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.query_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '100' +SET @@global.query_prealloc_size = DEFAULT; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@session.query_prealloc_size = 200; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '200' +SET @@session.query_prealloc_size = DEFAULT; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.query_prealloc_size = DEFAULT; +SELECT @@global.query_prealloc_size = 8192; +@@global.query_prealloc_size = 8192 +1 +SET @@session.query_prealloc_size = DEFAULT; +SELECT @@session.query_prealloc_size = 8192; +@@session.query_prealloc_size = 8192 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.query_prealloc_size = 8192; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = 4294967295; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@global.query_prealloc_size = 655354; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +654336 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.query_prealloc_size = 8192; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = 4294967295; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +4294966272 +SET @@session.query_prealloc_size = 655345; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +654336 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.query_prealloc_size = 0; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = -1024; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = 429496729533; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '429496729533' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@global.query_prealloc_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@global.query_prealloc_size = test; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@global.query_prealloc_size = "test"; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@global.query_prealloc_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@global.query_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@session.query_prealloc_size = 0; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = -2; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = test; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = "test"; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_prealloc_size '; +@@global.query_prealloc_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_prealloc_size '; +@@session.query_prealloc_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_08-----------------------#' +SET @@global.query_prealloc_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '1' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.query_prealloc_size = 10; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '10' +SELECT @@query_prealloc_size = @@global.query_prealloc_size ; +@@query_prealloc_size = @@global.query_prealloc_size +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@query_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '100' +SELECT @@query_prealloc_size = @@local.query_prealloc_size ; +@@query_prealloc_size = @@local.query_prealloc_size +1 +SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ; +@@local.query_prealloc_size = @@session.query_prealloc_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET query_prealloc_size = 1; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '1' +SELECT @@query_prealloc_size ; +@@query_prealloc_size +8192 +SELECT local.query_prealloc_size ; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.query_prealloc_size ; +ERROR 42S02: Unknown table 'session' in field list +SELECT query_prealloc_size = @@session.query_prealloc_size ; +ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list' +SET @@global.query_prealloc_size = @start_global_value; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@session.query_prealloc_size = @start_session_value; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result new file mode 100644 index 00000000000..0e61fbcd4b5 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_basic_64.result @@ -0,0 +1,190 @@ +SET @start_global_value = @@global.query_prealloc_size ; +SELECT @start_global_value; +@start_global_value +8192 +SET @start_session_value = @@session.query_prealloc_size ; +SELECT @start_session_value; +@start_session_value +8192 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.query_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '100' +SET @@global.query_prealloc_size = DEFAULT; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@session.query_prealloc_size = 200; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '200' +SET @@session.query_prealloc_size = DEFAULT; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.query_prealloc_size = DEFAULT; +SELECT @@global.query_prealloc_size = 8192; +@@global.query_prealloc_size = 8192 +1 +SET @@session.query_prealloc_size = DEFAULT; +SELECT @@session.query_prealloc_size = 8192; +@@session.query_prealloc_size = 8192 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.query_prealloc_size = 8192; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = 4294967295; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +4294966272 +SET @@global.query_prealloc_size = 655354; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +654336 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.query_prealloc_size = 8192; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = 4294967295; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +4294966272 +SET @@session.query_prealloc_size = 655345; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +654336 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.query_prealloc_size = 0; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = -1024; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = 429496729533; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +429496728576 +SET @@global.query_prealloc_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +429496728576 +SET @@global.query_prealloc_size = test; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +429496728576 +SET @@global.query_prealloc_size = "test"; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +429496728576 +SET @@global.query_prealloc_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +429496728576 +SET @@global.query_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +429496728576 +SET @@session.query_prealloc_size = 0; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = -2; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = test; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +SET @@session.query_prealloc_size = "test"; +ERROR 42000: Incorrect argument type to variable 'query_prealloc_size' +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='query_prealloc_size '; +@@global.query_prealloc_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.query_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='query_prealloc_size '; +@@session.query_prealloc_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_08-----------------------#' +SET @@global.query_prealloc_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '1' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@global.query_prealloc_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '0' +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.query_prealloc_size = 10; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '10' +SELECT @@query_prealloc_size = @@global.query_prealloc_size ; +@@query_prealloc_size = @@global.query_prealloc_size +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@query_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '100' +SELECT @@query_prealloc_size = @@local.query_prealloc_size ; +@@query_prealloc_size = @@local.query_prealloc_size +1 +SELECT @@local.query_prealloc_size = @@session.query_prealloc_size ; +@@local.query_prealloc_size = @@session.query_prealloc_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET query_prealloc_size = 1; +Warnings: +Warning 1292 Truncated incorrect query_prealloc_size value: '1' +SELECT @@query_prealloc_size ; +@@query_prealloc_size +8192 +SELECT local.query_prealloc_size ; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.query_prealloc_size ; +ERROR 42S02: Unknown table 'session' in field list +SELECT query_prealloc_size = @@session.query_prealloc_size ; +ERROR 42S22: Unknown column 'query_prealloc_size' in 'field list' +SET @@global.query_prealloc_size = @start_global_value; +SELECT @@global.query_prealloc_size ; +@@global.query_prealloc_size +8192 +SET @@session.query_prealloc_size = @start_session_value; +SELECT @@session.query_prealloc_size ; +@@session.query_prealloc_size +8192 diff --git a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result new file mode 100644 index 00000000000..93441448d90 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_32.result @@ -0,0 +1,182 @@ +SET @start_global_value = @@global.range_alloc_block_size; +SELECT @start_global_value; +@start_global_value +4096 +SET @start_session_value = @@session.range_alloc_block_size; +SELECT @start_session_value; +@start_session_value +4096 +'#--------------------FN_DYNVARS_137_01-------------------------#' +SET @@global.range_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '100' +SET @@global.range_alloc_block_size = DEFAULT; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = 200; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '200' +SET @@session.range_alloc_block_size = DEFAULT; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +'#--------------------FN_DYNVARS_137_02-------------------------#' +SET @@global.range_alloc_block_size = DEFAULT; +SELECT @@global.range_alloc_block_size = 2048; +@@global.range_alloc_block_size = 2048 +0 +SET @@session.range_alloc_block_size = DEFAULT; +SELECT @@session.range_alloc_block_size = 2048; +@@session.range_alloc_block_size = 2048 +0 +'#--------------------FN_DYNVARS_137_03-------------------------#' +SET @@global.range_alloc_block_size = 2048; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.range_alloc_block_size = 4294967295; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4294966272 +SET @@global.range_alloc_block_size = 4294967294; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_137_04-------------------------#' +SET @@session.range_alloc_block_size = 2048; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = 4294967295; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294966272 +SET @@session.range_alloc_block_size = 4294967294; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294966272 +'#------------------FN_DYNVARS_137_05-----------------------#' +SET @@global.range_alloc_block_size = 0; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@global.range_alloc_block_size = -1024; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@global.range_alloc_block_size = 42949672951; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '42949672951' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4294966272 +SET @@global.range_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4294966272 +SET @@global.range_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4294966272 +SET @@session.range_alloc_block_size = 0; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = -2; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.range_alloc_block_size = 4294967296; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '4294967296' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294966272 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.range_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294966272 +'#------------------FN_DYNVARS_137_06-----------------------#' +SELECT @@global.range_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='range_alloc_block_size'; +@@global.range_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_137_07-----------------------#' +SELECT @@session.range_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='range_alloc_block_size'; +@@session.range_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_137_08-----------------------#' +SET @@global.range_alloc_block_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '1' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@global.range_alloc_block_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +'#---------------------FN_DYNVARS_137_09----------------------#' +SET @@global.range_alloc_block_size = 10; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '10' +SELECT @@range_alloc_block_size = @@global.range_alloc_block_size; +@@range_alloc_block_size = @@global.range_alloc_block_size +0 +'#---------------------FN_DYNVARS_137_10----------------------#' +SET @@range_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '100' +SELECT @@range_alloc_block_size = @@local.range_alloc_block_size; +@@range_alloc_block_size = @@local.range_alloc_block_size +1 +SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size; +@@local.range_alloc_block_size = @@session.range_alloc_block_size +1 +'#---------------------FN_DYNVARS_137_11----------------------#' +SET range_alloc_block_size = 1; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '1' +SELECT @@range_alloc_block_size; +@@range_alloc_block_size +4096 +SELECT local.range_alloc_block_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.range_alloc_block_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT range_alloc_block_size = @@session.range_alloc_block_size; +ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list' +SET @@global.range_alloc_block_size = @start_global_value; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = @start_session_value; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 diff --git a/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result new file mode 100644 index 00000000000..26ddfdd2bae --- /dev/null +++ b/mysql-test/suite/sys_vars/r/range_alloc_block_size_basic_64.result @@ -0,0 +1,178 @@ +SET @start_global_value = @@global.range_alloc_block_size; +SELECT @start_global_value; +@start_global_value +4096 +SET @start_session_value = @@session.range_alloc_block_size; +SELECT @start_session_value; +@start_session_value +4096 +'#--------------------FN_DYNVARS_137_01-------------------------#' +SET @@global.range_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '100' +SET @@global.range_alloc_block_size = DEFAULT; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = 200; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '200' +SET @@session.range_alloc_block_size = DEFAULT; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +'#--------------------FN_DYNVARS_137_02-------------------------#' +SET @@global.range_alloc_block_size = DEFAULT; +SELECT @@global.range_alloc_block_size = 2048; +@@global.range_alloc_block_size = 2048 +0 +SET @@session.range_alloc_block_size = DEFAULT; +SELECT @@session.range_alloc_block_size = 2048; +@@session.range_alloc_block_size = 2048 +0 +'#--------------------FN_DYNVARS_137_03-------------------------#' +SET @@global.range_alloc_block_size = 2048; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.range_alloc_block_size = 4294967295; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4294966272 +SET @@global.range_alloc_block_size = 4294967294; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_137_04-------------------------#' +SET @@session.range_alloc_block_size = 2048; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '2048' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = 4294967295; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294966272 +SET @@session.range_alloc_block_size = 4294967294; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294966272 +'#------------------FN_DYNVARS_137_05-----------------------#' +SET @@global.range_alloc_block_size = 0; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@global.range_alloc_block_size = -1024; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@global.range_alloc_block_size = 42949672951; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +42949671936 +SET @@global.range_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +42949671936 +SET @@global.range_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +42949671936 +SET @@session.range_alloc_block_size = 0; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = -2; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.range_alloc_block_size = 4294967296; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294967296 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.range_alloc_block_size = test; +ERROR 42000: Incorrect argument type to variable 'range_alloc_block_size' +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4294967296 +'#------------------FN_DYNVARS_137_06-----------------------#' +SELECT @@global.range_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='range_alloc_block_size'; +@@global.range_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_137_07-----------------------#' +SELECT @@session.range_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='range_alloc_block_size'; +@@session.range_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_137_08-----------------------#' +SET @@global.range_alloc_block_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '1' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@global.range_alloc_block_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '0' +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +'#---------------------FN_DYNVARS_137_09----------------------#' +SET @@global.range_alloc_block_size = 10; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '10' +SELECT @@range_alloc_block_size = @@global.range_alloc_block_size; +@@range_alloc_block_size = @@global.range_alloc_block_size +0 +'#---------------------FN_DYNVARS_137_10----------------------#' +SET @@range_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '100' +SELECT @@range_alloc_block_size = @@local.range_alloc_block_size; +@@range_alloc_block_size = @@local.range_alloc_block_size +1 +SELECT @@local.range_alloc_block_size = @@session.range_alloc_block_size; +@@local.range_alloc_block_size = @@session.range_alloc_block_size +1 +'#---------------------FN_DYNVARS_137_11----------------------#' +SET range_alloc_block_size = 1; +Warnings: +Warning 1292 Truncated incorrect range_alloc_block_size value: '1' +SELECT @@range_alloc_block_size; +@@range_alloc_block_size +4096 +SELECT local.range_alloc_block_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.range_alloc_block_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT range_alloc_block_size = @@session.range_alloc_block_size; +ERROR 42S22: Unknown column 'range_alloc_block_size' in 'field list' +SET @@global.range_alloc_block_size = @start_global_value; +SELECT @@global.range_alloc_block_size; +@@global.range_alloc_block_size +4096 +SET @@session.range_alloc_block_size = @start_session_value; +SELECT @@session.range_alloc_block_size; +@@session.range_alloc_block_size +4096 diff --git a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result new file mode 100644 index 00000000000..d4dd46eba71 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_32.result @@ -0,0 +1,110 @@ +SET @start_global_value = @@global.rpl_recovery_rank; +SELECT @start_global_value; +@start_global_value +0 +'#--------------------FN_DYNVARS_142_01-------------------------#' +SET @@global.rpl_recovery_rank = 500000; +SET @@global.rpl_recovery_rank = DEFAULT; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +'#--------------------FN_DYNVARS_142_02-------------------------#' +SET @@global.rpl_recovery_rank = 0; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = 1024; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +1024 +SET @@global.rpl_recovery_rank = 123456789; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +123456789 +SET @@global.rpl_recovery_rank = 2147483648*2; +Warnings: +Warning 1292 Truncated incorrect rpl-recovery-rank value: '4294967296' +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +4294967295 +SET @@global.rpl_recovery_rank = 2147483648*1024; +Warnings: +Warning 1292 Truncated incorrect rpl-recovery-rank value: '2199023255552' +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +4294967295 +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +4294967295 +SET @@global.rpl_recovery_rank = 2147483648*2147483648; +Warnings: +Warning 1292 Truncated incorrect rpl-recovery-rank value: '4611686018427387904' +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +4294967295 +'#--------------------FN_DYNVARS_142_03-------------------------#' +SET @@rpl_recovery_rank = 2; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.rpl_recovery_rank = 3; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.rpl_recovery_rank = 4; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_142_04-----------------------#' +SET @@global.rpl_recovery_rank = -1; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = -2147483648; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = -2147483649; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.rpl_recovery_rank = 2147483649.56; +ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' +SET @@global.rpl_recovery_rank = 1G; +ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' +'#------------------FN_DYNVARS_142_05-----------------------#' +SET @@global.rpl_recovery_rank = 3000; +SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='rpl_recovery_rank'; +@@global.rpl_recovery_rank = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_142_06-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='rpl_recovery_rank'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_142_07-----------------------#' +SET @@global.rpl_recovery_rank = TRUE; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +1 +SET @@global.rpl_recovery_rank = FALSE; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +'#---------------------FN_DYNVARS_001_08----------------------#' +SET @@global.rpl_recovery_rank = 512; +SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank; +@@rpl_recovery_rank = @@global.rpl_recovery_rank +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET rpl_recovery_rank = 2048; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +SELECT rpl_recovery_rank; +ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list' +SELECT @@rpl_recovery_rank; +@@rpl_recovery_rank +512 +SET global rpl_recovery_rank = 64; +SET @@global.rpl_recovery_rank = @start_global_value; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 diff --git a/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result new file mode 100644 index 00000000000..74a47fa0f08 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/rpl_recovery_rank_basic_64.result @@ -0,0 +1,104 @@ +SET @start_global_value = @@global.rpl_recovery_rank; +SELECT @start_global_value; +@start_global_value +0 +'#--------------------FN_DYNVARS_142_01-------------------------#' +SET @@global.rpl_recovery_rank = 500000; +SET @@global.rpl_recovery_rank = DEFAULT; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +'#--------------------FN_DYNVARS_142_02-------------------------#' +SET @@global.rpl_recovery_rank = 0; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = 1024; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +1024 +SET @@global.rpl_recovery_rank = 123456789; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +123456789 +SET @@global.rpl_recovery_rank = 2147483648*2; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +4294967296 +SET @@global.rpl_recovery_rank = 2147483648*1024; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +2199023255552 +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +2199023255552 +SET @@global.rpl_recovery_rank = 2147483648*2147483648; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +4611686018427387904 +'#--------------------FN_DYNVARS_142_03-------------------------#' +SET @@rpl_recovery_rank = 2; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.rpl_recovery_rank = 3; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.rpl_recovery_rank = 4; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_142_04-----------------------#' +SET @@global.rpl_recovery_rank = -1; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = -2147483648; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = -2147483649; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +SET @@global.rpl_recovery_rank = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.rpl_recovery_rank = 2147483649.56; +ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' +SET @@global.rpl_recovery_rank = 1G; +ERROR 42000: Incorrect argument type to variable 'rpl_recovery_rank' +'#------------------FN_DYNVARS_142_05-----------------------#' +SET @@global.rpl_recovery_rank = 3000; +SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='rpl_recovery_rank'; +@@global.rpl_recovery_rank = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_142_06-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='rpl_recovery_rank'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_142_07-----------------------#' +SET @@global.rpl_recovery_rank = TRUE; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +1 +SET @@global.rpl_recovery_rank = FALSE; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 +'#---------------------FN_DYNVARS_001_08----------------------#' +SET @@global.rpl_recovery_rank = 512; +SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank; +@@rpl_recovery_rank = @@global.rpl_recovery_rank +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET rpl_recovery_rank = 2048; +ERROR HY000: Variable 'rpl_recovery_rank' is a GLOBAL variable and should be set with SET GLOBAL +SELECT rpl_recovery_rank; +ERROR 42S22: Unknown column 'rpl_recovery_rank' in 'field list' +SELECT @@rpl_recovery_rank; +@@rpl_recovery_rank +512 +SET global rpl_recovery_rank = 64; +SET @@global.rpl_recovery_rank = @start_global_value; +SELECT @@global.rpl_recovery_rank; +@@global.rpl_recovery_rank +0 diff --git a/mysql-test/suite/sys_vars/r/server_id_basic_32.result b/mysql-test/suite/sys_vars/r/server_id_basic_32.result new file mode 100644 index 00000000000..6f801fc627b --- /dev/null +++ b/mysql-test/suite/sys_vars/r/server_id_basic_32.result @@ -0,0 +1,117 @@ +SET @@global.general_log= 0; +SET @start_global_value = @@global.server_id; +SELECT @start_global_value; +@start_global_value +1 +'#--------------------FN_DYNVARS_144_01-------------------------#' +SET @@global.server_id = 500000; +SET @@global.server_id = DEFAULT; +SELECT @@global.server_id; +@@global.server_id +0 +'#--------------------FN_DYNVARS_144_02-------------------------#' +SET @@global.server_id = DEFAULT; +SELECT @@global.server_id = 0; +@@global.server_id = 0 +1 +'#--------------------FN_DYNVARS_144_03-------------------------#' +SET @@global.server_id = 0; +SELECT @@global.server_id; +@@global.server_id +0 +SET @@global.server_id = 1; +SELECT @@global.server_id; +@@global.server_id +1 +SET @@global.server_id = 15; +SELECT @@global.server_id; +@@global.server_id +15 +SET @@global.server_id = 1024; +SELECT @@global.server_id; +@@global.server_id +1024 +SET @@global.server_id = 123456789; +SELECT @@global.server_id; +@@global.server_id +123456789 +SET @@global.server_id = 2147483648; +SELECT @@global.server_id; +@@global.server_id +2147483648 +SET @@global.server_id = 2147483648*2-1; +SELECT @@global.server_id; +@@global.server_id +4294967295 +'#--------------------FN_DYNVARS_144_04-------------------------#' +SET @@server_id = 2; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.server_id = 3; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.server_id = 4; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_144_05-----------------------#' +SET @@global.server_id = -1; +SELECT @@global.server_id; +@@global.server_id +0 +SET @@global.server_id = -2147483648; +SELECT @@global.server_id; +@@global.server_id +0 +SET @@global.server_id = 2147483649*2; +Warnings: +Warning 1292 Truncated incorrect server-id value: '4294967298' +SELECT @@global.server_id; +@@global.server_id +4294967295 +SET @@global.server_id = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.server_id = '125'; +ERROR 42000: Incorrect argument type to variable 'server_id' +SET @@global.server_id = 7483649.56; +ERROR 42000: Incorrect argument type to variable 'server_id' +SET @@global.server_id = 1G; +ERROR 42000: Incorrect argument type to variable 'server_id' +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#------------------FN_DYNVARS_144_06-----------------------#' +SET @@global.server_id = 3000; +SELECT @@global.server_id = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='server_id'; +@@global.server_id = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_144_07-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='server_id'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_144_08-----------------------#' +SET @@global.server_id = TRUE; +SELECT @@global.server_id; +@@global.server_id +1 +SET @@global.server_id = FALSE; +SELECT @@global.server_id; +@@global.server_id +0 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.server_id = 512; +SELECT @@server_id = @@global.server_id; +@@server_id = @@global.server_id +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET server_id = 2048; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +SELECT server_id; +ERROR 42S22: Unknown column 'server_id' in 'field list' +SELECT @@server_id; +@@server_id +512 +SET global server_id = 99; +SET @@global.server_id = @start_global_value; +SELECT @@global.server_id; +@@global.server_id +1 +SET @@global.general_log= 1; diff --git a/mysql-test/suite/sys_vars/r/server_id_basic_64.result b/mysql-test/suite/sys_vars/r/server_id_basic_64.result new file mode 100644 index 00000000000..b6f3095ccfe --- /dev/null +++ b/mysql-test/suite/sys_vars/r/server_id_basic_64.result @@ -0,0 +1,115 @@ +SET @@global.general_log= 0; +SET @start_global_value = @@global.server_id; +SELECT @start_global_value; +@start_global_value +1 +'#--------------------FN_DYNVARS_144_01-------------------------#' +SET @@global.server_id = 500000; +SET @@global.server_id = DEFAULT; +SELECT @@global.server_id; +@@global.server_id +0 +'#--------------------FN_DYNVARS_144_02-------------------------#' +SET @@global.server_id = DEFAULT; +SELECT @@global.server_id = 0; +@@global.server_id = 0 +1 +'#--------------------FN_DYNVARS_144_03-------------------------#' +SET @@global.server_id = 0; +SELECT @@global.server_id; +@@global.server_id +0 +SET @@global.server_id = 1; +SELECT @@global.server_id; +@@global.server_id +1 +SET @@global.server_id = 15; +SELECT @@global.server_id; +@@global.server_id +15 +SET @@global.server_id = 1024; +SELECT @@global.server_id; +@@global.server_id +1024 +SET @@global.server_id = 123456789; +SELECT @@global.server_id; +@@global.server_id +123456789 +SET @@global.server_id = 2147483648; +SELECT @@global.server_id; +@@global.server_id +2147483648 +SET @@global.server_id = 2147483648*2-1; +SELECT @@global.server_id; +@@global.server_id +4294967295 +'#--------------------FN_DYNVARS_144_04-------------------------#' +SET @@server_id = 2; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.server_id = 3; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.server_id = 4; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_144_05-----------------------#' +SET @@global.server_id = -1; +SELECT @@global.server_id; +@@global.server_id +0 +SET @@global.server_id = -2147483648; +SELECT @@global.server_id; +@@global.server_id +0 +SET @@global.server_id = 2147483649*2; +SELECT @@global.server_id; +@@global.server_id +4294967298 +SET @@global.server_id = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.server_id = '125'; +ERROR 42000: Incorrect argument type to variable 'server_id' +SET @@global.server_id = 7483649.56; +ERROR 42000: Incorrect argument type to variable 'server_id' +SET @@global.server_id = 1G; +ERROR 42000: Incorrect argument type to variable 'server_id' +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#------------------FN_DYNVARS_144_06-----------------------#' +SET @@global.server_id = 3000; +SELECT @@global.server_id = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='server_id'; +@@global.server_id = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_144_07-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='server_id'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_144_08-----------------------#' +SET @@global.server_id = TRUE; +SELECT @@global.server_id; +@@global.server_id +1 +SET @@global.server_id = FALSE; +SELECT @@global.server_id; +@@global.server_id +0 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.server_id = 512; +SELECT @@server_id = @@global.server_id; +@@server_id = @@global.server_id +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET server_id = 2048; +ERROR HY000: Variable 'server_id' is a GLOBAL variable and should be set with SET GLOBAL +SELECT server_id; +ERROR 42S22: Unknown column 'server_id' in 'field list' +SELECT @@server_id; +@@server_id +512 +SET global server_id = 99; +SET @@global.server_id = @start_global_value; +SELECT @@global.server_id; +@@global.server_id +1 +SET @@global.general_log= 1; diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result new file mode 100644 index 00000000000..5b77c500aa0 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_32.result @@ -0,0 +1,119 @@ +SET @start_global_value = @@global.slave_transaction_retries; +SELECT @start_global_value; +@start_global_value +10 +'#--------------------FN_DYNVARS_149_01-------------------------#' +SET @@global.slave_transaction_retries = 50; +SET @@global.slave_transaction_retries = DEFAULT; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +10 +'#--------------------FN_DYNVARS_149_02-------------------------#' +SET @@global.slave_transaction_retries = DEFAULT; +SELECT @@global.slave_transaction_retries = 10; +@@global.slave_transaction_retries = 10 +1 +'#--------------------FN_DYNVARS_149_03-------------------------#' +SET @@global.slave_transaction_retries = 0; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +0 +SET @@global.slave_transaction_retries = 1; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +1 +SET @@global.slave_transaction_retries = 15; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +15 +SET @@global.slave_transaction_retries = 1024; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +1024 +SET @@global.slave_transaction_retries = 2147483648; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +2147483648 +SET @@global.slave_transaction_retries = 2147483648*2-1; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4294967295 +SET @@global.slave_transaction_retries = 2147483649*2; +Warnings: +Warning 1292 Truncated incorrect slave_transaction_retries value: '4294967298' +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4294967295 +SET @@global.slave_transaction_retries = 4294967295; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4294967295 +'#--------------------FN_DYNVARS_149_04-------------------------#' +SET @@slave_transaction_retries = 2; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.slave_transaction_retries = 3; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.slave_transaction_retries = 4; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_149_05-----------------------#' +SET @@global.slave_transaction_retries = -1; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +0 +SET @@global.slave_transaction_retries = 2147483649*2147483649; +Warnings: +Warning 1292 Truncated incorrect slave_transaction_retries value: '4611686022722355201' +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4294967295 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.slave_transaction_retries = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.slave_transaction_retries = '100'; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +SET @@global.slave_transaction_retries = 7483649.56; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +SET @@global.slave_transaction_retries = ON; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +SET @@global.slave_transaction_retries = OFF; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +'#------------------FN_DYNVARS_149_06-----------------------#' +SET @@global.slave_transaction_retries = 3000; +SELECT @@global.slave_transaction_retries = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_transaction_retries'; +@@global.slave_transaction_retries = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_149_07-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_transaction_retries'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_149_08-----------------------#' +SET @@global.slave_transaction_retries = TRUE; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +1 +SET @@global.slave_transaction_retries = FALSE; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +0 +'#---------------------FN_DYNVARS_149_09----------------------#' +SET @@global.slave_transaction_retries = 60*60; +SELECT @@slave_transaction_retries = @@global.slave_transaction_retries; +@@slave_transaction_retries = @@global.slave_transaction_retries +1 +'#---------------------FN_DYNVARS_149_10----------------------#' +SET slave_transaction_retries = 2048; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +SELECT slave_transaction_retries; +ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list' +SELECT @@slave_transaction_retries; +@@slave_transaction_retries +3600 +SET global slave_transaction_retries = 99; +SET @@global.slave_transaction_retries = @start_global_value; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +10 diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result new file mode 100644 index 00000000000..9434b14b238 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/slave_transaction_retries_basic_64.result @@ -0,0 +1,115 @@ +SET @start_global_value = @@global.slave_transaction_retries; +SELECT @start_global_value; +@start_global_value +10 +'#--------------------FN_DYNVARS_149_01-------------------------#' +SET @@global.slave_transaction_retries = 50; +SET @@global.slave_transaction_retries = DEFAULT; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +10 +'#--------------------FN_DYNVARS_149_02-------------------------#' +SET @@global.slave_transaction_retries = DEFAULT; +SELECT @@global.slave_transaction_retries = 10; +@@global.slave_transaction_retries = 10 +1 +'#--------------------FN_DYNVARS_149_03-------------------------#' +SET @@global.slave_transaction_retries = 0; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +0 +SET @@global.slave_transaction_retries = 1; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +1 +SET @@global.slave_transaction_retries = 15; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +15 +SET @@global.slave_transaction_retries = 1024; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +1024 +SET @@global.slave_transaction_retries = 2147483648; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +2147483648 +SET @@global.slave_transaction_retries = 2147483648*2-1; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4294967295 +SET @@global.slave_transaction_retries = 2147483649*2; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4294967298 +SET @@global.slave_transaction_retries = 4294967295; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4294967295 +'#--------------------FN_DYNVARS_149_04-------------------------#' +SET @@slave_transaction_retries = 2; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +SET @@session.slave_transaction_retries = 3; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +SET @@local.slave_transaction_retries = 4; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +'#------------------FN_DYNVARS_149_05-----------------------#' +SET @@global.slave_transaction_retries = -1; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +0 +SET @@global.slave_transaction_retries = 2147483649*2147483649; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +4611686022722355201 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +SET @@global.slave_transaction_retries = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@global.slave_transaction_retries = '100'; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +SET @@global.slave_transaction_retries = 7483649.56; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +SET @@global.slave_transaction_retries = ON; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +SET @@global.slave_transaction_retries = OFF; +ERROR 42000: Incorrect argument type to variable 'slave_transaction_retries' +'#------------------FN_DYNVARS_149_06-----------------------#' +SET @@global.slave_transaction_retries = 3000; +SELECT @@global.slave_transaction_retries = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='slave_transaction_retries'; +@@global.slave_transaction_retries = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_149_07-----------------------#' +SELECT count(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='slave_transaction_retries'; +count(VARIABLE_VALUE) +1 +'#------------------FN_DYNVARS_149_08-----------------------#' +SET @@global.slave_transaction_retries = TRUE; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +1 +SET @@global.slave_transaction_retries = FALSE; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +0 +'#---------------------FN_DYNVARS_149_09----------------------#' +SET @@global.slave_transaction_retries = 60*60; +SELECT @@slave_transaction_retries = @@global.slave_transaction_retries; +@@slave_transaction_retries = @@global.slave_transaction_retries +1 +'#---------------------FN_DYNVARS_149_10----------------------#' +SET slave_transaction_retries = 2048; +ERROR HY000: Variable 'slave_transaction_retries' is a GLOBAL variable and should be set with SET GLOBAL +SELECT slave_transaction_retries; +ERROR 42S22: Unknown column 'slave_transaction_retries' in 'field list' +SELECT @@slave_transaction_retries; +@@slave_transaction_retries +3600 +SET global slave_transaction_retries = 99; +SET @@global.slave_transaction_retries = @start_global_value; +SELECT @@global.slave_transaction_retries; +@@global.slave_transaction_retries +10 diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result new file mode 100644 index 00000000000..09a1fe59046 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result @@ -0,0 +1,193 @@ +SET @start_global_value = @@global.sort_buffer_size; +SELECT @start_global_value; +@start_global_value +262144 +SET @start_session_value = @@session.sort_buffer_size; +SELECT @start_session_value; +@start_session_value +262144 +'#--------------------FN_DYNVARS_151_01-------------------------#' +SET @@global.sort_buffer_size = 1000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '1000' +SET @@global.sort_buffer_size = DEFAULT; +SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116; +@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116 +1 +SET @@session.sort_buffer_size = 2000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '2000' +SET @@session.sort_buffer_size = DEFAULT; +SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116; +@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116 +1 +'#--------------------FN_DYNVARS_151_02-------------------------#' +SET @@global.sort_buffer_size = DEFAULT; +SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116; +@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116 +1 +SET @@session.sort_buffer_size = DEFAULT; +SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116; +@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116 +1 +'#--------------------FN_DYNVARS_151_03-------------------------#' +SET @@global.sort_buffer_size = 32776; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32776' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = 32777; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32777' +SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = 4294967295; +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967295 +SET @@global.sort_buffer_size = 4294967294; +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967294 +'Bug# 34877: Invalid Values are showing in variable on assigning valid values.'; +'#--------------------FN_DYNVARS_151_04-------------------------#' +SET @@session.sort_buffer_size = 32776; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32776' +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = 32777; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32777' +SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = 4294967295; +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967295 +SET @@session.sort_buffer_size = 4294967294; +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967294 +'#------------------FN_DYNVARS_151_05-----------------------#' +SET @@global.sort_buffer_size = 32775; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32775' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = -1024; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '0' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = 4294967296; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296' +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967295 +SET @@global.sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967295 +SET @@global.sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967295 +SET @@session.sort_buffer_size = 32775; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32775' +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = -2; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '0' +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.sort_buffer_size = 4294967296; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '4294967296' +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967295 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967295 +'#------------------FN_DYNVARS_151_06-----------------------#' +SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; +@@global.sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_151_07-----------------------#' +SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; +@@session.sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_151_08-----------------------#' +SET @@global.sort_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '1' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '0' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +'Bug: Errors should be displayed on assigning TRUE/FALSE to variable' +'#---------------------FN_DYNVARS_151_09----------------------#' +SET @@global.sort_buffer_size = 9000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '9000' +SELECT @@sort_buffer_size = @@global.sort_buffer_size; +@@sort_buffer_size = @@global.sort_buffer_size +0 +'#---------------------FN_DYNVARS_151_10----------------------#' +SET @@sort_buffer_size = 9000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '9000' +SELECT @@sort_buffer_size = @@local.sort_buffer_size; +@@sort_buffer_size = @@local.sort_buffer_size +1 +SELECT @@local.sort_buffer_size = @@session.sort_buffer_size; +@@local.sort_buffer_size = @@session.sort_buffer_size +1 +'#---------------------FN_DYNVARS_151_11----------------------#' +SET sort_buffer_size = 9100; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '9100' +SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804; +@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804 +1 +SELECT @@sort_buffer_size; +@@sort_buffer_size +32804 +SELECT local.sort_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.sort_buffer_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT sort_buffer_size = @@session.sort_buffer_size; +ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list' +SET @@global.sort_buffer_size = @start_global_value; +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +262144 +SET @@session.sort_buffer_size = @start_session_value; +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +262144 diff --git a/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result new file mode 100644 index 00000000000..e9bd14abc67 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_64.result @@ -0,0 +1,189 @@ +SET @start_global_value = @@global.sort_buffer_size; +SELECT @start_global_value; +@start_global_value +262144 +SET @start_session_value = @@session.sort_buffer_size; +SELECT @start_session_value; +@start_session_value +262144 +'#--------------------FN_DYNVARS_151_01-------------------------#' +SET @@global.sort_buffer_size = 1000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '1000' +SET @@global.sort_buffer_size = DEFAULT; +SELECT @@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116; +@@global.sort_buffer_size= 2097144 OR @@global.sort_buffer_size= 2097116 +1 +SET @@session.sort_buffer_size = 2000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '2000' +SET @@session.sort_buffer_size = DEFAULT; +SELECT @@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116; +@@session.sort_buffer_size= 2097144 OR @@session.sort_buffer_size= 2097116 +1 +'#--------------------FN_DYNVARS_151_02-------------------------#' +SET @@global.sort_buffer_size = DEFAULT; +SELECT @@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116; +@@global.sort_buffer_size = 2097144 OR @@global.sort_buffer_size= 2097116 +1 +SET @@session.sort_buffer_size = DEFAULT; +SELECT @@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116; +@@session.sort_buffer_size = 2097144 OR @@session.sort_buffer_size= 2097116 +1 +'#--------------------FN_DYNVARS_151_03-------------------------#' +SET @@global.sort_buffer_size = 32776; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32776' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = 32777; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32777' +SELECT @@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32777 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = 4294967295; +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967295 +SET @@global.sort_buffer_size = 4294967294; +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967294 +'Bug# 34877: Invalid Values are showing in variable on assigning valid values.'; +'#--------------------FN_DYNVARS_151_04-------------------------#' +SET @@session.sort_buffer_size = 32776; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32776' +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = 32777; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32777' +SELECT @@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32777 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = 4294967295; +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967295 +SET @@session.sort_buffer_size = 4294967294; +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967294 +'#------------------FN_DYNVARS_151_05-----------------------#' +SET @@global.sort_buffer_size = 32775; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32775' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = -1024; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '0' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = 4294967296; +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967296 +SET @@global.sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967296 +SET @@global.sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +4294967296 +SET @@session.sort_buffer_size = 32775; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32775' +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = -2; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '0' +SELECT @@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804; +@@session.sort_buffer_size= 32776 OR @@session.sort_buffer_size= 32804 +1 +SET @@session.sort_buffer_size = 65530.34.; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 +SET @@session.sort_buffer_size = 4294967296; +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967296 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.sort_buffer_size = test; +ERROR 42000: Incorrect argument type to variable 'sort_buffer_size' +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +4294967296 +'#------------------FN_DYNVARS_151_06-----------------------#' +SELECT @@global.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; +@@global.sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_151_07-----------------------#' +SELECT @@session.sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='sort_buffer_size'; +@@session.sort_buffer_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_151_08-----------------------#' +SET @@global.sort_buffer_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '1' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +SET @@global.sort_buffer_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '0' +SELECT @@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804; +@@global.sort_buffer_size= 32776 OR @@global.sort_buffer_size= 32804 +1 +'Bug: Errors should be displayed on assigning TRUE/FALSE to variable' +'#---------------------FN_DYNVARS_151_09----------------------#' +SET @@global.sort_buffer_size = 9000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '9000' +SELECT @@sort_buffer_size = @@global.sort_buffer_size; +@@sort_buffer_size = @@global.sort_buffer_size +0 +'#---------------------FN_DYNVARS_151_10----------------------#' +SET @@sort_buffer_size = 9000; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '9000' +SELECT @@sort_buffer_size = @@local.sort_buffer_size; +@@sort_buffer_size = @@local.sort_buffer_size +1 +SELECT @@local.sort_buffer_size = @@session.sort_buffer_size; +@@local.sort_buffer_size = @@session.sort_buffer_size +1 +'#---------------------FN_DYNVARS_151_11----------------------#' +SET sort_buffer_size = 9100; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '9100' +SELECT @sort_buffer_size= 32776 OR @@sort_buffer_size= 32804; +@sort_buffer_size= 32776 OR @@sort_buffer_size= 32804 +1 +SELECT @@sort_buffer_size; +@@sort_buffer_size +32804 +SELECT local.sort_buffer_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.sort_buffer_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT sort_buffer_size = @@session.sort_buffer_size; +ERROR 42S22: Unknown column 'sort_buffer_size' in 'field list' +SET @@global.sort_buffer_size = @start_global_value; +SELECT @@global.sort_buffer_size; +@@global.sort_buffer_size +262144 +SET @@session.sort_buffer_size = @start_session_value; +SELECT @@session.sort_buffer_size; +@@session.sort_buffer_size +262144 diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result b/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result new file mode 100644 index 00000000000..3d9bfb6d218 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/sync_binlog_basic_32.result @@ -0,0 +1,105 @@ +SET @start_value = @@global.sync_binlog; +SELECT @start_value; +@start_value +0 +'#--------------------FN_DYNVARS_168_01------------------------#' +SET @@global.sync_binlog = 99; +SET @@global.sync_binlog = DEFAULT; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +'#---------------------FN_DYNVARS_168_02-------------------------#' +SET @@global.sync_binlog = @start_value; +SELECT @@global.sync_binlog = 0; +@@global.sync_binlog = 0 +1 +'#--------------------FN_DYNVARS_168_03------------------------#' +SET @@global.sync_binlog = 0; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +SET @@global.sync_binlog = 1; +SELECT @@global.sync_binlog; +@@global.sync_binlog +1 +SET @@global.sync_binlog = 4294967295; +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967295 +SET @@global.sync_binlog = 4294967294; +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967294 +SET @@global.sync_binlog = 65536; +SELECT @@global.sync_binlog; +@@global.sync_binlog +65536 +'#--------------------FN_DYNVARS_168_04-------------------------#' +SET @@global.sync_binlog = -1; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +SET @@global.sync_binlog = 4294967296; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +SET @@global.sync_binlog = 10240022115; +SELECT @@global.sync_binlog; +@@global.sync_binlog +1650087523 +SET @@global.sync_binlog = 10000.01; +ERROR 42000: Incorrect argument type to variable 'sync_binlog' +SELECT @@global.sync_binlog; +@@global.sync_binlog +1650087523 +SET @@global.sync_binlog = -1024; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +SET @@global.sync_binlog = 42949672950; +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967286 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.sync_binlog = ON; +ERROR 42000: Incorrect argument type to variable 'sync_binlog' +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967286 +SET @@global.sync_binlog = 'test'; +ERROR 42000: Incorrect argument type to variable 'sync_binlog' +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967286 +'#-------------------FN_DYNVARS_168_05----------------------------#' +SET @@session.sync_binlog = 0; +ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@sync_binlog; +@@sync_binlog +4294967286 +'#----------------------FN_DYNVARS_168_06------------------------#' +SELECT @@global.sync_binlog = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='sync_binlog'; +@@global.sync_binlog = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_168_07----------------------#' +SET sync_binlog = 1; +ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@sync_binlog; +@@sync_binlog +4294967286 +SET local.sync_binlog = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 +SELECT local.sync_binlog; +ERROR 42S02: Unknown table 'local' in field list +SET global.sync_binlog = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 +SELECT global.sync_binlog; +ERROR 42S02: Unknown table 'global' in field list +SELECT sync_binlog = @@session.sync_binlog; +ERROR 42S22: Unknown column 'sync_binlog' in 'field list' +SET @@global.sync_binlog = @start_value; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result b/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result new file mode 100644 index 00000000000..ffd1b3fc4f1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/sync_binlog_basic_64.result @@ -0,0 +1,105 @@ +SET @start_value = @@global.sync_binlog; +SELECT @start_value; +@start_value +0 +'#--------------------FN_DYNVARS_168_01------------------------#' +SET @@global.sync_binlog = 99; +SET @@global.sync_binlog = DEFAULT; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +'#---------------------FN_DYNVARS_168_02-------------------------#' +SET @@global.sync_binlog = @start_value; +SELECT @@global.sync_binlog = 0; +@@global.sync_binlog = 0 +1 +'#--------------------FN_DYNVARS_168_03------------------------#' +SET @@global.sync_binlog = 0; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +SET @@global.sync_binlog = 1; +SELECT @@global.sync_binlog; +@@global.sync_binlog +1 +SET @@global.sync_binlog = 4294967295; +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967295 +SET @@global.sync_binlog = 4294967294; +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967294 +SET @@global.sync_binlog = 65536; +SELECT @@global.sync_binlog; +@@global.sync_binlog +65536 +'#--------------------FN_DYNVARS_168_04-------------------------#' +SET @@global.sync_binlog = -1; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +SET @@global.sync_binlog = 4294967296; +SELECT @@global.sync_binlog; +@@global.sync_binlog +4294967296 +SET @@global.sync_binlog = 10240022115; +SELECT @@global.sync_binlog; +@@global.sync_binlog +10240022115 +SET @@global.sync_binlog = 10000.01; +ERROR 42000: Incorrect argument type to variable 'sync_binlog' +SELECT @@global.sync_binlog; +@@global.sync_binlog +10240022115 +SET @@global.sync_binlog = -1024; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 +SET @@global.sync_binlog = 42949672950; +SELECT @@global.sync_binlog; +@@global.sync_binlog +42949672950 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.sync_binlog = ON; +ERROR 42000: Incorrect argument type to variable 'sync_binlog' +SELECT @@global.sync_binlog; +@@global.sync_binlog +42949672950 +SET @@global.sync_binlog = 'test'; +ERROR 42000: Incorrect argument type to variable 'sync_binlog' +SELECT @@global.sync_binlog; +@@global.sync_binlog +42949672950 +'#-------------------FN_DYNVARS_168_05----------------------------#' +SET @@session.sync_binlog = 0; +ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@sync_binlog; +@@sync_binlog +42949672950 +'#----------------------FN_DYNVARS_168_06------------------------#' +SELECT @@global.sync_binlog = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='sync_binlog'; +@@global.sync_binlog = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_168_07----------------------#' +SET sync_binlog = 1; +ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@sync_binlog; +@@sync_binlog +42949672950 +SET local.sync_binlog = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 +SELECT local.sync_binlog; +ERROR 42S02: Unknown table 'local' in field list +SET global.sync_binlog = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sync_binlog = 1' at line 1 +SELECT global.sync_binlog; +ERROR 42S02: Unknown table 'global' in field list +SELECT sync_binlog = @@session.sync_binlog; +ERROR 42S22: Unknown column 'sync_binlog' in 'field list' +SET @@global.sync_binlog = @start_value; +SELECT @@global.sync_binlog; +@@global.sync_binlog +0 diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_32.result b/mysql-test/suite/sys_vars/r/timestamp_basic_32.result new file mode 100644 index 00000000000..cc4f0324c0f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/timestamp_basic_32.result @@ -0,0 +1,73 @@ +SET @session_start_value = @@session.timestamp; +'#--------------------FN_DYNVARS_001_01------------------------#' +SET @@timestamp = DEFAULT; +'timestamp does not have any DEFAULT value' +'#---------------------FN_DYNVARS_001_02-------------------------#' +SET @@global.timestamp = "1000"; +ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL +'#--------------------FN_DYNVARS_001_03------------------------#' +SET @@timestamp = 0; +'Setting 0 resets timestamp to session default timestamp' +SET @@timestamp = 123456789123456; +SELECT @@timestamp; +@@timestamp +2249167232 +SET @@timestamp = 60*60*60*60*365; +SELECT @@timestamp; +@@timestamp +435432704 +SET @@timestamp = -1000000000; +SELECT @@timestamp; +@@timestamp +3294967296 +SET @temp_ts = @@timestamp - @@timestamp; +SELECT @temp_ts; +@temp_ts +0 +'#--------------------FN_DYNVARS_001_04-------------------------#' +SET @@timestamp = "100"; +ERROR 42000: Incorrect argument type to variable 'timestamp' +'Bug# 34836: Documentation says its a string variable but infact its numeric' +SET @@timestamp = " "; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = 1.1; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = 9999999999999999999999; +ERROR 42000: Incorrect argument type to variable 'timestamp' +'#----------------------FN_DYNVARS_001_06------------------------#' +SELECT @@timestamp = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='timestamp'; +@@timestamp = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_08-------------------------#' +SET @@timestamp = OFF; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = ON; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = TRUE; +SELECT @@timestamp; +@@timestamp +1 +SET @@timestamp = FALSE; +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@timestamp = 123456; +SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; +@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp +1 +SET @@timestamp = 654321; +SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; +@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET timestamp = 1; +SELECT @@timestamp; +@@timestamp +1 +SELECT local.timestamp; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.timestamp; +ERROR 42S02: Unknown table 'session' in field list +SELECT timestamp = @@session.timestamp; +ERROR 42S22: Unknown column 'timestamp' in 'field list' +SET @@timestamp = @session_start_value; diff --git a/mysql-test/suite/sys_vars/r/timestamp_basic_64.result b/mysql-test/suite/sys_vars/r/timestamp_basic_64.result new file mode 100644 index 00000000000..df877cd455b --- /dev/null +++ b/mysql-test/suite/sys_vars/r/timestamp_basic_64.result @@ -0,0 +1,73 @@ +SET @session_start_value = @@session.timestamp; +'#--------------------FN_DYNVARS_001_01------------------------#' +SET @@timestamp = DEFAULT; +'timestamp does not have any DEFAULT value' +'#---------------------FN_DYNVARS_001_02-------------------------#' +SET @@global.timestamp = "1000"; +ERROR HY000: Variable 'timestamp' is a SESSION variable and can't be used with SET GLOBAL +'#--------------------FN_DYNVARS_001_03------------------------#' +SET @@timestamp = 0; +'Setting 0 resets timestamp to session default timestamp' +SET @@timestamp = 123456789123456; +SELECT @@timestamp; +@@timestamp +123456789123456 +SET @@timestamp = 60*60*60*60*365; +SELECT @@timestamp; +@@timestamp +4730400000 +SET @@timestamp = -1000000000; +SELECT @@timestamp; +@@timestamp +18446744072709551616 +SET @temp_ts = @@timestamp - @@timestamp; +SELECT @temp_ts; +@temp_ts +0 +'#--------------------FN_DYNVARS_001_04-------------------------#' +SET @@timestamp = "100"; +ERROR 42000: Incorrect argument type to variable 'timestamp' +'Bug# 34836: Documentation says its a string variable but infact its numeric' +SET @@timestamp = " "; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = 1.1; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = 9999999999999999999999; +ERROR 42000: Incorrect argument type to variable 'timestamp' +'#----------------------FN_DYNVARS_001_06------------------------#' +SELECT @@timestamp = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='timestamp'; +@@timestamp = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_08-------------------------#' +SET @@timestamp = OFF; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = ON; +ERROR 42000: Incorrect argument type to variable 'timestamp' +SET @@timestamp = TRUE; +SELECT @@timestamp; +@@timestamp +1 +SET @@timestamp = FALSE; +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@timestamp = 123456; +SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; +@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp +1 +SET @@timestamp = 654321; +SELECT @@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp; +@@timestamp = @@local.timestamp and @@timestamp = @@session.timestamp +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET timestamp = 1; +SELECT @@timestamp; +@@timestamp +1 +SELECT local.timestamp; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.timestamp; +ERROR 42S02: Unknown table 'session' in field list +SELECT timestamp = @@session.timestamp; +ERROR 42S22: Unknown column 'timestamp' in 'field list' +SET @@timestamp = @session_start_value; diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result new file mode 100644 index 00000000000..aeafd95ed55 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_32.result @@ -0,0 +1,172 @@ +SET @start_global_value = @@global.tmp_table_size; +SELECT @start_global_value; +@start_global_value +16777216 +SET @start_session_value = @@session.tmp_table_size; +SELECT @start_session_value; +@start_session_value +16777216 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.tmp_table_size = 100; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '100' +SET @@global.tmp_table_size = DEFAULT; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +16777216 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +SET @@session.tmp_table_size = 200; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '200' +SET @@session.tmp_table_size = DEFAULT; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +16777216 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.tmp_table_size = DEFAULT; +SELECT @@global.tmp_table_size = 33554432; +@@global.tmp_table_size = 33554432 +0 +SET @@session.tmp_table_size = DEFAULT; +SELECT @@session.tmp_table_size = 33554432; +@@session.tmp_table_size = 33554432 +0 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.tmp_table_size = 1024; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = 60020; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +60020 +SET @@global.tmp_table_size = 4294967295; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +4294967295 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.tmp_table_size = 1024; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +1024 +SET @@session.tmp_table_size =4294967295; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +4294967295 +SET @@session.tmp_table_size = 65535; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +65535 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.tmp_table_size = 0; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = -1024; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = 1000; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '1000' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.tmp_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@global.tmp_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@global.tmp_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '1' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +'Bug:Error should be shown that variable is numeric and can not assigned boolean value'; +SET @@global.tmp_table_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@global.tmp_table_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '1' +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +1024 +SET @@session.tmp_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +1024 +SET @@session.tmp_table_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = 12345678901; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +4294967295 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.tmp_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='tmp_table_size'; +@@global.tmp_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.tmp_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='tmp_table_size'; +@@session.tmp_table_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.tmp_table_size = 1024; +SET @@tmp_table_size = 4294967295; +SELECT @@tmp_table_size = @@global.tmp_table_size; +@@tmp_table_size = @@global.tmp_table_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@tmp_table_size = 100; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '100' +SELECT @@tmp_table_size = @@local.tmp_table_size; +@@tmp_table_size = @@local.tmp_table_size +1 +SELECT @@local.tmp_table_size = @@session.tmp_table_size; +@@local.tmp_table_size = @@session.tmp_table_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET tmp_table_size = 1027; +SELECT @@tmp_table_size; +@@tmp_table_size +1027 +SELECT local.tmp_table_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT global.tmp_table_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT tmp_table_size = @@session.tmp_table_size; +ERROR 42S22: Unknown column 'tmp_table_size' in 'field list' +SET @@global.tmp_table_size = @start_global_value; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +16777216 +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +16777216 diff --git a/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result new file mode 100644 index 00000000000..837b90fc143 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/tmp_table_size_basic_64.result @@ -0,0 +1,172 @@ +SET @start_global_value = @@global.tmp_table_size; +SELECT @start_global_value; +@start_global_value +16777216 +SET @start_session_value = @@session.tmp_table_size; +SELECT @start_session_value; +@start_session_value +16777216 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.tmp_table_size = 100; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '100' +SET @@global.tmp_table_size = DEFAULT; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +16777216 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +SET @@session.tmp_table_size = 200; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '200' +SET @@session.tmp_table_size = DEFAULT; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +16777216 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.tmp_table_size = DEFAULT; +SELECT @@global.tmp_table_size = 33554432; +@@global.tmp_table_size = 33554432 +0 +SET @@session.tmp_table_size = DEFAULT; +SELECT @@session.tmp_table_size = 33554432; +@@session.tmp_table_size = 33554432 +0 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.tmp_table_size = 1024; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = 60020; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +60020 +SET @@global.tmp_table_size = 4294967295; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +4294967295 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.tmp_table_size = 1024; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +1024 +SET @@session.tmp_table_size =4294967295; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +4294967295 +SET @@session.tmp_table_size = 65535; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +65535 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.tmp_table_size = 0; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = -1024; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = 1000; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '1000' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.tmp_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@global.tmp_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@global.tmp_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '1' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +SET @@global.tmp_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +1024 +'Bug:Error should be shown that variable is numeric and can not assigned boolean value'; +SET @@global.tmp_table_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@global.tmp_table_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = ON; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = OFF; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = True; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '1' +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +1024 +SET @@session.tmp_table_size = False; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '0' +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +1024 +SET @@session.tmp_table_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'tmp_table_size' +SET @@session.tmp_table_size = 12345678901; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +12345678901 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.tmp_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='tmp_table_size'; +@@global.tmp_table_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.tmp_table_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='tmp_table_size'; +@@session.tmp_table_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.tmp_table_size = 1024; +SET @@tmp_table_size = 4294967295; +SELECT @@tmp_table_size = @@global.tmp_table_size; +@@tmp_table_size = @@global.tmp_table_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@tmp_table_size = 100; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '100' +SELECT @@tmp_table_size = @@local.tmp_table_size; +@@tmp_table_size = @@local.tmp_table_size +1 +SELECT @@local.tmp_table_size = @@session.tmp_table_size; +@@local.tmp_table_size = @@session.tmp_table_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET tmp_table_size = 1027; +SELECT @@tmp_table_size; +@@tmp_table_size +1027 +SELECT local.tmp_table_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT global.tmp_table_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT tmp_table_size = @@session.tmp_table_size; +ERROR 42S22: Unknown column 'tmp_table_size' in 'field list' +SET @@global.tmp_table_size = @start_global_value; +SELECT @@global.tmp_table_size; +@@global.tmp_table_size +16777216 +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.tmp_table_size; +@@session.tmp_table_size +16777216 diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result new file mode 100644 index 00000000000..706d7802ed3 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_32.result @@ -0,0 +1,180 @@ +SET @start_global_value = @@global.transaction_alloc_block_size; +SELECT @start_global_value; +@start_global_value +8192 +SET @start_session_value = @@session.transaction_alloc_block_size; +SELECT @start_session_value; +@start_session_value +8192 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.transaction_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +8192 +SET @@session.transaction_alloc_block_size = 200; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '200' +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +8192 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size = 8192; +@@global.transaction_alloc_block_size = 8192 +1 +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size = 8192; +@@session.transaction_alloc_block_size = 8192 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.transaction_alloc_block_size = 1024; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 60020; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +59392 +SET @@global.transaction_alloc_block_size = 4294967295; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.transaction_alloc_block_size = 1024; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size =4294967295; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +4294966272 +SET @@session.transaction_alloc_block_size = 65535; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +64512 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.transaction_alloc_block_size = 0; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = -1024; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 123456789201; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '123456789201' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +4294966272 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.transaction_alloc_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = 1000; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = 12345678901; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '12345678901' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +4294966272 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.transaction_alloc_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; +@@global.transaction_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; +@@session.transaction_alloc_block_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_08----------------------#' +SET @@transaction_alloc_block_size = 1024; +SET @@global.transaction_alloc_block_size = 4294967295; +SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; +@@transaction_alloc_block_size = @@global.transaction_alloc_block_size +0 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@transaction_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' +SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; +@@transaction_alloc_block_size = @@local.transaction_alloc_block_size +1 +SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; +@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET transaction_alloc_block_size = 1027; +SELECT @@transaction_alloc_block_size; +@@transaction_alloc_block_size +1024 +SELECT local.transaction_alloc_block_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.transaction_alloc_block_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; +ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list' +SET @@global.transaction_alloc_block_size = @start_global_value; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +8192 +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result new file mode 100644 index 00000000000..c968d6f108c --- /dev/null +++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic_64.result @@ -0,0 +1,176 @@ +SET @start_global_value = @@global.transaction_alloc_block_size; +SELECT @start_global_value; +@start_global_value +8192 +SET @start_session_value = @@session.transaction_alloc_block_size; +SELECT @start_session_value; +@start_session_value +8192 +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.transaction_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +8192 +SET @@session.transaction_alloc_block_size = 200; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '200' +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +8192 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.transaction_alloc_block_size = DEFAULT; +SELECT @@global.transaction_alloc_block_size = 8192; +@@global.transaction_alloc_block_size = 8192 +1 +SET @@session.transaction_alloc_block_size = DEFAULT; +SELECT @@session.transaction_alloc_block_size = 8192; +@@session.transaction_alloc_block_size = 8192 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.transaction_alloc_block_size = 1024; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 60020; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +59392 +SET @@global.transaction_alloc_block_size = 4294967295; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +4294966272 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.transaction_alloc_block_size = 1024; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size =4294967295; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +4294966272 +SET @@session.transaction_alloc_block_size = 65535; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +64512 +'Bug# 34877: Invalid Values are coming in variable on assigning valid values'; +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.transaction_alloc_block_size = 0; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = -1024; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 123456789201; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +123456788480 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.transaction_alloc_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@global.transaction_alloc_block_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@global.transaction_alloc_block_size = 1000; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = 12345678901; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +12345678848 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@session.transaction_alloc_block_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '0' +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 +SET @@session.transaction_alloc_block_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +SET @@session.transaction_alloc_block_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; +@@global.transaction_alloc_block_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.transaction_alloc_block_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_alloc_block_size'; +@@session.transaction_alloc_block_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_08----------------------#' +SET @@transaction_alloc_block_size = 1024; +SET @@global.transaction_alloc_block_size = 4294967295; +SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; +@@transaction_alloc_block_size = @@global.transaction_alloc_block_size +0 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@transaction_alloc_block_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '100' +SELECT @@transaction_alloc_block_size = @@local.transaction_alloc_block_size; +@@transaction_alloc_block_size = @@local.transaction_alloc_block_size +1 +SELECT @@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size; +@@local.transaction_alloc_block_size = @@session.transaction_alloc_block_size +1 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET transaction_alloc_block_size = 1027; +SELECT @@transaction_alloc_block_size; +@@transaction_alloc_block_size +1024 +SELECT local.transaction_alloc_block_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.transaction_alloc_block_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT transaction_alloc_block_size = @@session.transaction_alloc_block_size; +ERROR 42S22: Unknown column 'transaction_alloc_block_size' in 'field list' +SET @@global.transaction_alloc_block_size = @start_global_value; +SELECT @@global.transaction_alloc_block_size; +@@global.transaction_alloc_block_size +8192 +SET @@session.tmp_table_size = @start_session_value; +SELECT @@session.transaction_alloc_block_size; +@@session.transaction_alloc_block_size +1024 diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result new file mode 100644 index 00000000000..3df7a55595e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_32.result @@ -0,0 +1,172 @@ +SET @start_global_value = @@global.transaction_prealloc_size; +SELECT @start_global_value; +@start_global_value +4096 +SET @start_session_value = @@session.transaction_prealloc_size; +SELECT @start_session_value; +@start_session_value +4096 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.transaction_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4096 +SET @@session.transaction_prealloc_size = 200; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '200' +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4096 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size = 4096; +@@global.transaction_prealloc_size = 4096 +1 +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size = 4096; +@@session.transaction_prealloc_size = 4096 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.transaction_prealloc_size = 1024; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = 60020; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +59392 +SET @@global.transaction_prealloc_size = 4294966272; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4294966272 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.transaction_prealloc_size = 1024; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size =4294966272; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4294966272 +SET @@session.transaction_prealloc_size = 65535; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +64512 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.transaction_prealloc_size = 0; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = -1024; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.transaction_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = 1000; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1000' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = 123456789031; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '123456789031' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4294966272 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; +@@global.transaction_prealloc_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; +@@session.transaction_prealloc_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.transaction_prealloc_size = 1024; +SET @@global.transaction_prealloc_size = 10; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' +SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; +@@transaction_prealloc_size = @@global.transaction_prealloc_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@transaction_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' +SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; +@@transaction_prealloc_size = @@local.transaction_prealloc_size +1 +SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; +@@local.transaction_prealloc_size = @@session.transaction_prealloc_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET transaction_prealloc_size = 1027; +SELECT @@transaction_prealloc_size; +@@transaction_prealloc_size +1024 +SELECT local.transaction_prealloc_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.transaction_prealloc_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; +ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list' +SET @@global.transaction_prealloc_size = @start_global_value; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4096 +SET @@session.transaction_prealloc_size = @start_session_value; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4096 diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result new file mode 100644 index 00000000000..2fb6451372f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic_64.result @@ -0,0 +1,170 @@ +SET @start_global_value = @@global.transaction_prealloc_size; +SELECT @start_global_value; +@start_global_value +4096 +SET @start_session_value = @@session.transaction_prealloc_size; +SELECT @start_session_value; +@start_session_value +4096 +'Bug# 34876: This variable has invalid default value as compared to documentation'; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.transaction_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4096 +SET @@session.transaction_prealloc_size = 200; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '200' +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4096 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.transaction_prealloc_size = DEFAULT; +SELECT @@global.transaction_prealloc_size = 4096; +@@global.transaction_prealloc_size = 4096 +1 +SET @@session.transaction_prealloc_size = DEFAULT; +SELECT @@session.transaction_prealloc_size = 4096; +@@session.transaction_prealloc_size = 4096 +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.transaction_prealloc_size = 1024; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = 60020; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +59392 +SET @@global.transaction_prealloc_size = 4294966272; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4294966272 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.transaction_prealloc_size = 1024; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size =4294966272; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4294966272 +SET @@session.transaction_prealloc_size = 65535; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +64512 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.transaction_prealloc_size = 0; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = -1024; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.transaction_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@global.transaction_prealloc_size = 65530.34; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size ="Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@global.transaction_prealloc_size = 1000; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1000' +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = ON; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = OFF; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = True; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '1' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = False; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '0' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +1024 +SET @@session.transaction_prealloc_size = "Test"; +ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = 123456789031; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +123456788480 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; +@@global.transaction_prealloc_size = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='transaction_prealloc_size'; +@@session.transaction_prealloc_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.transaction_prealloc_size = 1024; +SET @@global.transaction_prealloc_size = 10; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' +SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; +@@transaction_prealloc_size = @@global.transaction_prealloc_size +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@transaction_prealloc_size = 100; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '100' +SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size; +@@transaction_prealloc_size = @@local.transaction_prealloc_size +1 +SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size; +@@local.transaction_prealloc_size = @@session.transaction_prealloc_size +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET transaction_prealloc_size = 1027; +SELECT @@transaction_prealloc_size; +@@transaction_prealloc_size +1024 +SELECT local.transaction_prealloc_size; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.transaction_prealloc_size; +ERROR 42S02: Unknown table 'session' in field list +SELECT transaction_prealloc_size = @@session.transaction_prealloc_size; +ERROR 42S22: Unknown column 'transaction_prealloc_size' in 'field list' +SET @@global.transaction_prealloc_size = @start_global_value; +SELECT @@global.transaction_prealloc_size; +@@global.transaction_prealloc_size +4096 +SET @@session.transaction_prealloc_size = @start_session_value; +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +4096 diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result new file mode 100644 index 00000000000..ae03e677e56 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic_32.result @@ -0,0 +1,129 @@ +SET @start_global_value = @@global.wait_timeout; +SET @start_session_value = @@session.wait_timeout; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.wait_timeout = 100; +SET @@global.wait_timeout = DEFAULT; +SELECT @@global.wait_timeout; +@@global.wait_timeout +28800 +SET @@session.wait_timeout = 200; +SET @@session.wait_timeout = DEFAULT; +SELECT @@session.wait_timeout; +@@session.wait_timeout +28800 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.wait_timeout = DEFAULT; +SELECT @@global.wait_timeout = @default_wait_timeout; +@@global.wait_timeout = @default_wait_timeout +1 +SET @@session.wait_timeout = DEFAULT; +SELECT @@session.wait_timeout = @default_wait_timeout; +@@session.wait_timeout = @default_wait_timeout +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.wait_timeout= 1; +SELECT @@global.wait_timeout; +@@global.wait_timeout +1 +SET @@global.wait_timeout = 60020; +SELECT @@global.wait_timeout; +@@global.wait_timeout +60020 +SET @@global.wait_timeout = 31536000; +SELECT @@global.wait_timeout = @max_wait_timeout; +@@global.wait_timeout = @max_wait_timeout +1 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.wait_timeout =6000; +SELECT @@session.wait_timeout; +@@session.wait_timeout +6000 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.wait_timeout = 0; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +SET @@global.wait_timeout = -1024; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.wait_timeout = ON; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@global.wait_timeout = OFF; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@global.wait_timeout = True; +SELECT @@global.wait_timeout; +@@global.wait_timeout +1 +SET @@global.wait_timeout = False; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +SELECT @@global.wait_timeout; +@@global.wait_timeout +1 +SET @@global.wait_timeout = 65530.34; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@global.wait_timeout ="Test"; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = ON; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = OFF; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = True; +SELECT @@session.wait_timeout; +@@session.wait_timeout +1 +SET @@session.wait_timeout = False; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +SELECT @@session.wait_timeout; +@@session.wait_timeout +1 +SET @@session.wait_timeout = "Test"; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = 'test'; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = 123456789031; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '123456789031' +SELECT @@session.wait_timeout = @max_wait_timeout; +@@session.wait_timeout = @max_wait_timeout +1 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.wait_timeout = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='wait_timeout'; +@@global.wait_timeout = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.wait_timeout = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='wait_timeout'; +@@session.wait_timeout = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.wait_timeout = 30000; +SET @@global.wait_timeout = 40000; +SELECT @@wait_timeout = @@global.wait_timeout; +@@wait_timeout = @@global.wait_timeout +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@wait_timeout = 100; +SELECT @@wait_timeout = @@local.wait_timeout; +@@wait_timeout = @@local.wait_timeout +1 +SELECT @@local.wait_timeout = @@session.wait_timeout; +@@local.wait_timeout = @@session.wait_timeout +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET wait_timeout = 1027; +SELECT @@wait_timeout; +@@wait_timeout +1027 +SELECT local.wait_timeout; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.wait_timeout; +ERROR 42S02: Unknown table 'session' in field list +SELECT wait_timeout = @@session.wait_timeout; +ERROR 42S22: Unknown column 'wait_timeout' in 'field list' +SET @@global.wait_timeout = @start_global_value; +SET @@session.wait_timeout = @start_session_value; diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result b/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result new file mode 100644 index 00000000000..ae03e677e56 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/wait_timeout_basic_64.result @@ -0,0 +1,129 @@ +SET @start_global_value = @@global.wait_timeout; +SET @start_session_value = @@session.wait_timeout; +'#--------------------FN_DYNVARS_005_01-------------------------#' +SET @@global.wait_timeout = 100; +SET @@global.wait_timeout = DEFAULT; +SELECT @@global.wait_timeout; +@@global.wait_timeout +28800 +SET @@session.wait_timeout = 200; +SET @@session.wait_timeout = DEFAULT; +SELECT @@session.wait_timeout; +@@session.wait_timeout +28800 +'#--------------------FN_DYNVARS_005_02-------------------------#' +SET @@global.wait_timeout = DEFAULT; +SELECT @@global.wait_timeout = @default_wait_timeout; +@@global.wait_timeout = @default_wait_timeout +1 +SET @@session.wait_timeout = DEFAULT; +SELECT @@session.wait_timeout = @default_wait_timeout; +@@session.wait_timeout = @default_wait_timeout +1 +'#--------------------FN_DYNVARS_005_03-------------------------#' +SET @@global.wait_timeout= 1; +SELECT @@global.wait_timeout; +@@global.wait_timeout +1 +SET @@global.wait_timeout = 60020; +SELECT @@global.wait_timeout; +@@global.wait_timeout +60020 +SET @@global.wait_timeout = 31536000; +SELECT @@global.wait_timeout = @max_wait_timeout; +@@global.wait_timeout = @max_wait_timeout +1 +'#--------------------FN_DYNVARS_005_04-------------------------#' +SET @@session.wait_timeout =6000; +SELECT @@session.wait_timeout; +@@session.wait_timeout +6000 +'#------------------FN_DYNVARS_005_05-----------------------#' +SET @@global.wait_timeout = 0; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +SET @@global.wait_timeout = -1024; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +'Bug # 34837: Errors are not coming on assigning invalid values to variable'; +SET @@global.wait_timeout = ON; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@global.wait_timeout = OFF; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@global.wait_timeout = True; +SELECT @@global.wait_timeout; +@@global.wait_timeout +1 +SET @@global.wait_timeout = False; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +SELECT @@global.wait_timeout; +@@global.wait_timeout +1 +SET @@global.wait_timeout = 65530.34; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@global.wait_timeout ="Test"; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = ON; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = OFF; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = True; +SELECT @@session.wait_timeout; +@@session.wait_timeout +1 +SET @@session.wait_timeout = False; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '0' +SELECT @@session.wait_timeout; +@@session.wait_timeout +1 +SET @@session.wait_timeout = "Test"; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = 'test'; +ERROR 42000: Incorrect argument type to variable 'wait_timeout' +SET @@session.wait_timeout = 123456789031; +Warnings: +Warning 1292 Truncated incorrect wait_timeout value: '123456789031' +SELECT @@session.wait_timeout = @max_wait_timeout; +@@session.wait_timeout = @max_wait_timeout +1 +'#------------------FN_DYNVARS_005_06-----------------------#' +SELECT @@global.wait_timeout = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='wait_timeout'; +@@global.wait_timeout = VARIABLE_VALUE +1 +'#------------------FN_DYNVARS_005_07-----------------------#' +SELECT @@session.wait_timeout = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='wait_timeout'; +@@session.wait_timeout = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_001_09----------------------#' +SET @@global.wait_timeout = 30000; +SET @@global.wait_timeout = 40000; +SELECT @@wait_timeout = @@global.wait_timeout; +@@wait_timeout = @@global.wait_timeout +0 +'#---------------------FN_DYNVARS_001_10----------------------#' +SET @@wait_timeout = 100; +SELECT @@wait_timeout = @@local.wait_timeout; +@@wait_timeout = @@local.wait_timeout +1 +SELECT @@local.wait_timeout = @@session.wait_timeout; +@@local.wait_timeout = @@session.wait_timeout +1 +'#---------------------FN_DYNVARS_001_11----------------------#' +SET wait_timeout = 1027; +SELECT @@wait_timeout; +@@wait_timeout +1027 +SELECT local.wait_timeout; +ERROR 42S02: Unknown table 'local' in field list +SELECT session.wait_timeout; +ERROR 42S02: Unknown table 'session' in field list +SELECT wait_timeout = @@session.wait_timeout; +ERROR 42S22: Unknown column 'wait_timeout' in 'field list' +SET @@global.wait_timeout = @start_global_value; +SET @@session.wait_timeout = @start_session_value; diff --git a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test new file mode 100644 index 00000000000..1c6d805683f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/binlog_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test new file mode 100644 index 00000000000..1074bb46069 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/binlog_cache_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/binlog_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test new file mode 100644 index 00000000000..84a90d42bec --- /dev/null +++ b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test new file mode 100644 index 00000000000..4727daf0b4b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/bulk_insert_buffer_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/bulk_insert_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test new file mode 100644 index 00000000000..7cbce057bec --- /dev/null +++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/delayed_insert_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test new file mode 100644 index 00000000000..fbc31e937fe --- /dev/null +++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/delayed_insert_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test new file mode 100644 index 00000000000..1e67d426f10 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/delayed_queue_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test new file mode 100644 index 00000000000..44d5839759c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/delayed_queue_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/delayed_queue_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test new file mode 100644 index 00000000000..13e1b205a4d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test new file mode 100644 index 00000000000..fc26c903de5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_concurrency_tickets_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/innodb_concurrency_tickets_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test new file mode 100644 index 00000000000..8396755844e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test new file mode 100644 index 00000000000..4744cee20d9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/innodb_max_purge_lag_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test new file mode 100644 index 00000000000..981b6c4e992 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test new file mode 100644 index 00000000000..ab7c01c5b6d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_sync_spin_loops_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/innodb_sync_spin_loops_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test new file mode 100644 index 00000000000..f6b35b89644 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/join_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test new file mode 100644 index 00000000000..5632471235f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/join_buffer_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/join_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test new file mode 100644 index 00000000000..086e51e185c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/key_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test new file mode 100644 index 00000000000..5604c56480b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_buffer_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/key_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test new file mode 100644 index 00000000000..8a234d9d300 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/key_cache_age_threshold_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test new file mode 100644 index 00000000000..32f98cba941 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_cache_age_threshold_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/key_cache_age_threshold_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test new file mode 100644 index 00000000000..db0c0bd67a2 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/key_cache_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test new file mode 100644 index 00000000000..7403d762dc4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_cache_block_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/key_cache_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test new file mode 100644 index 00000000000..fcc28438866 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/key_cache_division_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test new file mode 100644 index 00000000000..ac4dd1c96d3 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/key_cache_division_limit_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/key_cache_division_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/log_warnings_basic_32.test b/mysql-test/suite/sys_vars/t/log_warnings_basic_32.test new file mode 100644 index 00000000000..a63cbed2aa3 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/log_warnings_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/log_warnings_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/log_warnings_basic_64.test b/mysql-test/suite/sys_vars/t/log_warnings_basic_64.test new file mode 100644 index 00000000000..5a8ad5482a5 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/log_warnings_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/log_warnings_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test new file mode 100644 index 00000000000..51386b1f994 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/max_binlog_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test new file mode 100644 index 00000000000..c7c757341fa --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/max_binlog_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test new file mode 100644 index 00000000000..62c7ec71568 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/max_connect_errors_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test new file mode 100644 index 00000000000..f27135d53c7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_connect_errors_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/max_connect_errors_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test new file mode 100644 index 00000000000..180c41a5ecf --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/max_heap_table_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test new file mode 100644 index 00000000000..89d234f5399 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_heap_table_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/max_heap_table_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test new file mode 100644 index 00000000000..84d76c7cb43 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/max_seeks_for_key_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test new file mode 100644 index 00000000000..63c0c1d6a6b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_seeks_for_key_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/max_seeks_for_key_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test new file mode 100644 index 00000000000..95ce399e68e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/max_tmp_tables_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test new file mode 100644 index 00000000000..573e5a75230 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/max_tmp_tables_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test new file mode 100644 index 00000000000..b4953208976 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/max_write_lock_count_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test new file mode 100644 index 00000000000..b0c5dabac07 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_write_lock_count_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/max_write_lock_count_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test new file mode 100644 index 00000000000..de53be3cb7c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/min_examined_row_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test new file mode 100644 index 00000000000..449b5d5525e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/min_examined_row_limit_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/min_examined_row_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test b/mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test new file mode 100644 index 00000000000..f9db6632d33 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/multi_range_count_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/multi_range_count_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test b/mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test new file mode 100644 index 00000000000..12ad7588bbd --- /dev/null +++ b/mysql-test/suite/sys_vars/t/multi_range_count_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/multi_range_count_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test new file mode 100644 index 00000000000..6c0ff16bc6f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test new file mode 100644 index 00000000000..108cc2e2350 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_max_sort_file_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/myisam_max_sort_file_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test new file mode 100644 index 00000000000..f395ffe8ee0 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/myisam_repair_threads_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test new file mode 100644 index 00000000000..21ed5fd9c5f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_repair_threads_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/myisam_repair_threads_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test new file mode 100644 index 00000000000..9c4116758f7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test new file mode 100644 index 00000000000..70f8a33ed4d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/myisam_sort_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test b/mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test new file mode 100644 index 00000000000..56f0e56f100 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/net_retry_count_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/net_retry_count_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test b/mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test new file mode 100644 index 00000000000..cb1fe8beebb --- /dev/null +++ b/mysql-test/suite/sys_vars/t/net_retry_count_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/net_retry_count_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test new file mode 100644 index 00000000000..471b48c3059 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/query_alloc_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test new file mode 100644 index 00000000000..64517899171 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_alloc_block_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/query_alloc_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test new file mode 100644 index 00000000000..0416fc46349 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/query_cache_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test new file mode 100644 index 00000000000..0d134449bf9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_cache_limit_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/query_cache_limit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test new file mode 100644 index 00000000000..1288157d102 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/query_cache_min_res_unit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test new file mode 100644 index 00000000000..e941b55ab52 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_cache_min_res_unit_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/query_cache_min_res_unit_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test new file mode 100644 index 00000000000..17fd1bb41ab --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_cache_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/query_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test new file mode 100644 index 00000000000..ba0cddc5a3a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_cache_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/query_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test new file mode 100644 index 00000000000..34dafc71c9c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/query_prealloc_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test new file mode 100644 index 00000000000..c1f04c0788c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/query_prealloc_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test new file mode 100644 index 00000000000..14cdc82f7c4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/range_alloc_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test new file mode 100644 index 00000000000..a4125b14fd0 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/range_alloc_block_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/range_alloc_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test new file mode 100644 index 00000000000..c28282dd38b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/rpl_recovery_rank_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test new file mode 100644 index 00000000000..51895efa65e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/rpl_recovery_rank_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_32.test b/mysql-test/suite/sys_vars/t/server_id_basic_32.test new file mode 100644 index 00000000000..e01b271e002 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/server_id_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/server_id_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/server_id_basic_64.test b/mysql-test/suite/sys_vars/t/server_id_basic_64.test new file mode 100644 index 00000000000..4ef870aa977 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/server_id_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/server_id_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test new file mode 100644 index 00000000000..8f3147ddab4 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/slave_transaction_retries_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test new file mode 100644 index 00000000000..dfd52507f61 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_transaction_retries_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/slave_transaction_retries_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test new file mode 100644 index 00000000000..d63cc997f5b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/sort_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test new file mode 100644 index 00000000000..4c7a16bd014 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sort_buffer_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/sort_buffer_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test new file mode 100644 index 00000000000..275b95cf775 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sync_binlog_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/sync_binlog_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test b/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test new file mode 100644 index 00000000000..e6f9bf668a0 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/sync_binlog_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/sync_binlog_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_32.test b/mysql-test/suite/sys_vars/t/timestamp_basic_32.test new file mode 100644 index 00000000000..a2b6139aef9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/timestamp_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/timestamp_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic_64.test b/mysql-test/suite/sys_vars/t/timestamp_basic_64.test new file mode 100644 index 00000000000..fbc86316ed9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/timestamp_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/timestamp_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test new file mode 100644 index 00000000000..c772b5c896c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/tmp_table_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test new file mode 100644 index 00000000000..46b3f65be9a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/tmp_table_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/tmp_table_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test new file mode 100644 index 00000000000..b9fbf429220 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test new file mode 100644 index 00000000000..fb68245ee62 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/transaction_alloc_block_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test new file mode 100644 index 00000000000..23ea53334ff --- /dev/null +++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/transaction_prealloc_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test new file mode 100644 index 00000000000..79a18585e80 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/transaction_prealloc_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test new file mode 100644 index 00000000000..613a5543b14 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic_32.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/wait_timeout_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test b/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test new file mode 100644 index 00000000000..d1138cbc105 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/wait_timeout_basic_64.test @@ -0,0 +1,9 @@ +################################################################################ +# Created by Horst Hunger 2008-05-07 # +# # +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/wait_timeout_basic.inc + From 7750753312d8d94cefeb65c50846822302dca1d1 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 23 Jul 2008 16:34:02 +0200 Subject: [PATCH 130/352] BUG#37733: rpl.rpl_flushlog_loop 'row' fails sporadically on pushbuild BUG#37884: rpl_row_basic_2myisam and rpl_row_basic_3innodb fail sporadically in pushbuild These have been fixed in 5.1-rpl. Re-applying fix for BUG#37884 in 5.1-bugteam, and disabling rpl_flushlog_loop for BUG#37733 in 5.1-bugteam. --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 4 ++++ mysql-test/suite/rpl/t/disabled.def | 1 + 2 files changed, 5 insertions(+) diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 4be7ad54cb3..f609b644726 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -354,6 +354,7 @@ CREATE TABLE t7 (i INT NOT NULL, connection master; INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +sync_slave_with_master; let $diff_table_1=master:test.t1; let $diff_table_2=slave:test.t1; @@ -363,6 +364,7 @@ source include/diff_tables.inc; connection master; INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +sync_slave_with_master; let $diff_table_1=master:test.t2; let $diff_table_2=slave:test.t2; @@ -387,6 +389,7 @@ source include/wait_for_slave_to_start.inc; connection master; INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +sync_slave_with_master; let $diff_table_1=master:test.t4; let $diff_table_2=slave:test.t4; @@ -426,6 +429,7 @@ source include/wait_for_slave_to_start.inc; connection master; INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +sync_slave_with_master; let $diff_table_1=master:test.t7; let $diff_table_2=slave:test.t7; diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 43a379dbe03..a8c83d58884 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -13,3 +13,4 @@ rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_innodb_bug28430 : Failure on Solaris Bug #36793 rpl_temporary : BUG#38269 2008-07-21 Sven valgrind error in pushbuild +rpl_flushlog_loop : BUG#37733 2008-07-23 Sven disabled in 5.1-bugteam. the bug has been fixed in 5.1-rpl: please re-enable when that gets pushed to main From fc0f24812f9ac23e55489f9c3b97e38c6033aac7 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 23 Jul 2008 18:56:39 +0200 Subject: [PATCH 131/352] BUG#38068: binlog_stm_binlog fails sporadically in pushbuild Problem: binlog_stm_binlog runs INSERT DELAYED queries, and then prints the contents of the binlog. Before checking the contents of the binlog, the test waits until the rows have appeared in the table. However, this is not enough, since INSERT DELAYED does not write rows to the binlog at the same time as it writes them to the table. So there is a race. Fix: Add a FLUSH TABLES before SHOW BINLOG EVENTS. That waits until the insert_delayed thread is done. --- .../binlog_tests/binlog_insert_delayed.test | 56 +++++++++++++------ .../suite/binlog/r/binlog_stm_binlog.result | 4 +- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test index d073c8ef227..c99d0b86be3 100644 --- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test +++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test @@ -1,17 +1,43 @@ -# Test of binlogging of INSERT_ID with INSERT DELAYED +# ==== Purpose ==== +# +# Verify that INSERT DELAYED in mixed or row mode writes events to the +# binlog, and that AUTO_INCREMENT works correctly. +# +# ==== Method ==== +# +# Insert both single and multiple rows into an autoincrement column, +# both with specified value and with NULL. +# +# With INSERT DELAYED, the rows do not show up in the table +# immediately, so we must do source include/wait_until_rows_count.inc +# between any two INSERT DELAYED statements. Moreover, if mixed or +# row-based logging is used, there is also a delay between when rows +# show up in the table and when they show up in the binlog. To ensure +# that the rows show up in the binlog, we call FLUSH TABLES, which +# waits until the delayed_insert thread has finished. +# +# We cannot read the binlog after executing INSERT DELAYED statements +# that insert multiple rows, because that is nondeterministic. More +# precisely, rows may be written in batches to the binlog, where each +# batch has one Table_map_log_event and one or more +# Write_rows_log_event. The number of rows included in each batch is +# nondeterministic. +# +# ==== Related bugs ==== +# +# BUG#20627: INSERT DELAYED does not honour auto_increment_* variables +# Bug in this test: BUG#38068: binlog_stm_binlog fails sporadically in pushbuild + + create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -# First, avoid BUG#20627: -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; -# Verify that only one INSERT_ID event is binlogged. -# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed + let $table=t1; -let $rows_inserted=11; # total number of inserted rows in this test +let $count=0; + insert delayed into t1 values (207); -let $count=1; - -# use this macro instead of sleeps. - +inc $count; --source include/wait_until_rows_count.inc + insert delayed into t1 values (null); inc $count; --source include/wait_until_rows_count.inc @@ -20,9 +46,10 @@ insert delayed into t1 values (300); inc $count; --source include/wait_until_rows_count.inc -# moving binlog check affront of multi-rows queries which work is indeterministic (extra table_maps) -# todo: better check is to substitute SHOW BINLOG with reading from binlog, probably bug#19459 is in -# the way +# It is not enough to wait until all rows have been inserted into the +# table. FLUSH TABLES ensures that they are in the binlog too. See +# comment above. +FLUSH TABLES; source include/show_binlog_events.inc; insert delayed into t1 values (null),(null),(null),(null); @@ -33,8 +60,5 @@ insert delayed into t1 values (null),(null),(400),(null); inc $count; inc $count; inc $count; inc $count; --source include/wait_until_rows_count.inc -#check this assertion about $count calculation ---echo $count == $rows_inserted - select * from t1; drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index 20d7281d5cc..ae8c1e11737 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -629,10 +629,10 @@ master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('An master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); +FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) @@ -660,9 +660,9 @@ master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; COMMIT +master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); -11 == 11 select * from t1; a 207 From 8ce74569f723f27269a3ea44785c2b7d7b76f485 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 24 Jul 2008 11:14:34 -0300 Subject: [PATCH 132/352] Cherry-pick Bug#33362 from mysql-5.1 --- mysql-test/r/query_cache_merge.result | 1672 +++++++++++++++++++++++++ mysql-test/t/query_cache_merge.test | 56 + sql/sql_cache.cc | 2 +- 3 files changed, 1729 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/query_cache_merge.result b/mysql-test/r/query_cache_merge.result index c6df4266de2..f47d3b35119 100644 --- a/mysql-test/r/query_cache_merge.result +++ b/mysql-test/r/query_cache_merge.result @@ -18,3 +18,1675 @@ Variable_name Value Qcache_queries_in_cache 0 drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t257,t00; SET @@global.query_cache_size=0; +CREATE TABLE t255 (a INT); +INSERT INTO t255 VALUES (255); +CREATE TABLE t254 (a INT); +INSERT INTO t254 VALUES (254); +CREATE TABLE t253 (a INT); +INSERT INTO t253 VALUES (253); +CREATE TABLE t252 (a INT); +INSERT INTO t252 VALUES (252); +CREATE TABLE t251 (a INT); +INSERT INTO t251 VALUES (251); +CREATE TABLE t250 (a INT); +INSERT INTO t250 VALUES (250); +CREATE TABLE t249 (a INT); +INSERT INTO t249 VALUES (249); +CREATE TABLE t248 (a INT); +INSERT INTO t248 VALUES (248); +CREATE TABLE t247 (a INT); +INSERT INTO t247 VALUES (247); +CREATE TABLE t246 (a INT); +INSERT INTO t246 VALUES (246); +CREATE TABLE t245 (a INT); +INSERT INTO t245 VALUES (245); +CREATE TABLE t244 (a INT); +INSERT INTO t244 VALUES (244); +CREATE TABLE t243 (a INT); +INSERT INTO t243 VALUES (243); +CREATE TABLE t242 (a INT); +INSERT INTO t242 VALUES (242); +CREATE TABLE t241 (a INT); +INSERT INTO t241 VALUES (241); +CREATE TABLE t240 (a INT); +INSERT INTO t240 VALUES (240); +CREATE TABLE t239 (a INT); +INSERT INTO t239 VALUES (239); +CREATE TABLE t238 (a INT); +INSERT INTO t238 VALUES (238); +CREATE TABLE t237 (a INT); +INSERT INTO t237 VALUES (237); +CREATE TABLE t236 (a INT); +INSERT INTO t236 VALUES (236); +CREATE TABLE t235 (a INT); +INSERT INTO t235 VALUES (235); +CREATE TABLE t234 (a INT); +INSERT INTO t234 VALUES (234); +CREATE TABLE t233 (a INT); +INSERT INTO t233 VALUES (233); +CREATE TABLE t232 (a INT); +INSERT INTO t232 VALUES (232); +CREATE TABLE t231 (a INT); +INSERT INTO t231 VALUES (231); +CREATE TABLE t230 (a INT); +INSERT INTO t230 VALUES (230); +CREATE TABLE t229 (a INT); +INSERT INTO t229 VALUES (229); +CREATE TABLE t228 (a INT); +INSERT INTO t228 VALUES (228); +CREATE TABLE t227 (a INT); +INSERT INTO t227 VALUES (227); +CREATE TABLE t226 (a INT); +INSERT INTO t226 VALUES (226); +CREATE TABLE t225 (a INT); +INSERT INTO t225 VALUES (225); +CREATE TABLE t224 (a INT); +INSERT INTO t224 VALUES (224); +CREATE TABLE t223 (a INT); +INSERT INTO t223 VALUES (223); +CREATE TABLE t222 (a INT); +INSERT INTO t222 VALUES (222); +CREATE TABLE t221 (a INT); +INSERT INTO t221 VALUES (221); +CREATE TABLE t220 (a INT); +INSERT INTO t220 VALUES (220); +CREATE TABLE t219 (a INT); +INSERT INTO t219 VALUES (219); +CREATE TABLE t218 (a INT); +INSERT INTO t218 VALUES (218); +CREATE TABLE t217 (a INT); +INSERT INTO t217 VALUES (217); +CREATE TABLE t216 (a INT); +INSERT INTO t216 VALUES (216); +CREATE TABLE t215 (a INT); +INSERT INTO t215 VALUES (215); +CREATE TABLE t214 (a INT); +INSERT INTO t214 VALUES (214); +CREATE TABLE t213 (a INT); +INSERT INTO t213 VALUES (213); +CREATE TABLE t212 (a INT); +INSERT INTO t212 VALUES (212); +CREATE TABLE t211 (a INT); +INSERT INTO t211 VALUES (211); +CREATE TABLE t210 (a INT); +INSERT INTO t210 VALUES (210); +CREATE TABLE t209 (a INT); +INSERT INTO t209 VALUES (209); +CREATE TABLE t208 (a INT); +INSERT INTO t208 VALUES (208); +CREATE TABLE t207 (a INT); +INSERT INTO t207 VALUES (207); +CREATE TABLE t206 (a INT); +INSERT INTO t206 VALUES (206); +CREATE TABLE t205 (a INT); +INSERT INTO t205 VALUES (205); +CREATE TABLE t204 (a INT); +INSERT INTO t204 VALUES (204); +CREATE TABLE t203 (a INT); +INSERT INTO t203 VALUES (203); +CREATE TABLE t202 (a INT); +INSERT INTO t202 VALUES (202); +CREATE TABLE t201 (a INT); +INSERT INTO t201 VALUES (201); +CREATE TABLE t200 (a INT); +INSERT INTO t200 VALUES (200); +CREATE TABLE t199 (a INT); +INSERT INTO t199 VALUES (199); +CREATE TABLE t198 (a INT); +INSERT INTO t198 VALUES (198); +CREATE TABLE t197 (a INT); +INSERT INTO t197 VALUES (197); +CREATE TABLE t196 (a INT); +INSERT INTO t196 VALUES (196); +CREATE TABLE t195 (a INT); +INSERT INTO t195 VALUES (195); +CREATE TABLE t194 (a INT); +INSERT INTO t194 VALUES (194); +CREATE TABLE t193 (a INT); +INSERT INTO t193 VALUES (193); +CREATE TABLE t192 (a INT); +INSERT INTO t192 VALUES (192); +CREATE TABLE t191 (a INT); +INSERT INTO t191 VALUES (191); +CREATE TABLE t190 (a INT); +INSERT INTO t190 VALUES (190); +CREATE TABLE t189 (a INT); +INSERT INTO t189 VALUES (189); +CREATE TABLE t188 (a INT); +INSERT INTO t188 VALUES (188); +CREATE TABLE t187 (a INT); +INSERT INTO t187 VALUES (187); +CREATE TABLE t186 (a INT); +INSERT INTO t186 VALUES (186); +CREATE TABLE t185 (a INT); +INSERT INTO t185 VALUES (185); +CREATE TABLE t184 (a INT); +INSERT INTO t184 VALUES (184); +CREATE TABLE t183 (a INT); +INSERT INTO t183 VALUES (183); +CREATE TABLE t182 (a INT); +INSERT INTO t182 VALUES (182); +CREATE TABLE t181 (a INT); +INSERT INTO t181 VALUES (181); +CREATE TABLE t180 (a INT); +INSERT INTO t180 VALUES (180); +CREATE TABLE t179 (a INT); +INSERT INTO t179 VALUES (179); +CREATE TABLE t178 (a INT); +INSERT INTO t178 VALUES (178); +CREATE TABLE t177 (a INT); +INSERT INTO t177 VALUES (177); +CREATE TABLE t176 (a INT); +INSERT INTO t176 VALUES (176); +CREATE TABLE t175 (a INT); +INSERT INTO t175 VALUES (175); +CREATE TABLE t174 (a INT); +INSERT INTO t174 VALUES (174); +CREATE TABLE t173 (a INT); +INSERT INTO t173 VALUES (173); +CREATE TABLE t172 (a INT); +INSERT INTO t172 VALUES (172); +CREATE TABLE t171 (a INT); +INSERT INTO t171 VALUES (171); +CREATE TABLE t170 (a INT); +INSERT INTO t170 VALUES (170); +CREATE TABLE t169 (a INT); +INSERT INTO t169 VALUES (169); +CREATE TABLE t168 (a INT); +INSERT INTO t168 VALUES (168); +CREATE TABLE t167 (a INT); +INSERT INTO t167 VALUES (167); +CREATE TABLE t166 (a INT); +INSERT INTO t166 VALUES (166); +CREATE TABLE t165 (a INT); +INSERT INTO t165 VALUES (165); +CREATE TABLE t164 (a INT); +INSERT INTO t164 VALUES (164); +CREATE TABLE t163 (a INT); +INSERT INTO t163 VALUES (163); +CREATE TABLE t162 (a INT); +INSERT INTO t162 VALUES (162); +CREATE TABLE t161 (a INT); +INSERT INTO t161 VALUES (161); +CREATE TABLE t160 (a INT); +INSERT INTO t160 VALUES (160); +CREATE TABLE t159 (a INT); +INSERT INTO t159 VALUES (159); +CREATE TABLE t158 (a INT); +INSERT INTO t158 VALUES (158); +CREATE TABLE t157 (a INT); +INSERT INTO t157 VALUES (157); +CREATE TABLE t156 (a INT); +INSERT INTO t156 VALUES (156); +CREATE TABLE t155 (a INT); +INSERT INTO t155 VALUES (155); +CREATE TABLE t154 (a INT); +INSERT INTO t154 VALUES (154); +CREATE TABLE t153 (a INT); +INSERT INTO t153 VALUES (153); +CREATE TABLE t152 (a INT); +INSERT INTO t152 VALUES (152); +CREATE TABLE t151 (a INT); +INSERT INTO t151 VALUES (151); +CREATE TABLE t150 (a INT); +INSERT INTO t150 VALUES (150); +CREATE TABLE t149 (a INT); +INSERT INTO t149 VALUES (149); +CREATE TABLE t148 (a INT); +INSERT INTO t148 VALUES (148); +CREATE TABLE t147 (a INT); +INSERT INTO t147 VALUES (147); +CREATE TABLE t146 (a INT); +INSERT INTO t146 VALUES (146); +CREATE TABLE t145 (a INT); +INSERT INTO t145 VALUES (145); +CREATE TABLE t144 (a INT); +INSERT INTO t144 VALUES (144); +CREATE TABLE t143 (a INT); +INSERT INTO t143 VALUES (143); +CREATE TABLE t142 (a INT); +INSERT INTO t142 VALUES (142); +CREATE TABLE t141 (a INT); +INSERT INTO t141 VALUES (141); +CREATE TABLE t140 (a INT); +INSERT INTO t140 VALUES (140); +CREATE TABLE t139 (a INT); +INSERT INTO t139 VALUES (139); +CREATE TABLE t138 (a INT); +INSERT INTO t138 VALUES (138); +CREATE TABLE t137 (a INT); +INSERT INTO t137 VALUES (137); +CREATE TABLE t136 (a INT); +INSERT INTO t136 VALUES (136); +CREATE TABLE t135 (a INT); +INSERT INTO t135 VALUES (135); +CREATE TABLE t134 (a INT); +INSERT INTO t134 VALUES (134); +CREATE TABLE t133 (a INT); +INSERT INTO t133 VALUES (133); +CREATE TABLE t132 (a INT); +INSERT INTO t132 VALUES (132); +CREATE TABLE t131 (a INT); +INSERT INTO t131 VALUES (131); +CREATE TABLE t130 (a INT); +INSERT INTO t130 VALUES (130); +CREATE TABLE t129 (a INT); +INSERT INTO t129 VALUES (129); +CREATE TABLE t128 (a INT); +INSERT INTO t128 VALUES (128); +CREATE TABLE t127 (a INT); +INSERT INTO t127 VALUES (127); +CREATE TABLE t126 (a INT); +INSERT INTO t126 VALUES (126); +CREATE TABLE t125 (a INT); +INSERT INTO t125 VALUES (125); +CREATE TABLE t124 (a INT); +INSERT INTO t124 VALUES (124); +CREATE TABLE t123 (a INT); +INSERT INTO t123 VALUES (123); +CREATE TABLE t122 (a INT); +INSERT INTO t122 VALUES (122); +CREATE TABLE t121 (a INT); +INSERT INTO t121 VALUES (121); +CREATE TABLE t120 (a INT); +INSERT INTO t120 VALUES (120); +CREATE TABLE t119 (a INT); +INSERT INTO t119 VALUES (119); +CREATE TABLE t118 (a INT); +INSERT INTO t118 VALUES (118); +CREATE TABLE t117 (a INT); +INSERT INTO t117 VALUES (117); +CREATE TABLE t116 (a INT); +INSERT INTO t116 VALUES (116); +CREATE TABLE t115 (a INT); +INSERT INTO t115 VALUES (115); +CREATE TABLE t114 (a INT); +INSERT INTO t114 VALUES (114); +CREATE TABLE t113 (a INT); +INSERT INTO t113 VALUES (113); +CREATE TABLE t112 (a INT); +INSERT INTO t112 VALUES (112); +CREATE TABLE t111 (a INT); +INSERT INTO t111 VALUES (111); +CREATE TABLE t110 (a INT); +INSERT INTO t110 VALUES (110); +CREATE TABLE t109 (a INT); +INSERT INTO t109 VALUES (109); +CREATE TABLE t108 (a INT); +INSERT INTO t108 VALUES (108); +CREATE TABLE t107 (a INT); +INSERT INTO t107 VALUES (107); +CREATE TABLE t106 (a INT); +INSERT INTO t106 VALUES (106); +CREATE TABLE t105 (a INT); +INSERT INTO t105 VALUES (105); +CREATE TABLE t104 (a INT); +INSERT INTO t104 VALUES (104); +CREATE TABLE t103 (a INT); +INSERT INTO t103 VALUES (103); +CREATE TABLE t102 (a INT); +INSERT INTO t102 VALUES (102); +CREATE TABLE t101 (a INT); +INSERT INTO t101 VALUES (101); +CREATE TABLE t100 (a INT); +INSERT INTO t100 VALUES (100); +CREATE TABLE t99 (a INT); +INSERT INTO t99 VALUES (99); +CREATE TABLE t98 (a INT); +INSERT INTO t98 VALUES (98); +CREATE TABLE t97 (a INT); +INSERT INTO t97 VALUES (97); +CREATE TABLE t96 (a INT); +INSERT INTO t96 VALUES (96); +CREATE TABLE t95 (a INT); +INSERT INTO t95 VALUES (95); +CREATE TABLE t94 (a INT); +INSERT INTO t94 VALUES (94); +CREATE TABLE t93 (a INT); +INSERT INTO t93 VALUES (93); +CREATE TABLE t92 (a INT); +INSERT INTO t92 VALUES (92); +CREATE TABLE t91 (a INT); +INSERT INTO t91 VALUES (91); +CREATE TABLE t90 (a INT); +INSERT INTO t90 VALUES (90); +CREATE TABLE t89 (a INT); +INSERT INTO t89 VALUES (89); +CREATE TABLE t88 (a INT); +INSERT INTO t88 VALUES (88); +CREATE TABLE t87 (a INT); +INSERT INTO t87 VALUES (87); +CREATE TABLE t86 (a INT); +INSERT INTO t86 VALUES (86); +CREATE TABLE t85 (a INT); +INSERT INTO t85 VALUES (85); +CREATE TABLE t84 (a INT); +INSERT INTO t84 VALUES (84); +CREATE TABLE t83 (a INT); +INSERT INTO t83 VALUES (83); +CREATE TABLE t82 (a INT); +INSERT INTO t82 VALUES (82); +CREATE TABLE t81 (a INT); +INSERT INTO t81 VALUES (81); +CREATE TABLE t80 (a INT); +INSERT INTO t80 VALUES (80); +CREATE TABLE t79 (a INT); +INSERT INTO t79 VALUES (79); +CREATE TABLE t78 (a INT); +INSERT INTO t78 VALUES (78); +CREATE TABLE t77 (a INT); +INSERT INTO t77 VALUES (77); +CREATE TABLE t76 (a INT); +INSERT INTO t76 VALUES (76); +CREATE TABLE t75 (a INT); +INSERT INTO t75 VALUES (75); +CREATE TABLE t74 (a INT); +INSERT INTO t74 VALUES (74); +CREATE TABLE t73 (a INT); +INSERT INTO t73 VALUES (73); +CREATE TABLE t72 (a INT); +INSERT INTO t72 VALUES (72); +CREATE TABLE t71 (a INT); +INSERT INTO t71 VALUES (71); +CREATE TABLE t70 (a INT); +INSERT INTO t70 VALUES (70); +CREATE TABLE t69 (a INT); +INSERT INTO t69 VALUES (69); +CREATE TABLE t68 (a INT); +INSERT INTO t68 VALUES (68); +CREATE TABLE t67 (a INT); +INSERT INTO t67 VALUES (67); +CREATE TABLE t66 (a INT); +INSERT INTO t66 VALUES (66); +CREATE TABLE t65 (a INT); +INSERT INTO t65 VALUES (65); +CREATE TABLE t64 (a INT); +INSERT INTO t64 VALUES (64); +CREATE TABLE t63 (a INT); +INSERT INTO t63 VALUES (63); +CREATE TABLE t62 (a INT); +INSERT INTO t62 VALUES (62); +CREATE TABLE t61 (a INT); +INSERT INTO t61 VALUES (61); +CREATE TABLE t60 (a INT); +INSERT INTO t60 VALUES (60); +CREATE TABLE t59 (a INT); +INSERT INTO t59 VALUES (59); +CREATE TABLE t58 (a INT); +INSERT INTO t58 VALUES (58); +CREATE TABLE t57 (a INT); +INSERT INTO t57 VALUES (57); +CREATE TABLE t56 (a INT); +INSERT INTO t56 VALUES (56); +CREATE TABLE t55 (a INT); +INSERT INTO t55 VALUES (55); +CREATE TABLE t54 (a INT); +INSERT INTO t54 VALUES (54); +CREATE TABLE t53 (a INT); +INSERT INTO t53 VALUES (53); +CREATE TABLE t52 (a INT); +INSERT INTO t52 VALUES (52); +CREATE TABLE t51 (a INT); +INSERT INTO t51 VALUES (51); +CREATE TABLE t50 (a INT); +INSERT INTO t50 VALUES (50); +CREATE TABLE t49 (a INT); +INSERT INTO t49 VALUES (49); +CREATE TABLE t48 (a INT); +INSERT INTO t48 VALUES (48); +CREATE TABLE t47 (a INT); +INSERT INTO t47 VALUES (47); +CREATE TABLE t46 (a INT); +INSERT INTO t46 VALUES (46); +CREATE TABLE t45 (a INT); +INSERT INTO t45 VALUES (45); +CREATE TABLE t44 (a INT); +INSERT INTO t44 VALUES (44); +CREATE TABLE t43 (a INT); +INSERT INTO t43 VALUES (43); +CREATE TABLE t42 (a INT); +INSERT INTO t42 VALUES (42); +CREATE TABLE t41 (a INT); +INSERT INTO t41 VALUES (41); +CREATE TABLE t40 (a INT); +INSERT INTO t40 VALUES (40); +CREATE TABLE t39 (a INT); +INSERT INTO t39 VALUES (39); +CREATE TABLE t38 (a INT); +INSERT INTO t38 VALUES (38); +CREATE TABLE t37 (a INT); +INSERT INTO t37 VALUES (37); +CREATE TABLE t36 (a INT); +INSERT INTO t36 VALUES (36); +CREATE TABLE t35 (a INT); +INSERT INTO t35 VALUES (35); +CREATE TABLE t34 (a INT); +INSERT INTO t34 VALUES (34); +CREATE TABLE t33 (a INT); +INSERT INTO t33 VALUES (33); +CREATE TABLE t32 (a INT); +INSERT INTO t32 VALUES (32); +CREATE TABLE t31 (a INT); +INSERT INTO t31 VALUES (31); +CREATE TABLE t30 (a INT); +INSERT INTO t30 VALUES (30); +CREATE TABLE t29 (a INT); +INSERT INTO t29 VALUES (29); +CREATE TABLE t28 (a INT); +INSERT INTO t28 VALUES (28); +CREATE TABLE t27 (a INT); +INSERT INTO t27 VALUES (27); +CREATE TABLE t26 (a INT); +INSERT INTO t26 VALUES (26); +CREATE TABLE t25 (a INT); +INSERT INTO t25 VALUES (25); +CREATE TABLE t24 (a INT); +INSERT INTO t24 VALUES (24); +CREATE TABLE t23 (a INT); +INSERT INTO t23 VALUES (23); +CREATE TABLE t22 (a INT); +INSERT INTO t22 VALUES (22); +CREATE TABLE t21 (a INT); +INSERT INTO t21 VALUES (21); +CREATE TABLE t20 (a INT); +INSERT INTO t20 VALUES (20); +CREATE TABLE t19 (a INT); +INSERT INTO t19 VALUES (19); +CREATE TABLE t18 (a INT); +INSERT INTO t18 VALUES (18); +CREATE TABLE t17 (a INT); +INSERT INTO t17 VALUES (17); +CREATE TABLE t16 (a INT); +INSERT INTO t16 VALUES (16); +CREATE TABLE t15 (a INT); +INSERT INTO t15 VALUES (15); +CREATE TABLE t14 (a INT); +INSERT INTO t14 VALUES (14); +CREATE TABLE t13 (a INT); +INSERT INTO t13 VALUES (13); +CREATE TABLE t12 (a INT); +INSERT INTO t12 VALUES (12); +CREATE TABLE t11 (a INT); +INSERT INTO t11 VALUES (11); +CREATE TABLE t10 (a INT); +INSERT INTO t10 VALUES (10); +CREATE TABLE t9 (a INT); +INSERT INTO t9 VALUES (9); +CREATE TABLE t8 (a INT); +INSERT INTO t8 VALUES (8); +CREATE TABLE t7 (a INT); +INSERT INTO t7 VALUES (7); +CREATE TABLE t6 (a INT); +INSERT INTO t6 VALUES (6); +CREATE TABLE t5 (a INT); +INSERT INTO t5 VALUES (5); +CREATE TABLE t4 (a INT); +INSERT INTO t4 VALUES (4); +CREATE TABLE t3 (a INT); +INSERT INTO t3 VALUES (3); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (2); +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +CREATE TABLE t0 (a INT) ENGINE=MERGE UNION(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40,t41,t42,t43,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80,t81,t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120,t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t137,t138,t139,t140,t141,t142,t143,t144,t145,t146,t147,t148,t149,t150,t151,t152,t153,t154,t155,t156,t157,t158,t159,t160,t161,t162,t163,t164,t165,t166,t167,t168,t169,t170,t171,t172,t173,t174,t175,t176,t177,t178,t179,t180,t181,t182,t183,t184,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t196,t197,t198,t199,t200,t201,t202,t203,t204,t205,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t219,t220,t221,t222,t223,t224,t225,t226,t227,t228,t229,t230,t231,t232,t233,t234,t235,t236,t237,t238,t239,t240,t241,t242,t243,t244,t245,t246,t247,t248,t249,t250,t251,t252,t253,t254,t255); +SET GLOBAL query_cache_size = 1048576; +FLUSH STATUS; +SELECT a FROM t0 WHERE a = 1; +a +1 +SHOW STATUS LIKE "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +FLUSH TABLES; +TRUNCATE TABLE t255; +SELECT a FROM t1; +a +1 +TRUNCATE TABLE t254; +SELECT a FROM t2; +a +2 +TRUNCATE TABLE t253; +SELECT a FROM t3; +a +3 +TRUNCATE TABLE t252; +SELECT a FROM t4; +a +4 +TRUNCATE TABLE t251; +SELECT a FROM t5; +a +5 +TRUNCATE TABLE t250; +SELECT a FROM t6; +a +6 +TRUNCATE TABLE t249; +SELECT a FROM t7; +a +7 +TRUNCATE TABLE t248; +SELECT a FROM t8; +a +8 +TRUNCATE TABLE t247; +SELECT a FROM t9; +a +9 +TRUNCATE TABLE t246; +SELECT a FROM t10; +a +10 +TRUNCATE TABLE t245; +SELECT a FROM t11; +a +11 +TRUNCATE TABLE t244; +SELECT a FROM t12; +a +12 +TRUNCATE TABLE t243; +SELECT a FROM t13; +a +13 +TRUNCATE TABLE t242; +SELECT a FROM t14; +a +14 +TRUNCATE TABLE t241; +SELECT a FROM t15; +a +15 +TRUNCATE TABLE t240; +SELECT a FROM t16; +a +16 +TRUNCATE TABLE t239; +SELECT a FROM t17; +a +17 +TRUNCATE TABLE t238; +SELECT a FROM t18; +a +18 +TRUNCATE TABLE t237; +SELECT a FROM t19; +a +19 +TRUNCATE TABLE t236; +SELECT a FROM t20; +a +20 +TRUNCATE TABLE t235; +SELECT a FROM t21; +a +21 +TRUNCATE TABLE t234; +SELECT a FROM t22; +a +22 +TRUNCATE TABLE t233; +SELECT a FROM t23; +a +23 +TRUNCATE TABLE t232; +SELECT a FROM t24; +a +24 +TRUNCATE TABLE t231; +SELECT a FROM t25; +a +25 +TRUNCATE TABLE t230; +SELECT a FROM t26; +a +26 +TRUNCATE TABLE t229; +SELECT a FROM t27; +a +27 +TRUNCATE TABLE t228; +SELECT a FROM t28; +a +28 +TRUNCATE TABLE t227; +SELECT a FROM t29; +a +29 +TRUNCATE TABLE t226; +SELECT a FROM t30; +a +30 +TRUNCATE TABLE t225; +SELECT a FROM t31; +a +31 +TRUNCATE TABLE t224; +SELECT a FROM t32; +a +32 +TRUNCATE TABLE t223; +SELECT a FROM t33; +a +33 +TRUNCATE TABLE t222; +SELECT a FROM t34; +a +34 +TRUNCATE TABLE t221; +SELECT a FROM t35; +a +35 +TRUNCATE TABLE t220; +SELECT a FROM t36; +a +36 +TRUNCATE TABLE t219; +SELECT a FROM t37; +a +37 +TRUNCATE TABLE t218; +SELECT a FROM t38; +a +38 +TRUNCATE TABLE t217; +SELECT a FROM t39; +a +39 +TRUNCATE TABLE t216; +SELECT a FROM t40; +a +40 +TRUNCATE TABLE t215; +SELECT a FROM t41; +a +41 +TRUNCATE TABLE t214; +SELECT a FROM t42; +a +42 +TRUNCATE TABLE t213; +SELECT a FROM t43; +a +43 +TRUNCATE TABLE t212; +SELECT a FROM t44; +a +44 +TRUNCATE TABLE t211; +SELECT a FROM t45; +a +45 +TRUNCATE TABLE t210; +SELECT a FROM t46; +a +46 +TRUNCATE TABLE t209; +SELECT a FROM t47; +a +47 +TRUNCATE TABLE t208; +SELECT a FROM t48; +a +48 +TRUNCATE TABLE t207; +SELECT a FROM t49; +a +49 +TRUNCATE TABLE t206; +SELECT a FROM t50; +a +50 +TRUNCATE TABLE t205; +SELECT a FROM t51; +a +51 +TRUNCATE TABLE t204; +SELECT a FROM t52; +a +52 +TRUNCATE TABLE t203; +SELECT a FROM t53; +a +53 +TRUNCATE TABLE t202; +SELECT a FROM t54; +a +54 +TRUNCATE TABLE t201; +SELECT a FROM t55; +a +55 +TRUNCATE TABLE t200; +SELECT a FROM t56; +a +56 +TRUNCATE TABLE t199; +SELECT a FROM t57; +a +57 +TRUNCATE TABLE t198; +SELECT a FROM t58; +a +58 +TRUNCATE TABLE t197; +SELECT a FROM t59; +a +59 +TRUNCATE TABLE t196; +SELECT a FROM t60; +a +60 +TRUNCATE TABLE t195; +SELECT a FROM t61; +a +61 +TRUNCATE TABLE t194; +SELECT a FROM t62; +a +62 +TRUNCATE TABLE t193; +SELECT a FROM t63; +a +63 +TRUNCATE TABLE t192; +SELECT a FROM t64; +a +64 +TRUNCATE TABLE t191; +SELECT a FROM t65; +a +65 +TRUNCATE TABLE t190; +SELECT a FROM t66; +a +66 +TRUNCATE TABLE t189; +SELECT a FROM t67; +a +67 +TRUNCATE TABLE t188; +SELECT a FROM t68; +a +68 +TRUNCATE TABLE t187; +SELECT a FROM t69; +a +69 +TRUNCATE TABLE t186; +SELECT a FROM t70; +a +70 +TRUNCATE TABLE t185; +SELECT a FROM t71; +a +71 +TRUNCATE TABLE t184; +SELECT a FROM t72; +a +72 +TRUNCATE TABLE t183; +SELECT a FROM t73; +a +73 +TRUNCATE TABLE t182; +SELECT a FROM t74; +a +74 +TRUNCATE TABLE t181; +SELECT a FROM t75; +a +75 +TRUNCATE TABLE t180; +SELECT a FROM t76; +a +76 +TRUNCATE TABLE t179; +SELECT a FROM t77; +a +77 +TRUNCATE TABLE t178; +SELECT a FROM t78; +a +78 +TRUNCATE TABLE t177; +SELECT a FROM t79; +a +79 +TRUNCATE TABLE t176; +SELECT a FROM t80; +a +80 +TRUNCATE TABLE t175; +SELECT a FROM t81; +a +81 +TRUNCATE TABLE t174; +SELECT a FROM t82; +a +82 +TRUNCATE TABLE t173; +SELECT a FROM t83; +a +83 +TRUNCATE TABLE t172; +SELECT a FROM t84; +a +84 +TRUNCATE TABLE t171; +SELECT a FROM t85; +a +85 +TRUNCATE TABLE t170; +SELECT a FROM t86; +a +86 +TRUNCATE TABLE t169; +SELECT a FROM t87; +a +87 +TRUNCATE TABLE t168; +SELECT a FROM t88; +a +88 +TRUNCATE TABLE t167; +SELECT a FROM t89; +a +89 +TRUNCATE TABLE t166; +SELECT a FROM t90; +a +90 +TRUNCATE TABLE t165; +SELECT a FROM t91; +a +91 +TRUNCATE TABLE t164; +SELECT a FROM t92; +a +92 +TRUNCATE TABLE t163; +SELECT a FROM t93; +a +93 +TRUNCATE TABLE t162; +SELECT a FROM t94; +a +94 +TRUNCATE TABLE t161; +SELECT a FROM t95; +a +95 +TRUNCATE TABLE t160; +SELECT a FROM t96; +a +96 +TRUNCATE TABLE t159; +SELECT a FROM t97; +a +97 +TRUNCATE TABLE t158; +SELECT a FROM t98; +a +98 +TRUNCATE TABLE t157; +SELECT a FROM t99; +a +99 +TRUNCATE TABLE t156; +SELECT a FROM t100; +a +100 +TRUNCATE TABLE t155; +SELECT a FROM t101; +a +101 +TRUNCATE TABLE t154; +SELECT a FROM t102; +a +102 +TRUNCATE TABLE t153; +SELECT a FROM t103; +a +103 +TRUNCATE TABLE t152; +SELECT a FROM t104; +a +104 +TRUNCATE TABLE t151; +SELECT a FROM t105; +a +105 +TRUNCATE TABLE t150; +SELECT a FROM t106; +a +106 +TRUNCATE TABLE t149; +SELECT a FROM t107; +a +107 +TRUNCATE TABLE t148; +SELECT a FROM t108; +a +108 +TRUNCATE TABLE t147; +SELECT a FROM t109; +a +109 +TRUNCATE TABLE t146; +SELECT a FROM t110; +a +110 +TRUNCATE TABLE t145; +SELECT a FROM t111; +a +111 +TRUNCATE TABLE t144; +SELECT a FROM t112; +a +112 +TRUNCATE TABLE t143; +SELECT a FROM t113; +a +113 +TRUNCATE TABLE t142; +SELECT a FROM t114; +a +114 +TRUNCATE TABLE t141; +SELECT a FROM t115; +a +115 +TRUNCATE TABLE t140; +SELECT a FROM t116; +a +116 +TRUNCATE TABLE t139; +SELECT a FROM t117; +a +117 +TRUNCATE TABLE t138; +SELECT a FROM t118; +a +118 +TRUNCATE TABLE t137; +SELECT a FROM t119; +a +119 +TRUNCATE TABLE t136; +SELECT a FROM t120; +a +120 +TRUNCATE TABLE t135; +SELECT a FROM t121; +a +121 +TRUNCATE TABLE t134; +SELECT a FROM t122; +a +122 +TRUNCATE TABLE t133; +SELECT a FROM t123; +a +123 +TRUNCATE TABLE t132; +SELECT a FROM t124; +a +124 +TRUNCATE TABLE t131; +SELECT a FROM t125; +a +125 +TRUNCATE TABLE t130; +SELECT a FROM t126; +a +126 +TRUNCATE TABLE t129; +SELECT a FROM t127; +a +127 +TRUNCATE TABLE t128; +SELECT a FROM t128; +a +TRUNCATE TABLE t127; +SELECT a FROM t129; +a +TRUNCATE TABLE t126; +SELECT a FROM t130; +a +TRUNCATE TABLE t125; +SELECT a FROM t131; +a +TRUNCATE TABLE t124; +SELECT a FROM t132; +a +TRUNCATE TABLE t123; +SELECT a FROM t133; +a +TRUNCATE TABLE t122; +SELECT a FROM t134; +a +TRUNCATE TABLE t121; +SELECT a FROM t135; +a +TRUNCATE TABLE t120; +SELECT a FROM t136; +a +TRUNCATE TABLE t119; +SELECT a FROM t137; +a +TRUNCATE TABLE t118; +SELECT a FROM t138; +a +TRUNCATE TABLE t117; +SELECT a FROM t139; +a +TRUNCATE TABLE t116; +SELECT a FROM t140; +a +TRUNCATE TABLE t115; +SELECT a FROM t141; +a +TRUNCATE TABLE t114; +SELECT a FROM t142; +a +TRUNCATE TABLE t113; +SELECT a FROM t143; +a +TRUNCATE TABLE t112; +SELECT a FROM t144; +a +TRUNCATE TABLE t111; +SELECT a FROM t145; +a +TRUNCATE TABLE t110; +SELECT a FROM t146; +a +TRUNCATE TABLE t109; +SELECT a FROM t147; +a +TRUNCATE TABLE t108; +SELECT a FROM t148; +a +TRUNCATE TABLE t107; +SELECT a FROM t149; +a +TRUNCATE TABLE t106; +SELECT a FROM t150; +a +TRUNCATE TABLE t105; +SELECT a FROM t151; +a +TRUNCATE TABLE t104; +SELECT a FROM t152; +a +TRUNCATE TABLE t103; +SELECT a FROM t153; +a +TRUNCATE TABLE t102; +SELECT a FROM t154; +a +TRUNCATE TABLE t101; +SELECT a FROM t155; +a +TRUNCATE TABLE t100; +SELECT a FROM t156; +a +TRUNCATE TABLE t99; +SELECT a FROM t157; +a +TRUNCATE TABLE t98; +SELECT a FROM t158; +a +TRUNCATE TABLE t97; +SELECT a FROM t159; +a +TRUNCATE TABLE t96; +SELECT a FROM t160; +a +TRUNCATE TABLE t95; +SELECT a FROM t161; +a +TRUNCATE TABLE t94; +SELECT a FROM t162; +a +TRUNCATE TABLE t93; +SELECT a FROM t163; +a +TRUNCATE TABLE t92; +SELECT a FROM t164; +a +TRUNCATE TABLE t91; +SELECT a FROM t165; +a +TRUNCATE TABLE t90; +SELECT a FROM t166; +a +TRUNCATE TABLE t89; +SELECT a FROM t167; +a +TRUNCATE TABLE t88; +SELECT a FROM t168; +a +TRUNCATE TABLE t87; +SELECT a FROM t169; +a +TRUNCATE TABLE t86; +SELECT a FROM t170; +a +TRUNCATE TABLE t85; +SELECT a FROM t171; +a +TRUNCATE TABLE t84; +SELECT a FROM t172; +a +TRUNCATE TABLE t83; +SELECT a FROM t173; +a +TRUNCATE TABLE t82; +SELECT a FROM t174; +a +TRUNCATE TABLE t81; +SELECT a FROM t175; +a +TRUNCATE TABLE t80; +SELECT a FROM t176; +a +TRUNCATE TABLE t79; +SELECT a FROM t177; +a +TRUNCATE TABLE t78; +SELECT a FROM t178; +a +TRUNCATE TABLE t77; +SELECT a FROM t179; +a +TRUNCATE TABLE t76; +SELECT a FROM t180; +a +TRUNCATE TABLE t75; +SELECT a FROM t181; +a +TRUNCATE TABLE t74; +SELECT a FROM t182; +a +TRUNCATE TABLE t73; +SELECT a FROM t183; +a +TRUNCATE TABLE t72; +SELECT a FROM t184; +a +TRUNCATE TABLE t71; +SELECT a FROM t185; +a +TRUNCATE TABLE t70; +SELECT a FROM t186; +a +TRUNCATE TABLE t69; +SELECT a FROM t187; +a +TRUNCATE TABLE t68; +SELECT a FROM t188; +a +TRUNCATE TABLE t67; +SELECT a FROM t189; +a +TRUNCATE TABLE t66; +SELECT a FROM t190; +a +TRUNCATE TABLE t65; +SELECT a FROM t191; +a +TRUNCATE TABLE t64; +SELECT a FROM t192; +a +TRUNCATE TABLE t63; +SELECT a FROM t193; +a +TRUNCATE TABLE t62; +SELECT a FROM t194; +a +TRUNCATE TABLE t61; +SELECT a FROM t195; +a +TRUNCATE TABLE t60; +SELECT a FROM t196; +a +TRUNCATE TABLE t59; +SELECT a FROM t197; +a +TRUNCATE TABLE t58; +SELECT a FROM t198; +a +TRUNCATE TABLE t57; +SELECT a FROM t199; +a +TRUNCATE TABLE t56; +SELECT a FROM t200; +a +TRUNCATE TABLE t55; +SELECT a FROM t201; +a +TRUNCATE TABLE t54; +SELECT a FROM t202; +a +TRUNCATE TABLE t53; +SELECT a FROM t203; +a +TRUNCATE TABLE t52; +SELECT a FROM t204; +a +TRUNCATE TABLE t51; +SELECT a FROM t205; +a +TRUNCATE TABLE t50; +SELECT a FROM t206; +a +TRUNCATE TABLE t49; +SELECT a FROM t207; +a +TRUNCATE TABLE t48; +SELECT a FROM t208; +a +TRUNCATE TABLE t47; +SELECT a FROM t209; +a +TRUNCATE TABLE t46; +SELECT a FROM t210; +a +TRUNCATE TABLE t45; +SELECT a FROM t211; +a +TRUNCATE TABLE t44; +SELECT a FROM t212; +a +TRUNCATE TABLE t43; +SELECT a FROM t213; +a +TRUNCATE TABLE t42; +SELECT a FROM t214; +a +TRUNCATE TABLE t41; +SELECT a FROM t215; +a +TRUNCATE TABLE t40; +SELECT a FROM t216; +a +TRUNCATE TABLE t39; +SELECT a FROM t217; +a +TRUNCATE TABLE t38; +SELECT a FROM t218; +a +TRUNCATE TABLE t37; +SELECT a FROM t219; +a +TRUNCATE TABLE t36; +SELECT a FROM t220; +a +TRUNCATE TABLE t35; +SELECT a FROM t221; +a +TRUNCATE TABLE t34; +SELECT a FROM t222; +a +TRUNCATE TABLE t33; +SELECT a FROM t223; +a +TRUNCATE TABLE t32; +SELECT a FROM t224; +a +TRUNCATE TABLE t31; +SELECT a FROM t225; +a +TRUNCATE TABLE t30; +SELECT a FROM t226; +a +TRUNCATE TABLE t29; +SELECT a FROM t227; +a +TRUNCATE TABLE t28; +SELECT a FROM t228; +a +TRUNCATE TABLE t27; +SELECT a FROM t229; +a +TRUNCATE TABLE t26; +SELECT a FROM t230; +a +TRUNCATE TABLE t25; +SELECT a FROM t231; +a +TRUNCATE TABLE t24; +SELECT a FROM t232; +a +TRUNCATE TABLE t23; +SELECT a FROM t233; +a +TRUNCATE TABLE t22; +SELECT a FROM t234; +a +TRUNCATE TABLE t21; +SELECT a FROM t235; +a +TRUNCATE TABLE t20; +SELECT a FROM t236; +a +TRUNCATE TABLE t19; +SELECT a FROM t237; +a +TRUNCATE TABLE t18; +SELECT a FROM t238; +a +TRUNCATE TABLE t17; +SELECT a FROM t239; +a +TRUNCATE TABLE t16; +SELECT a FROM t240; +a +TRUNCATE TABLE t15; +SELECT a FROM t241; +a +TRUNCATE TABLE t14; +SELECT a FROM t242; +a +TRUNCATE TABLE t13; +SELECT a FROM t243; +a +TRUNCATE TABLE t12; +SELECT a FROM t244; +a +TRUNCATE TABLE t11; +SELECT a FROM t245; +a +TRUNCATE TABLE t10; +SELECT a FROM t246; +a +TRUNCATE TABLE t9; +SELECT a FROM t247; +a +TRUNCATE TABLE t8; +SELECT a FROM t248; +a +TRUNCATE TABLE t7; +SELECT a FROM t249; +a +TRUNCATE TABLE t6; +SELECT a FROM t250; +a +TRUNCATE TABLE t5; +SELECT a FROM t251; +a +TRUNCATE TABLE t4; +SELECT a FROM t252; +a +TRUNCATE TABLE t3; +SELECT a FROM t253; +a +TRUNCATE TABLE t2; +SELECT a FROM t254; +a +TRUNCATE TABLE t1; +SELECT a FROM t255; +a +SELECT a FROM t0; +a +DROP TABLE t0; +DROP TABLE t255; +DROP TABLE t254; +DROP TABLE t253; +DROP TABLE t252; +DROP TABLE t251; +DROP TABLE t250; +DROP TABLE t249; +DROP TABLE t248; +DROP TABLE t247; +DROP TABLE t246; +DROP TABLE t245; +DROP TABLE t244; +DROP TABLE t243; +DROP TABLE t242; +DROP TABLE t241; +DROP TABLE t240; +DROP TABLE t239; +DROP TABLE t238; +DROP TABLE t237; +DROP TABLE t236; +DROP TABLE t235; +DROP TABLE t234; +DROP TABLE t233; +DROP TABLE t232; +DROP TABLE t231; +DROP TABLE t230; +DROP TABLE t229; +DROP TABLE t228; +DROP TABLE t227; +DROP TABLE t226; +DROP TABLE t225; +DROP TABLE t224; +DROP TABLE t223; +DROP TABLE t222; +DROP TABLE t221; +DROP TABLE t220; +DROP TABLE t219; +DROP TABLE t218; +DROP TABLE t217; +DROP TABLE t216; +DROP TABLE t215; +DROP TABLE t214; +DROP TABLE t213; +DROP TABLE t212; +DROP TABLE t211; +DROP TABLE t210; +DROP TABLE t209; +DROP TABLE t208; +DROP TABLE t207; +DROP TABLE t206; +DROP TABLE t205; +DROP TABLE t204; +DROP TABLE t203; +DROP TABLE t202; +DROP TABLE t201; +DROP TABLE t200; +DROP TABLE t199; +DROP TABLE t198; +DROP TABLE t197; +DROP TABLE t196; +DROP TABLE t195; +DROP TABLE t194; +DROP TABLE t193; +DROP TABLE t192; +DROP TABLE t191; +DROP TABLE t190; +DROP TABLE t189; +DROP TABLE t188; +DROP TABLE t187; +DROP TABLE t186; +DROP TABLE t185; +DROP TABLE t184; +DROP TABLE t183; +DROP TABLE t182; +DROP TABLE t181; +DROP TABLE t180; +DROP TABLE t179; +DROP TABLE t178; +DROP TABLE t177; +DROP TABLE t176; +DROP TABLE t175; +DROP TABLE t174; +DROP TABLE t173; +DROP TABLE t172; +DROP TABLE t171; +DROP TABLE t170; +DROP TABLE t169; +DROP TABLE t168; +DROP TABLE t167; +DROP TABLE t166; +DROP TABLE t165; +DROP TABLE t164; +DROP TABLE t163; +DROP TABLE t162; +DROP TABLE t161; +DROP TABLE t160; +DROP TABLE t159; +DROP TABLE t158; +DROP TABLE t157; +DROP TABLE t156; +DROP TABLE t155; +DROP TABLE t154; +DROP TABLE t153; +DROP TABLE t152; +DROP TABLE t151; +DROP TABLE t150; +DROP TABLE t149; +DROP TABLE t148; +DROP TABLE t147; +DROP TABLE t146; +DROP TABLE t145; +DROP TABLE t144; +DROP TABLE t143; +DROP TABLE t142; +DROP TABLE t141; +DROP TABLE t140; +DROP TABLE t139; +DROP TABLE t138; +DROP TABLE t137; +DROP TABLE t136; +DROP TABLE t135; +DROP TABLE t134; +DROP TABLE t133; +DROP TABLE t132; +DROP TABLE t131; +DROP TABLE t130; +DROP TABLE t129; +DROP TABLE t128; +DROP TABLE t127; +DROP TABLE t126; +DROP TABLE t125; +DROP TABLE t124; +DROP TABLE t123; +DROP TABLE t122; +DROP TABLE t121; +DROP TABLE t120; +DROP TABLE t119; +DROP TABLE t118; +DROP TABLE t117; +DROP TABLE t116; +DROP TABLE t115; +DROP TABLE t114; +DROP TABLE t113; +DROP TABLE t112; +DROP TABLE t111; +DROP TABLE t110; +DROP TABLE t109; +DROP TABLE t108; +DROP TABLE t107; +DROP TABLE t106; +DROP TABLE t105; +DROP TABLE t104; +DROP TABLE t103; +DROP TABLE t102; +DROP TABLE t101; +DROP TABLE t100; +DROP TABLE t99; +DROP TABLE t98; +DROP TABLE t97; +DROP TABLE t96; +DROP TABLE t95; +DROP TABLE t94; +DROP TABLE t93; +DROP TABLE t92; +DROP TABLE t91; +DROP TABLE t90; +DROP TABLE t89; +DROP TABLE t88; +DROP TABLE t87; +DROP TABLE t86; +DROP TABLE t85; +DROP TABLE t84; +DROP TABLE t83; +DROP TABLE t82; +DROP TABLE t81; +DROP TABLE t80; +DROP TABLE t79; +DROP TABLE t78; +DROP TABLE t77; +DROP TABLE t76; +DROP TABLE t75; +DROP TABLE t74; +DROP TABLE t73; +DROP TABLE t72; +DROP TABLE t71; +DROP TABLE t70; +DROP TABLE t69; +DROP TABLE t68; +DROP TABLE t67; +DROP TABLE t66; +DROP TABLE t65; +DROP TABLE t64; +DROP TABLE t63; +DROP TABLE t62; +DROP TABLE t61; +DROP TABLE t60; +DROP TABLE t59; +DROP TABLE t58; +DROP TABLE t57; +DROP TABLE t56; +DROP TABLE t55; +DROP TABLE t54; +DROP TABLE t53; +DROP TABLE t52; +DROP TABLE t51; +DROP TABLE t50; +DROP TABLE t49; +DROP TABLE t48; +DROP TABLE t47; +DROP TABLE t46; +DROP TABLE t45; +DROP TABLE t44; +DROP TABLE t43; +DROP TABLE t42; +DROP TABLE t41; +DROP TABLE t40; +DROP TABLE t39; +DROP TABLE t38; +DROP TABLE t37; +DROP TABLE t36; +DROP TABLE t35; +DROP TABLE t34; +DROP TABLE t33; +DROP TABLE t32; +DROP TABLE t31; +DROP TABLE t30; +DROP TABLE t29; +DROP TABLE t28; +DROP TABLE t27; +DROP TABLE t26; +DROP TABLE t25; +DROP TABLE t24; +DROP TABLE t23; +DROP TABLE t22; +DROP TABLE t21; +DROP TABLE t20; +DROP TABLE t19; +DROP TABLE t18; +DROP TABLE t17; +DROP TABLE t16; +DROP TABLE t15; +DROP TABLE t14; +DROP TABLE t13; +DROP TABLE t12; +DROP TABLE t11; +DROP TABLE t10; +DROP TABLE t9; +DROP TABLE t8; +DROP TABLE t7; +DROP TABLE t6; +DROP TABLE t5; +DROP TABLE t4; +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; +SET @@global.query_cache_size = 0; +End of 5.1 tests diff --git a/mysql-test/t/query_cache_merge.test b/mysql-test/t/query_cache_merge.test index 36b8662f088..b854bfb5d67 100644 --- a/mysql-test/t/query_cache_merge.test +++ b/mysql-test/t/query_cache_merge.test @@ -38,3 +38,59 @@ drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t2 SET @@global.query_cache_size=0; # End of 4.1 tests + +# +# Bug#33362: Query cache invalidation (truncate) may hang if cached query uses many tables +# + +let $c= 255; + +while ($c) +{ + eval CREATE TABLE t$c (a INT); + eval INSERT INTO t$c VALUES ($c); + dec $c; +} + +let $c= 254; +let $str= t255; + +while ($c) +{ + let $str= t$c,$str; + dec $c; +} + +eval CREATE TABLE t0 (a INT) ENGINE=MERGE UNION($str); +SET GLOBAL query_cache_size = 1048576; +FLUSH STATUS; +SELECT a FROM t0 WHERE a = 1; +SHOW STATUS LIKE "Qcache_queries_in_cache"; + +let $c= 255; +let $i= 1; + +FLUSH TABLES; + +while ($c) +{ + eval TRUNCATE TABLE t$c; + eval SELECT a FROM t$i; + dec $c; + inc $i; +} + +SELECT a FROM t0; +DROP TABLE t0; + +let $c= 255; + +while ($c) +{ + eval DROP TABLE t$c; + dec $c; +} + +SET @@global.query_cache_size = 0; + +--echo End of 5.1 tests diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f8906a17c12..b487f092f75 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -2516,7 +2516,7 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block, tmp++) unlink_table(tmp); } - return (n); + return test(n); } /* From 27699fac9c92dc7e3029a4037d6ab5cf02516f36 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Thu, 24 Jul 2008 13:43:14 -0400 Subject: [PATCH 133/352] Make community features (including profiling) on by default. --- configure.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 08d21a23e81..56bdb4ba006 100644 --- a/configure.in +++ b/configure.in @@ -617,19 +617,19 @@ fi AC_MSG_CHECKING(whether features provided by the user community should be included.) AC_ARG_ENABLE(community-features, AC_HELP_STRING( - [--enable-community-features], - [Enable additional features provided by the user community.]), + [--disable-community-features], + [Disable additional features provided by the user community.]), [ ENABLE_COMMUNITY_FEATURES=$enableval ], - [ ENABLE_COMMUNITY_FEATURES=no ] + [ ENABLE_COMMUNITY_FEATURES=yes ] ) if test "$ENABLE_COMMUNITY_FEATURES" = "yes" then AC_DEFINE([COMMUNITY_SERVER], [1], [Whether features provided by the user community should be included]) - AC_MSG_RESULT([yes, community server]) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no, enterprise server]) + AC_MSG_RESULT([no]) fi AC_ARG_WITH(server-suffix, From 5c1f8d1836554f6978b8fe84acb3e3e1f207bca1 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Thu, 24 Jul 2008 22:38:44 +0200 Subject: [PATCH 134/352] Bug#38002 table_cache consumes too much memory with blobs Tables in the table definition cache are keeping a cache buffer for blob fields which can consume a lot of memory. This patch introduces a maximum size threshold for these buffers. --- sql/field.h | 2 +- sql/mysql_priv.h | 1 + sql/sql_base.cc | 2 ++ sql/table.cc | 22 ++++++++++++++++++++++ sql/table.h | 3 +++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/sql/field.h b/sql/field.h index 7d312dbd2b8..8e00cf013dc 100644 --- a/sql/field.h +++ b/sql/field.h @@ -13,7 +13,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* Because of the function new_field() all field classes that have static variables must declare the size_of() member function. @@ -1669,6 +1668,7 @@ public: } int reset(void) { bzero(ptr, packlength+sizeof(uchar*)); return 0; } void reset_fields() { bzero((uchar*) &value,sizeof(value)); } + uint32 get_field_buffer_size(void) { return value.alloced_length(); } #ifndef WORDS_BIGENDIAN static #endif diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index e150ffd18f8..f6ba5fc9739 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -2130,6 +2130,7 @@ int writefrm(const char* name, const uchar* data, size_t len); int closefrm(TABLE *table, bool free_share); int read_string(File file, uchar* *to, size_t length); void free_blobs(TABLE *table); +void free_field_buffers_larger_than(TABLE *table, uint32 size); int set_zone(int nr,int min_zone,int max_zone); ulong convert_period_to_month(ulong period); ulong convert_month_to_period(ulong month); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d25057789ac..39dd815e738 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1369,6 +1369,8 @@ bool close_thread_table(THD *thd, TABLE **table_ptr) DBUG_ASSERT(!table->is_children_attached()); /* Free memory and reset for next loop */ + free_field_buffers_larger_than(table,MAX_TDC_BLOB_SIZE); + table->file->ha_reset(); table->in_use=0; if (unused_tables) diff --git a/sql/table.cc b/sql/table.cc index ebf3dfd748e..58cbde74822 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1999,6 +1999,28 @@ void free_blobs(register TABLE *table) } +/** + Reclaim temporary blob storage which is bigger than + a threshold. + + @param table A handle to the TABLE object containing blob fields + @param size The threshold value. + +*/ + +void free_field_buffers_larger_than(TABLE *table, uint32 size) +{ + uint *ptr, *end; + for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ; + ptr != end ; + ptr++) + { + Field_blob *blob= (Field_blob*) table->field[*ptr]; + if (blob->get_field_buffer_size() > size) + blob->free(); + } +} + /* Find where a form starts */ /* if formname is NullS then only formnames is read */ diff --git a/sql/table.h b/sql/table.h index 75ddaf69c10..da0e089794f 100644 --- a/sql/table.h +++ b/sql/table.h @@ -935,6 +935,9 @@ typedef struct st_schema_table #define VIEW_CHECK_ERROR 1 #define VIEW_CHECK_SKIP 2 +/** The threshold size a blob field buffer before it is freed */ +#define MAX_TDC_BLOB_SIZE 65536 + struct st_lex; class select_union; class TMP_TABLE_PARAM; From b467c15e3694772b0da0930274a8dfc4a8ead030 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 25 Jul 2008 13:32:05 +0300 Subject: [PATCH 135/352] Disabled 5.1 tests (and reported bugs) --- mysql-test/suite/ndb/t/disabled.def | 1 + mysql-test/suite/rpl_ndb/t/disabled.def | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index c638c7b4774..6102d182684 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -12,5 +12,6 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms +ndb_index_ordered : Bug#38370 The test ndb.ndb_index_ordered fails with the community features on # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index ebc99feeac6..7010fba26b2 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -12,5 +12,6 @@ rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication. rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication. +rpl_row_basic_7ndb : Bug#38369 rpl_ndb.rpl_row_basic_7ndb fails # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open From 44be24542a08c33664f1392e5420c37d044463c0 Mon Sep 17 00:00:00 2001 From: Patrick Crews Date: Fri, 25 Jul 2008 13:14:52 -0400 Subject: [PATCH 136/352] Bug#38383 - Certain funcs_1 trig tests are failing on Pushbuild. Removing duplicate 'setup' portions of these include files. Likely an editor error created dupe lines. This is causing many Pushbuild errors --- mysql-test/suite/funcs_1/triggers/triggers_03.inc | 5 ----- mysql-test/suite/funcs_1/triggers/triggers_08.inc | 3 +-- mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc | 7 ------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/mysql-test/suite/funcs_1/triggers/triggers_03.inc b/mysql-test/suite/funcs_1/triggers/triggers_03.inc index f8a83315f0c..9ef6a9ac9af 100644 --- a/mysql-test/suite/funcs_1/triggers/triggers_03.inc +++ b/mysql-test/suite/funcs_1/triggers/triggers_03.inc @@ -13,12 +13,7 @@ USE test; --source suite/funcs_1/include/tb3.inc -# This test cannot be used for the embedded server because we check here -# privilgeges. ---source include/not_embedded.inc -USE test; ---source suite/funcs_1/include/tb3.inc --disable_abort_on_error diff --git a/mysql-test/suite/funcs_1/triggers/triggers_08.inc b/mysql-test/suite/funcs_1/triggers/triggers_08.inc index 399b27508db..087f18e8e6b 100644 --- a/mysql-test/suite/funcs_1/triggers/triggers_08.inc +++ b/mysql-test/suite/funcs_1/triggers/triggers_08.inc @@ -8,8 +8,7 @@ USE test; --source suite/funcs_1/include/tb3.inc -USE test; ---source suite/funcs_1/include/tb3.inc + # General setup for Trigger tests let $message= Testcase: 3.5:; diff --git a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc index 529eb6c77fd..7230f240e2d 100644 --- a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc +++ b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc @@ -13,13 +13,6 @@ eval load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt' into table tb3; -USE test; ---source suite/funcs_1/include/tb3.inc - ---replace_result $MYSQLTEST_VARDIR -eval -load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt' -into table tb3; --disable_abort_on_error From da156dde0885aacc494ee7e697f961a85bccfd5e Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sat, 26 Jul 2008 13:44:07 -0700 Subject: [PATCH 137/352] Fixed bug #38191. Calling List::delete_elements for the same list twice caused a crash of the server in the function JOIN::cleaunup. Ensured that delete_elements() in JOIN::cleanup would be called only once. --- mysql-test/r/subselect.result | 11 +++++++++++ mysql-test/t/subselect.test | 12 ++++++++++++ sql/sql_select.cc | 6 ++++++ 3 files changed, 29 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 12e3aac486e..c5bae840214 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4396,4 +4396,15 @@ id select_type table type possible_keys key key_len ref rows Extra Warnings: Note 1003 select 1 AS `1` from `test`.`t1` where (1,(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having ((1) = (1)))) DROP TABLE t1; +CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a)); +INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20); +CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a)); +INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100); +SELECT * FROM t1 +WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b); +pk a +1 10 +3 30 +2 20 +DROP TABLE t1,t2; End of 5.0 tests. diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 4d9507f1231..2dfad2c58dd 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3295,5 +3295,17 @@ EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT 1 FROM t1 GROUP BY a); EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT 1 FROM t1 WHERE a > 3 GROUP BY a); DROP TABLE t1; +# +# Bug #38191: Server crash with subquery containing DISTINCT and ORDER BY +# + +CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a)); +INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20); +CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a)); +INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100); +SELECT * FROM t1 + WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b); +DROP TABLE t1,t2; + --echo End of 5.0 tests. diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 60ba7591726..c222b8a55ca 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6469,6 +6469,12 @@ void JOIN::cleanup(bool full) if (tmp_join) tmp_table_param.copy_field= 0; group_fields.delete_elements(); + /* + Ensure that the above delete_elements() would not be called + twice for the same list. + */ + if (tmp_join && tmp_join != this) + tmp_join->group_fields= group_fields; /* We can't call delete_elements() on copy_funcs as this will cause problems in free_elements() as some of the elements are then deleted. From 08162d8c3b79be33b7c8ddad828a1eebd0f958db Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 29 Jul 2008 08:25:46 +0500 Subject: [PATCH 138/352] Bug#35808 utf8 hungarian collation not part of the utf8 charset? config/ac-macros/character_sets.m4 didn't mention hungarian collations in the UTF8 and UCS2 lists. --- config/ac-macros/character_sets.m4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4 index ea2763a1cd4..a9f7bd73858 100644 --- a/config/ac-macros/character_sets.m4 +++ b/config/ac-macros/character_sets.m4 @@ -343,8 +343,8 @@ case $default_charset in default_charset_default_collation="ucs2_general_ci" define(UCSC1, ucs2_general_ci ucs2_bin) define(UCSC2, ucs2_czech_ci ucs2_danish_ci) - define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_icelandic_ci) - define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci) + define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_hungarian_ci) + define(UCSC4, ucs2_icelandic_ci ucs2_latvian_ci ucs2_lithuanian_ci) define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci) define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci) define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci) @@ -367,8 +367,8 @@ case $default_charset in else define(UTFC1, utf8_general_ci utf8_bin) define(UTFC2, utf8_czech_ci utf8_danish_ci) - define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci) - define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci) + define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_hungarian_ci) + define(UTFC4, utf8_icelandic_ci utf8_latvian_ci utf8_lithuanian_ci) define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci) define(UTFC6, utf8_slovak_ci utf8_slovenian_ci) define(UTFC7, utf8_spanish2_ci utf8_spanish_ci) From 0e52492980d2aba099dad22f2879ee88f7dcd649 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 29 Jul 2008 10:43:57 +0500 Subject: [PATCH 139/352] Bug#36597 Testsuite "jp": Suspicious results for some tests using sjis Problem: Extra new line appeared in jisx0208_sjis2.dat in a mistake, which broke jp_convert_sjis and jp_select_sjis tests. Fix: removing extra line mysql-test/suite/jp/std_data/jisx0208_sjis2.dat: removing wrong extra new line mysql-test/suite/jp/t/disabled.def: activating disabled tests --- mysql-test/suite/jp/std_data/jisx0208_sjis2.dat | 1 - mysql-test/suite/jp/t/disabled.def | 2 -- 2 files changed, 3 deletions(-) diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat index d731cc0e3b2..bea8b3ccad6 100644 --- a/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat +++ b/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat @@ -1,2 +1 @@ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ - diff --git a/mysql-test/suite/jp/t/disabled.def b/mysql-test/suite/jp/t/disabled.def index 8c4d862ebde..888298bbb09 100644 --- a/mysql-test/suite/jp/t/disabled.def +++ b/mysql-test/suite/jp/t/disabled.def @@ -9,5 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -jp_convert_sjis : Bug#36597 Testsuite "jp": Suspicious results for some tests -jp_select_sjis : Bug#36597 Testsuite "jp": Suspicious results for some tests From d298e107f7eebd8bb4d91d7167a968067d80f87d Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Tue, 29 Jul 2008 15:37:09 +0200 Subject: [PATCH 140/352] Bug#37781 mysql_drop_user calls get_current_user() twice for no reason Fixed typo and removed duplicate call to get_current_user. --- sql/sql_acl.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index e12fbb9843a..df5e844749f 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -5430,7 +5430,6 @@ bool mysql_drop_user(THD *thd, List &list) while ((tmp_user_name= user_list++)) { - user_name= get_current_user(thd, tmp_user_name); if (!(user_name= get_current_user(thd, tmp_user_name))) { result= TRUE; From 7b244002a386610ebac794c0705e19a5bfada946 Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Tue, 29 Jul 2008 15:58:15 +0200 Subject: [PATCH 141/352] Bug#29738 Error message not properly translated to Serbian Community contribution fix for Serbian translation in error message list. --- sql/share/errmsg.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 7d345d633c6..0916ad56cef 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -4737,7 +4737,7 @@ ER_SLAVE_IGNORED_TABLE swe "Slav SQL tråden ignorerade frågan pga en replicate-*-table regel" ER_INCORRECT_GLOBAL_LOCAL_VAR eng "Variable '%-.64s' is a %s variable" - serbian "Incorrect foreign key definition for '%-.64s': %s" + serbian "Promenljiva '%-.64s' je %s promenljiva" ger "Variable '%-.64s' ist eine %s-Variable" spa "Variable '%-.64s' es una %s variable" swe "Variabel '%-.64s' är av typ %s" From 3d5289c2dd28afab9aa640091ef129416b26414e Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Tue, 29 Jul 2008 17:36:13 +0200 Subject: [PATCH 142/352] BUG#38068: binlog_stm_binlog fails sporadically in pushbuild Post-push fix: updated some result files that were affected by the previous fix to this bug. --- mysql-test/suite/binlog/r/binlog_killed_simulate.result | 2 +- mysql-test/suite/binlog/r/binlog_row_binlog.result | 4 ++-- mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result | 2 +- .../suite/binlog/r/binlog_statement_insert_delayed.result | 4 ++-- mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result | 4 ++-- mysql-test/suite/rpl/r/rpl_stm_log.result | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_killed_simulate.result b/mysql-test/suite/binlog/r/binlog_killed_simulate.result index c0087316420..66d3a86cd5a 100644 --- a/mysql-test/suite/binlog/r/binlog_killed_simulate.result +++ b/mysql-test/suite/binlog/r/binlog_killed_simulate.result @@ -18,7 +18,7 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "kil ERROR 70100: Query execution was interrupted show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=# select (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index f830b69bf9d..9668c7ce5ea 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1141,10 +1141,10 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `mysql`; COMMIT drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); +FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) @@ -1188,9 +1188,9 @@ master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; COMMIT +master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); -11 == 11 select * from t1; a 207 diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 419aea5b581..7106480663f 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -926,7 +926,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 3a2dc441632..800bb58e9cc 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -1,8 +1,8 @@ create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; insert delayed into t1 values (207); insert delayed into t1 values (null); insert delayed into t1 values (300); +FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam @@ -10,9 +10,9 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207) master-bin.000001 # Intvar # # INSERT_ID=208 master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null) master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) +master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); insert delayed into t1 values (null),(null),(400),(null); -11 == 11 select * from t1; a 207 diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 60104a64d94..3d71f333852 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -623,7 +623,7 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # use `test`; ROLLBACK @@ -858,7 +858,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result index 18333f5e5e9..d29b4c92590 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_log.result +++ b/mysql-test/suite/rpl/r/rpl_stm_log.result @@ -196,7 +196,7 @@ master-bin.000001 # Intvar # # INSERT_ID=1 master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581 +master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=# master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; From 425abb4904caa8fa24429eaf9eada3b9ea5d87b1 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 30 Jul 2008 14:07:37 +0300 Subject: [PATCH 143/352] Bug#37662 nested if() inside sum() is parsed in exponential time min() and max() functions are implemented in MySQL as macros. This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b)) Note how 'a' is quoted two times. Now imagine 'a' is a recursive function call that's several 10s of levels deep. And the recursive function does max() with a function arg as well to dive into recursion. This means that simple function call can take most of the clock time. Identified and fixed several such calls to max()/min() : including the IF() sql function implementation. --- mysql-test/r/func_if.result | 46 +++++++++++++++++++++++++++++++++++++ mysql-test/t/func_if.test | 43 ++++++++++++++++++++++++++++++++++ sql/item.cc | 12 ++++++---- sql/item_cmpfunc.cc | 12 ++++++---- sql/item_func.cc | 15 ++++++------ 5 files changed, 113 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index c75e37fa0a4..7ffc957e285 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -131,3 +131,49 @@ drop table t1; select if(0, 18446744073709551610, 18446744073709551610); if(0, 18446744073709551610, 18446744073709551610) 18446744073709551610 +CREATE TABLE t1(a DECIMAL(10,3)); +SELECT t1.a, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1 +FROM t1; +a IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((ROUND(t1.a,2)=1), 2, +IF((R +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 5373ca3fec6..8da10f36cbe 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -108,3 +108,46 @@ drop table t1; select if(0, 18446744073709551610, 18446744073709551610); +# +# Bug #37662: nested if() inside sum() is parsed in exponential time +# + +CREATE TABLE t1(a DECIMAL(10,3)); + +# check : should be fast. more than few secs means failure. +SELECT t1.a, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2, + IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1 +FROM t1; + +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/item.cc b/sql/item.cc index bf447581afa..a5c88f55487 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -429,8 +429,11 @@ uint Item::decimal_precision() const Item_result restype= result_type(); if ((restype == DECIMAL_RESULT) || (restype == INT_RESULT)) - return min(my_decimal_length_to_precision(max_length, decimals, unsigned_flag), - DECIMAL_MAX_PRECISION); + { + uint prec= + my_decimal_length_to_precision(max_length, decimals, unsigned_flag); + return min(prec, DECIMAL_MAX_PRECISION); + } return min(max_length, DECIMAL_MAX_PRECISION); } @@ -6838,8 +6841,9 @@ bool Item_type_holder::join_types(THD *thd, Item *item) if (Field::result_merge_type(fld_type) == DECIMAL_RESULT) { decimals= min(max(decimals, item->decimals), DECIMAL_MAX_SCALE); - int precision= min(max(prev_decimal_int_part, item->decimal_int_part()) - + decimals, DECIMAL_MAX_PRECISION); + int item_int_part= item->decimal_int_part(); + int item_prec = max(prev_decimal_int_part, item_int_part) + decimals; + int precision= min(item_prec, DECIMAL_MAX_PRECISION); unsigned_flag&= item->unsigned_flag; max_length= my_decimal_precision_to_length(precision, decimals, unsigned_flag); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 16f3e51d615..1994f6bf1a5 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2098,8 +2098,11 @@ Item_func_ifnull::fix_length_and_dec() uint Item_func_ifnull::decimal_precision() const { - int max_int_part=max(args[0]->decimal_int_part(),args[1]->decimal_int_part()); - return min(max_int_part + decimals, DECIMAL_MAX_PRECISION); + int arg0_int_part= args[0]->decimal_int_part(); + int arg1_int_part= args[1]->decimal_int_part(); + int max_int_part= max(arg0_int_part, arg1_int_part); + int precision= max_int_part + decimals; + return min(precision, DECIMAL_MAX_PRECISION); } @@ -2281,8 +2284,9 @@ Item_func_if::fix_length_and_dec() uint Item_func_if::decimal_precision() const { - int precision=(max(args[1]->decimal_int_part(),args[2]->decimal_int_part())+ - decimals); + int arg1_prec= args[1]->decimal_int_part(); + int arg2_prec= args[2]->decimal_int_part(); + int precision=max(arg1_prec,arg2_prec) + decimals; return min(precision, DECIMAL_MAX_PRECISION); } diff --git a/sql/item_func.cc b/sql/item_func.cc index 7416471d630..e663e1fcf83 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1156,9 +1156,10 @@ my_decimal *Item_func_plus::decimal_op(my_decimal *decimal_value) void Item_func_additive_op::result_precision() { decimals= max(args[0]->decimals, args[1]->decimals); - int max_int_part= max(args[0]->decimal_precision() - args[0]->decimals, - args[1]->decimal_precision() - args[1]->decimals); - int precision= min(max_int_part + 1 + decimals, DECIMAL_MAX_PRECISION); + int arg1_int= args[0]->decimal_precision() - args[0]->decimals; + int arg2_int= args[1]->decimal_precision() - args[1]->decimals; + int est_prec= max(arg1_int, arg2_int) + 1 + decimals; + int precision= min(est_prec, DECIMAL_MAX_PRECISION); /* Integer operations keep unsigned_flag if one of arguments is unsigned */ if (result_type() == INT_RESULT) @@ -1267,8 +1268,8 @@ void Item_func_mul::result_precision() else unsigned_flag= args[0]->unsigned_flag & args[1]->unsigned_flag; decimals= min(args[0]->decimals + args[1]->decimals, DECIMAL_MAX_SCALE); - int precision= min(args[0]->decimal_precision() + args[1]->decimal_precision(), - DECIMAL_MAX_PRECISION); + uint est_prec = args[0]->decimal_precision() + args[1]->decimal_precision(); + uint precision= min(est_prec, DECIMAL_MAX_PRECISION); max_length= my_decimal_precision_to_length(precision, decimals,unsigned_flag); } @@ -1315,8 +1316,8 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) void Item_func_div::result_precision() { - uint precision=min(args[0]->decimal_precision() + prec_increment, - DECIMAL_MAX_PRECISION); + uint arg_prec= args[0]->decimal_precision() + prec_increment; + uint precision=min(arg_prec, DECIMAL_MAX_PRECISION); /* Integer operations keep unsigned_flag if one of arguments is unsigned */ if (result_type() == INT_RESULT) unsigned_flag= args[0]->unsigned_flag | args[1]->unsigned_flag; From a0768d32c24b2548a47dbd99aa00d53c5019220d Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Thu, 31 Jul 2008 12:28:04 +0300 Subject: [PATCH 144/352] Bug#34159: mysql_install_db fails with sql_mode=TRADITIONAL Reset session sql_mode before creating system tables as it is done in the mysql_fix_privilege_tables.sql script. --- scripts/mysql_system_tables.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index d9c870f1d73..31eb205eed0 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -2,6 +2,7 @@ -- The system tables of MySQL Server -- +set sql_mode=''; set storage_engine=myisam; CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; From 021d7d72f899c0734a086dde71a599af92c63cfe Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Thu, 31 Jul 2008 15:47:57 -0600 Subject: [PATCH 145/352] Cherry-pick InnoDB fixes for Bug#34286, Bug#35352, and Bug#36600 from snapshot innodb-5.0-ss2475. Bug #34286 Assertion failure in thread 2816 in file .\row\row0sel.c line 3500 Since autoinc init performs a MySQL SELECT query to determine the auto-inc value, set prebuilt->sql_stat_start = TRUE so that it is performed like any normal SELECT, regardless of the context in which it was invoked. Bug #35352 If InnoDB crashes with UNDO slots full error the error persists on restart We've added a heuristic that checks the size of the UNDO slots cache lists (insert and upate). If either of cached lists has more than 500 entries then we add any UNDO slots that are freed, to the common free list instead of the cache list, this is to avoid the case where all the free slots end up in only one of the lists on startup after a crash. Tested with test case for 26590 and passes all mysql-test(s). Bug #36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number Fixed by removing the Innodb_buffer_pool_pages_latched variable from SHOW STATUS output in non-UNIV_DEBUG compilation. --- innobase/buf/buf0buf.c | 2 ++ innobase/include/buf0buf.h | 13 +++++---- innobase/include/srv0srv.h | 2 ++ innobase/include/trx0undo.h | 1 + innobase/srv/srv0srv.c | 2 ++ innobase/trx/trx0trx.c | 8 +++--- innobase/trx/trx0undo.c | 29 ++++++++++++++++----- mysql-test/r/innodb-autoinc-optimize.result | 6 +++++ mysql-test/t/innodb-autoinc-optimize.test | 16 ++++++++++++ sql/ha_innodb.cc | 10 ++++++- 10 files changed, 73 insertions(+), 16 deletions(-) create mode 100644 mysql-test/r/innodb-autoinc-optimize.result create mode 100644 mysql-test/t/innodb-autoinc-optimize.test diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 9df48495355..6cfcb0fc724 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -2260,6 +2260,7 @@ buf_print(void) ut_a(buf_validate()); } +#ifdef UNIV_DEBUG /************************************************************************* Returns the number of latched pages in the buffer pool. */ @@ -2290,6 +2291,7 @@ buf_get_latched_pages_number(void) mutex_exit(&(buf_pool->mutex)); return fixed_pages_number; } +#endif /* UNIV_DEBUG */ /************************************************************************* Returns the number of pending buf pool ios. */ diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index 11e5bb39e63..f802ffa6510 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -495,7 +495,15 @@ Prints info of the buffer pool data structure. */ void buf_print(void); /*============*/ + +/************************************************************************* +Returns the number of latched pages in the buffer pool. */ + +ulint +buf_get_latched_pages_number(void); +/*==============================*/ #endif /* UNIV_DEBUG */ + /************************************************************************ Prints a page to stderr. */ @@ -503,12 +511,7 @@ void buf_page_print( /*===========*/ byte* read_buf); /* in: a database page */ -/************************************************************************* -Returns the number of latched pages in the buffer pool. */ -ulint -buf_get_latched_pages_number(void); -/*==============================*/ /************************************************************************* Returns the number of pending buf pool ios. */ diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index f379efa98eb..97e9136040d 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -531,7 +531,9 @@ struct export_var_struct{ ulint innodb_buffer_pool_pages_dirty; ulint innodb_buffer_pool_pages_misc; ulint innodb_buffer_pool_pages_free; +#ifdef UNIV_DEBUG ulint innodb_buffer_pool_pages_latched; +#endif /* UNIV_DEBUG */ ulint innodb_buffer_pool_read_requests; ulint innodb_buffer_pool_reads; ulint innodb_buffer_pool_wait_free; diff --git a/innobase/include/trx0undo.h b/innobase/include/trx0undo.h index bd7337e4f90..4f1847aa88c 100644 --- a/innobase/include/trx0undo.h +++ b/innobase/include/trx0undo.h @@ -237,6 +237,7 @@ trx_undo_set_state_at_finish( /*=========================*/ /* out: undo log segment header page, x-latched */ + trx_rseg_t* rseg, /* in: rollback segment memory object */ trx_t* trx, /* in: transaction */ trx_undo_t* undo, /* in: undo log memory copy */ mtr_t* mtr); /* in: mtr */ diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 1227824ef80..431138400b6 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1803,7 +1803,9 @@ srv_export_innodb_status(void) export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU); export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list); export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free); +#ifdef UNIV_DEBUG export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number(); +#endif /* UNIV_DEBUG */ export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size; export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size - UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free); diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index d865c709bf6..70fd73f2488 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -761,8 +761,8 @@ trx_commit_off_kernel( mutex_enter(&(rseg->mutex)); if (trx->insert_undo != NULL) { - trx_undo_set_state_at_finish(trx, trx->insert_undo, - &mtr); + trx_undo_set_state_at_finish( + rseg, trx, trx->insert_undo, &mtr); } undo = trx->update_undo; @@ -777,8 +777,8 @@ trx_commit_off_kernel( because only a single OS thread is allowed to do the transaction commit for this transaction. */ - update_hdr_page = trx_undo_set_state_at_finish(trx, - undo, &mtr); + update_hdr_page = trx_undo_set_state_at_finish( + rseg, trx, undo, &mtr); /* We have to do the cleanup for the update log while holding the rseg mutex because update log headers diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c index 7441dd3f152..251cd355897 100644 --- a/innobase/trx/trx0undo.c +++ b/innobase/trx/trx0undo.c @@ -1724,6 +1724,7 @@ trx_undo_set_state_at_finish( /*=========================*/ /* out: undo log segment header page, x-latched */ + trx_rseg_t* rseg, /* in: rollback segment memory object */ trx_t* trx __attribute__((unused)), /* in: transaction */ trx_undo_t* undo, /* in: undo log memory copy */ mtr_t* mtr) /* in: mtr */ @@ -1732,8 +1733,10 @@ trx_undo_set_state_at_finish( trx_upagef_t* page_hdr; page_t* undo_page; ulint state; - - ut_ad(trx && undo && mtr); + + ut_ad(trx); + ut_ad(undo); + ut_ad(mtr); if (undo->id >= TRX_RSEG_N_SLOTS) { fprintf(stderr, "InnoDB: Error: undo->id is %lu\n", @@ -1747,9 +1750,23 @@ trx_undo_set_state_at_finish( seg_hdr = undo_page + TRX_UNDO_SEG_HDR; page_hdr = undo_page + TRX_UNDO_PAGE_HDR; - if (undo->size == 1 && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE) - < TRX_UNDO_PAGE_REUSE_LIMIT) { - state = TRX_UNDO_CACHED; + if (undo->size == 1 + && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE) + < TRX_UNDO_PAGE_REUSE_LIMIT) { + + /* This is a heuristic to avoid the problem of all UNDO + slots ending up in one of the UNDO lists. Previously if + the server crashed with all the slots in one of the lists, + transactions that required the slots of a different type + would fail for lack of slots. */ + + if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500 + && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) { + + state = TRX_UNDO_CACHED; + } else { + state = TRX_UNDO_TO_FREE; + } } else if (undo->type == TRX_UNDO_INSERT) { @@ -1759,7 +1776,7 @@ trx_undo_set_state_at_finish( } undo->state = state; - + mlog_write_ulint(seg_hdr + TRX_UNDO_STATE, state, MLOG_2BYTES, mtr); return(undo_page); diff --git a/mysql-test/r/innodb-autoinc-optimize.result b/mysql-test/r/innodb-autoinc-optimize.result new file mode 100644 index 00000000000..61739f0713a --- /dev/null +++ b/mysql-test/r/innodb-autoinc-optimize.result @@ -0,0 +1,6 @@ +drop table if exists t1; +create table t1(a int not null auto_increment primary key) engine=innodb; +insert into t1 set a = -1; +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK diff --git a/mysql-test/t/innodb-autoinc-optimize.test b/mysql-test/t/innodb-autoinc-optimize.test new file mode 100644 index 00000000000..c7e22a8ff40 --- /dev/null +++ b/mysql-test/t/innodb-autoinc-optimize.test @@ -0,0 +1,16 @@ +-- source include/have_innodb.inc +# embedded server ignores 'delayed', so skip this +-- source include/not_embedded.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Bug 34286 +# +create table t1(a int not null auto_increment primary key) engine=innodb; +insert into t1 set a = -1; +# NOTE: The database needs to be shutdown and restarted (here) for +# the test to work. It's included for reference only. +optimize table t1; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 1be6137460b..1c0f8a6e9b3 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -244,8 +244,10 @@ struct show_var_st innodb_status_variables[]= { (char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG}, {"buffer_pool_pages_free", (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG}, +#ifdef UNIV_DEBUG {"buffer_pool_pages_latched", (char*) &export_vars.innodb_buffer_pool_pages_latched, SHOW_LONG}, +#endif /* UNIV_DEBUG */ {"buffer_pool_pages_misc", (char*) &export_vars.innodb_buffer_pool_pages_misc, SHOW_LONG}, {"buffer_pool_pages_total", @@ -4250,7 +4252,7 @@ ha_innobase::rnd_pos( int error; uint keynr = active_index; DBUG_ENTER("rnd_pos"); - DBUG_DUMP("key", (uchar *)pos, ref_length); + DBUG_DUMP("key", (uchar*) pos, ref_length); statistic_increment(current_thd->status_var.ha_read_rnd_count, &LOCK_status); @@ -6882,6 +6884,12 @@ ha_innobase::innobase_read_and_init_auto_inc( from a table when no table has been locked in ::external_lock(). */ prebuilt->trx->n_mysql_tables_in_use++; + /* Since we will perform a MySQL SELECT query to determine the + auto-inc value, set prebuilt->sql_stat_start = TRUE so that it + is performed like any normal SELECT, regardless of the context + we come here. */ + prebuilt->sql_stat_start = TRUE; + error = index_last(table->record[1]); prebuilt->trx->n_mysql_tables_in_use--; From 9f550e6fbdd994edc4ef0d447b29ab83df9aa0aa Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 1 Aug 2008 12:10:06 -0300 Subject: [PATCH 146/352] Bug#37003: Tests sporadically crashes with embedded server Post-merge fix: Alter linking order so that the thread linking flags appear last in the list. This needs to be done this way because some linkers will not search the thread archive again if a undefined symbol (pthread_kill in this case) appears later. --- client/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index 940766ac66c..25b0c0cee00 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -88,11 +88,12 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ mysqltest_SOURCES= mysqltest.c mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK -mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ +mysqltest_LDADD = $(CXXLDFLAGS) \ @CLIENT_EXTRA_LDFLAGS@ \ $(LIBMYSQLCLIENT_LA) \ $(top_builddir)/mysys/libmysys.a \ - $(top_builddir)/regex/libregex.a + $(top_builddir)/regex/libregex.a \ + $(CLIENT_THREAD_LIBS) mysql_upgrade_SOURCES= mysql_upgrade.c \ $(top_srcdir)/mysys/my_getpagesize.c From a308c9e3fae8c510f6775f9e19c41b04b3a8194e Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Wed, 6 Aug 2008 09:25:03 -0400 Subject: [PATCH 147/352] Bug#30129: mysql_install_db appears to run normally, but the databases \ are not created {Netware} The init and test sql files were not created at cross-compilation time. Now, make them in the default build rule. Additionally, remove the "fix" SQL instructions, which are unnecessary for newly initialized databases. Also, clean up the english in an error message, and BZRify nwbootstrap. --- netware/BUILD/compile-linux-tools | 3 +++ netware/BUILD/nwbootstrap | 8 +++++--- netware/Makefile.am | 3 +-- netware/mysql_install_db.c | 20 +++++++++++++++----- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools index 14422ea5a3f..8cca00d142f 100755 --- a/netware/BUILD/compile-linux-tools +++ b/netware/BUILD/compile-linux-tools @@ -53,6 +53,9 @@ make # so the file will be linked (cd sql; make sql_yacc.cc) +# we need initilizing SQL files. +(cd netware; make test_db.sql init_db.sql) + # copying required linux tools cp extra/comp_err extra/comp_err.linux cp libmysql/conf_to_src libmysql/conf_to_src.linux diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index e0c0b926619..7ea8b9fc4b8 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -91,8 +91,8 @@ done echo "starting build..." # check for bk and repo_dir -bk help > /dev/null -repo_dir=`bk root $repo_dir` +bzr help > /dev/null +repo_dir=`bzr root $repo_dir` cd $repo_dir doc_dir="$repo_dir/../mysqldoc" @@ -100,7 +100,7 @@ doc_dir="$repo_dir/../mysqldoc" temp_dir="$build_dir/mysql-$$.tmp" # export the bk tree -command="bk export"; +command="bzr export"; if test $revision; then command="$command -r$revision"; fi command="$command $temp_dir" echo "exporting $repo_dir..." @@ -178,6 +178,8 @@ awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {pri # build linux tools echo "compiling linux tools..." ./netware/BUILD/compile-linux-tools +test -f ./netware/init_db.sql # this must exist +test -f ./netware/test_db.sql # this must exist # compile if test $build diff --git a/netware/Makefile.am b/netware/Makefile.am index 2e9ff2b59d6..7ad045d433d 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -103,8 +103,7 @@ init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \ @echo "CREATE DATABASE mysql;" > $@; @echo "CREATE DATABASE test;" >> $@; @echo "use mysql;" >> $@; - @cat $(top_srcdir)/scripts/mysql_system_tables.sql \ - $(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@; + @cat $(top_srcdir)/scripts/mysql_system_tables.sql >> $@; # Build test_db.sql from init_db.sql plus # some test data diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c index 65ee7873e5c..218c5024a8c 100644 --- a/netware/mysql_install_db.c +++ b/netware/mysql_install_db.c @@ -324,9 +324,10 @@ void create_paths() ******************************************************************************/ int mysql_install_db(int argc, char *argv[]) { - arg_list_t al; - int i, j, err; - char skip; + arg_list_t al; + int i, j, err; + char skip; + struct stat info; // private options static char *private_options[] = @@ -363,6 +364,15 @@ int mysql_install_db(int argc, char *argv[]) add_arg(&al, "--skip-innodb"); add_arg(&al, "--skip-bdb"); + if ((err = stat(sql_file, &info)) != 0) + { + printf("ERROR - %s:\n", strerror(errno)); + printf("\t%s\n\n", sql_file); + // free args + free_args(&al); + exit(-1); + } + // spawn mysqld err = spawn(mysqld, &al, TRUE, sql_file, out_log, err_log); @@ -395,9 +405,9 @@ int main(int argc, char **argv) // install the database if (mysql_install_db(argc, argv)) { - printf("ERROR - The database creation failed!\n"); + printf("ERROR - Failed to create the database!\n"); printf(" %s\n", strerror(errno)); - printf("See the following log for more infomration:\n"); + printf("See the following log for more information:\n"); printf("\t%s\n\n", err_log); exit(-1); } From a9775e8507e8c27ceac21800484132b5819e4ccc Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Wed, 6 Aug 2008 23:43:37 +0530 Subject: [PATCH 148/352] WL#4380 1) Remove solaris sparc specific output produced by the pre-processor in the .out files 2) Ensure compatibility of preprocessor options for solaris/sparc platform. --- Makefile.am | 15 +++++++-------- include/mysql.h.pp | 8 -------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Makefile.am b/Makefile.am index 77318baf07e..409504bddff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -259,12 +259,10 @@ TEST_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin.h \ # to prevent seeing these messages. # 2) sed the output to # 2.1) remove blank lines and lines that begin with "# " -# (The header information is retained to enable easy -# analysis of abi diffs at a later stage). -# 2.2) When gcc -E is run in the Mac OS it introduces a line of output -# that results in showing up as a difference between the .pp and -# .out files. Remove this OS specific preprocessor text inserted by -# the preprocessor in the MAC OS. +# 2.2) When gcc -E is run on the Mac OS and solaris sparc platforms it +# introduces a line of output that shows up as a difference between +# the .pp and .out files. Remove these OS specific preprocessor text +# inserted by the preprocessor. # 3) diff the generated file and the canons (.pp files already in # the repository). # 4) delete the .out file that is generated. @@ -294,7 +292,7 @@ abi_check_all: $(TEST_PREPROCESSOR_HEADER) do_abi_check: set -ex; \ for file in $(abi_headers); do \ - @CC@ -E -nostdinc -dI \ + @CC@ -E -nostdinc \ -I$(top_srcdir)/include \ -I$(top_srcdir)/include/mysql \ -I$(top_srcdir)/sql \ @@ -304,7 +302,8 @@ do_abi_check: $$file 2>/dev/null | \ @SED@ -e '/^# /d' \ -e '/^[ ]*$$/d' \ - -e '/^#pragma GCC set_debug_pwd/d' > \ + -e '/^#pragma GCC set_debug_pwd/d' \ + -e '/^#ident/d' > \ $(top_builddir)/abi_check.out; \ @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \ @RM@ $(top_builddir)/abi_check.out; \ diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 633cde41130..d4f92bc2ee5 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -1,8 +1,5 @@ -#include typedef char my_bool; typedef int my_socket; -#include "mysql_version.h" -#include "mysql_com.h" enum enum_server_command { COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, @@ -146,7 +143,6 @@ char *get_tty_password(const char *opt_message); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); my_bool my_thread_init(void); void my_thread_end(void); -#include "mysql_time.h" enum enum_mysql_timestamp_type { MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, @@ -159,7 +155,6 @@ typedef struct st_mysql_time my_bool neg; enum enum_mysql_timestamp_type time_type; } MYSQL_TIME; -#include "my_list.h" typedef struct st_list { struct st_list *prev,*next; void *data; @@ -200,8 +195,6 @@ typedef struct st_mysql_field { typedef char **MYSQL_ROW; typedef unsigned int MYSQL_FIELD_OFFSET; typedef unsigned long long my_ulonglong; -#include "typelib.h" -#include "my_alloc.h" typedef struct st_used_mem { struct st_used_mem *next; @@ -239,7 +232,6 @@ typedef struct st_mysql_rows { unsigned long length; } MYSQL_ROWS; typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; -#include "my_alloc.h" typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; typedef struct st_mysql_data { MYSQL_ROWS *data; From 15beb38f9f47fe3807268c5d354d1a2bfefbfa3d Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Wed, 6 Aug 2008 15:27:28 -0400 Subject: [PATCH 149/352] Bug#37201: make tags doesn't work in bazaar server trees bk sfiles -> bzr ls --- support-files/build-tags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/build-tags b/support-files/build-tags index d5f9fbf5100..1879f9f8891 100755 --- a/support-files/build-tags +++ b/support-files/build-tags @@ -2,7 +2,7 @@ rm -f TAGS filter='\.cc$\|\.c$\|\.h$\|\.yy$' -files=`bk -r sfiles -gU | grep $filter ` +files=`bzr ls --kind=file | grep $filter ` for f in $files ; do etags -o TAGS --append $f From b94519a154f9511b11f475a3b62ebb377b0e3c83 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Wed, 6 Aug 2008 16:25:25 -0400 Subject: [PATCH 150/352] Bug#37201: make tags doesn't work in bazaar server trees Fall back to "find" if bzr is unavailable. Don't fail for paths that have spaces in them. --- support-files/build-tags | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/support-files/build-tags b/support-files/build-tags index 1879f9f8891..6c80d2638e9 100755 --- a/support-files/build-tags +++ b/support-files/build-tags @@ -2,8 +2,11 @@ rm -f TAGS filter='\.cc$\|\.c$\|\.h$\|\.yy$' -files=`bzr ls --kind=file | grep $filter ` -for f in $files ; + +list="find . -type f" +bzr root >/dev/null 2>/dev/null && list="bzr ls --kind=file --versioned" + +$list |grep $filter |while read f; do etags -o TAGS --append $f done From e01cac7d89492e3d7cd64e32a79e359b5b13cd89 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 6 Aug 2008 23:23:58 -0300 Subject: [PATCH 151/352] Bug#21226 FLUSH PRIVILEGES does not provided feedback when it fails. Post-merge fix: remove spurious semicolon that caused the function to return failure regardless of the outcome. --- sql/sql_parse.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8857b09b24b..d9ec8f6c610 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6591,7 +6591,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, if (lock_global_read_lock(thd)) return 1; // Killed if (close_cached_tables(thd, tables, FALSE, (options & REFRESH_FAST) ? - FALSE : TRUE, TRUE)); + FALSE : TRUE, TRUE)) result= 1; if (make_global_read_lock_block_commit(thd)) // Killed @@ -6604,7 +6604,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, else { if (close_cached_tables(thd, tables, FALSE, (options & REFRESH_FAST) ? - FALSE : TRUE, FALSE)); + FALSE : TRUE, FALSE)) result= 1; } my_dbopt_cleanup(); From 6c93f05a66e1f522b8f9ec96a4660423f1f20e13 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Thu, 7 Aug 2008 12:24:39 -0400 Subject: [PATCH 152/352] Bug#31605: mysql_upgrade relies on Linux /proc filesystem when not \ running on Windows We used two OS-specific methods of looking up the executable name, which don't work outside of those two kinds of OSes (Linux+Solaris and Windows). We assume that if the user ran this program with a certain name, we can run the other sibling programs with a similar name. (re-patch in bzr) --- client/mysql_upgrade.c | 139 +++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 83 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index ded9d465d3a..15fa6622f74 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -259,6 +259,10 @@ get_one_option(int optid, const struct my_option *opt, } +/** + Run a command using the shell, storing its output in the supplied dynamic + string. +*/ static int run_command(char* cmd, DYNAMIC_STRING *ds_res) { @@ -331,36 +335,16 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...) } -/* - Try to get the full path to this exceutable - - Return 0 if path found - +/** + Look for the filename of given tool, with the presumption that it is in the + same directory as mysql_upgrade and that the same executable-searching + mechanism will be used when we run our sub-shells with popen() later. */ - -static my_bool get_full_path_to_executable(char* path) +static void find_tool(char *tool_executable_name, const char *tool_name, + const char *self_name) { - my_bool ret; - DBUG_ENTER("get_full_path_to_executable"); -#ifdef __WIN__ - ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0); -#else - /* my_readlink returns 0 if a symlink was read */ - ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0); - /* Might also want to try with /proc/$$/exe if the above fails */ -#endif - DBUG_PRINT("exit", ("path: %s", path)); - DBUG_RETURN(ret); -} + char *last_fn_libchar; - -/* - Look for the tool in the same directory as mysql_upgrade. -*/ - -static void find_tool(char *tool_path, const char *tool_name) -{ - char path[FN_REFLEN]; DYNAMIC_STRING ds_tmp; DBUG_ENTER("find_tool"); DBUG_PRINT("enter", ("progname: %s", my_progname)); @@ -368,77 +352,57 @@ static void find_tool(char *tool_path, const char *tool_name) if (init_dynamic_string(&ds_tmp, "", 32, 32)) die("Out of memory"); - /* Initialize path with the full path to this program */ - if (get_full_path_to_executable(path)) + last_fn_libchar= strrchr(self_name, FN_LIBCHAR); + + if (last_fn_libchar == NULL) { /* - Easy way to get full executable path failed, try - other methods + mysql_upgrade was found by the shell searching the path. A sibling + next to us should be found the same way. */ - if (my_progname[0] == FN_LIBCHAR) - { - /* 1. my_progname contains full path */ - strmake(path, my_progname, FN_REFLEN); - } - else if (my_progname[0] == '.') - { - /* 2. my_progname contains relative path, prepend wd */ - char buf[FN_REFLEN]; - my_getwd(buf, FN_REFLEN, MYF(0)); - my_snprintf(path, FN_REFLEN, "%s%s", buf, my_progname); - } - else - { - /* 3. Just go for it and hope tool is in path */ - path[0]= 0; - } + strncpy(tool_executable_name, tool_name, FN_REFLEN); } - - DBUG_PRINT("info", ("path: '%s'", path)); - - /* Chop off binary name (i.e mysql-upgrade) from path */ - dirname_part(path, path); - - /* - When running in a not yet installed build and using libtool, - the program(mysql_upgrade) will be in .libs/ and executed - through a libtool wrapper in order to use the dynamic libraries - from this build. The same must be done for the tools(mysql and - mysqlcheck). Thus if path ends in .libs/, step up one directory - and execute the tools from there - */ - path[max((strlen(path)-1), 0)]= 0; /* Chop off last / */ - if (strncmp(path + dirname_length(path), ".libs", 5) == 0) + else { - DBUG_PRINT("info", ("Chopping off .libs from '%s'", path)); + /* + mysql_upgrade was run absolutely or relatively. We can find a sibling + by replacing our name after the LIBCHAR with the new tool name. + */ - /* Chop off .libs */ - dirname_part(path, path); + /* + When running in a not yet installed build and using libtool, + the program(mysql_upgrade) will be in .libs/ and executed + through a libtool wrapper in order to use the dynamic libraries + from this build. The same must be done for the tools(mysql and + mysqlcheck). Thus if path ends in .libs/, step up one directory + and execute the tools from there + */ + if (((last_fn_libchar - 6) >= self_name) && + (strncmp(last_fn_libchar - 5, ".libs", 5) == 0) && + (*(last_fn_libchar - 6) == FN_LIBCHAR)) + { + DBUG_PRINT("info", ("Chopping off \".libs\" from end of path")); + last_fn_libchar -= 6; + } + + my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s", + (last_fn_libchar - self_name), self_name, + FN_LIBCHAR, + tool_name); } - - DBUG_PRINT("info", ("path: '%s'", path)); - - /* Format name of the tool to search for */ - fn_format(tool_path, tool_name, - path, "", MYF(MY_REPLACE_DIR)); - - verbose("Looking for '%s' in: %s", tool_name, tool_path); - - /* Make sure the tool exists */ - if (my_access(tool_path, F_OK) != 0) - die("Can't find '%s'", tool_path); + verbose("Looking for '%s' as: %s", tool_name, tool_executable_name); /* Make sure it can be executed */ - if (run_tool(tool_path, + if (run_tool(tool_executable_name, &ds_tmp, /* Get output from command, discard*/ "--help", "2>&1", IF_WIN("> NUL", "> /dev/null"), NULL)) - die("Can't execute '%s'", tool_path); + die("Can't execute '%s'", tool_executable_name); dynstr_free(&ds_tmp); @@ -748,11 +712,20 @@ static const char *load_default_groups[]= int main(int argc, char **argv) { + char self_name[FN_REFLEN]; + MY_INIT(argv[0]); #ifdef __NETWARE__ setscreenmode(SCR_AUTOCLOSE_ON_EXIT); #endif +#if __WIN__ + if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0) +#endif + { + strncpy(self_name, argv[0], FN_REFLEN); + } + if (init_dynamic_string(&ds_args, "", 512, 256)) die("Out of memory"); @@ -774,10 +747,10 @@ int main(int argc, char **argv) dynstr_append(&ds_args, " "); /* Find mysql */ - find_tool(mysql_path, IF_WIN("mysql.exe", "mysql")); + find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name); /* Find mysqlcheck */ - find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck")); + find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name); /* Read the mysql_upgrade_info file to check if mysql_upgrade From 4ea036f4cb7ed19d1944259fcba0a337443dbc85 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Thu, 7 Aug 2008 18:25:24 -0600 Subject: [PATCH 153/352] Cherry-pick fix for Bug#35220 from innodb-5.0-ss2475 snapshot. Bug#35220: ALTER TABLE too picky on reserved word "foreign" In ALTER TABLE, change the internal parser to search for ``FOREIGN[[:space:]]'' instead of only ``FOREIGN'' when parsing ALTER TABLE ... DROP FOREIGN KEY ...; otherwise it could be mistaken with ALTER TABLE ... DROP foreign_col; (This fix is already present in MySQL 5.1 and higher.) --- innobase/dict/dict0dict.c | 2 +- mysql-test/r/innodb_bug35220.result | 1 + mysql-test/t/innodb_bug35220.test | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/innodb_bug35220.result create mode 100644 mysql-test/t/innodb_bug35220.test diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 96c822857df..b8d9f362b06 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -3554,7 +3554,7 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); - if (!success) { + if (!success || !ib_isspace(*ptr)) { goto loop; } diff --git a/mysql-test/r/innodb_bug35220.result b/mysql-test/r/innodb_bug35220.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/r/innodb_bug35220.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/t/innodb_bug35220.test b/mysql-test/t/innodb_bug35220.test new file mode 100644 index 00000000000..26f7d6b1ddd --- /dev/null +++ b/mysql-test/t/innodb_bug35220.test @@ -0,0 +1,16 @@ +# +# Bug#35220 ALTER TABLE too picky on reserved word "foreign" +# http://bugs.mysql.com/35220 +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we care only that the following SQL commands do not produce errors +-- disable_query_log +-- disable_result_log + +CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT); +ALTER TABLE bug35220 DROP foreign_col; +DROP TABLE bug35220; From c5095f77f89c45048caae9d324cda77de977a14c Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Fri, 8 Aug 2008 14:30:05 +0530 Subject: [PATCH 154/352] WL#4380 1) Disabled abi_check rule for all compilers except gcc 2) restored the -dI option to retain the header information. --- Makefile.am | 4 ++-- configure.in | 9 +++++++++ include/mysql.h.pp | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 409504bddff..91509f68ccc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,7 +58,7 @@ dist-hook: --datadir=$(distdir)/win/data \ --srcdir=$(top_srcdir) -all-local: abi_check +all-local: @ABI_CHECK@ tags: support-files/build-tags @@ -292,7 +292,7 @@ abi_check_all: $(TEST_PREPROCESSOR_HEADER) do_abi_check: set -ex; \ for file in $(abi_headers); do \ - @CC@ -E -nostdinc \ + @CC@ -E -nostdinc -dI \ -I$(top_srcdir)/include \ -I$(top_srcdir)/include/mysql \ -I$(top_srcdir)/sql \ diff --git a/configure.in b/configure.in index eeb2977e0ba..fea03dbf63a 100644 --- a/configure.in +++ b/configure.in @@ -444,6 +444,15 @@ AC_SUBST(HOSTNAME) AC_SUBST(PERL) AC_SUBST(PERL5) +if expr "$CC" : ".*gcc.*" +then + ABI_CHECK="abi_check" +else + ABI_CHECK="" +fi + +AC_SUBST(ABI_CHECK) + # Lock for PS AC_PATH_PROG(PS, ps, ps) AC_MSG_CHECKING("how to check if pid exists") diff --git a/include/mysql.h.pp b/include/mysql.h.pp index d4f92bc2ee5..633cde41130 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -1,5 +1,8 @@ +#include typedef char my_bool; typedef int my_socket; +#include "mysql_version.h" +#include "mysql_com.h" enum enum_server_command { COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, @@ -143,6 +146,7 @@ char *get_tty_password(const char *opt_message); const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); my_bool my_thread_init(void); void my_thread_end(void); +#include "mysql_time.h" enum enum_mysql_timestamp_type { MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, @@ -155,6 +159,7 @@ typedef struct st_mysql_time my_bool neg; enum enum_mysql_timestamp_type time_type; } MYSQL_TIME; +#include "my_list.h" typedef struct st_list { struct st_list *prev,*next; void *data; @@ -195,6 +200,8 @@ typedef struct st_mysql_field { typedef char **MYSQL_ROW; typedef unsigned int MYSQL_FIELD_OFFSET; typedef unsigned long long my_ulonglong; +#include "typelib.h" +#include "my_alloc.h" typedef struct st_used_mem { struct st_used_mem *next; @@ -232,6 +239,7 @@ typedef struct st_mysql_rows { unsigned long length; } MYSQL_ROWS; typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; +#include "my_alloc.h" typedef struct embedded_query_result EMBEDDED_QUERY_RESULT; typedef struct st_mysql_data { MYSQL_ROWS *data; From 9fc39adfda1391892a5604c0b754d07edb3690cd Mon Sep 17 00:00:00 2001 From: Kristofer Pettersson Date: Mon, 11 Aug 2008 11:40:54 +0200 Subject: [PATCH 155/352] Bug#38486 Crash when using cursor protocol Server side cursors were not initialized properly and this caused a reference to uninitialized memory. --- sql/sql_cursor.cc | 5 ++++- tests/mysql_client_test.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc index c2345f1f2cd..16567765ba6 100644 --- a/sql/sql_cursor.cc +++ b/sql/sql_cursor.cc @@ -111,7 +111,8 @@ class Select_materialize: public select_union select_result *result; /* the result object of the caller (PS or SP) */ public: Materialized_cursor *materialized_cursor; - Select_materialize(select_result *result_arg) :result(result_arg) {} + Select_materialize(select_result *result_arg) :result(result_arg), + materialized_cursor(0) {} virtual bool send_fields(List &list, uint flags); }; @@ -155,6 +156,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result, if (! (sensitive_cursor= new (thd->mem_root) Sensitive_cursor(thd, result))) { delete result_materialize; + result_materialize= NULL; return 1; } @@ -212,6 +214,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result, if ((rc= materialized_cursor->open(0))) { delete materialized_cursor; + materialized_cursor= NULL; goto err_open; } diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 5e1c2afe84a..4336bfa0c59 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16189,6 +16189,35 @@ static void test_bug32265() DBUG_VOID_RETURN; } + +/** + Bug#38486 Crash when using cursor protocol +*/ + +static void test_bug38486(void) +{ + myheader("test_bug38486"); + + MYSQL_STMT *stmt; + stmt= mysql_stmt_init(mysql); + unsigned long type= CURSOR_TYPE_READ_ONLY; + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + const char *sql= "CREATE TABLE t1 (a INT)"; + mysql_stmt_prepare(stmt,sql,strlen(sql)); + + mysql_stmt_execute(stmt); + mysql_stmt_close(stmt); + + stmt= mysql_stmt_init(mysql); + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + const char *sql2= "INSERT INTO t1 VALUES (1)"; + mysql_stmt_prepare(stmt,sql2,strlen(sql2)); + mysql_stmt_execute(stmt); + + mysql_stmt_close(stmt); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -16483,6 +16512,7 @@ static struct my_tests_st my_tests[]= { { "test_bug29306", test_bug29306 }, { "test_bug31669", test_bug31669 }, { "test_bug32265", test_bug32265 }, + { "test_bug38486", test_bug38486 }, { 0, 0 } }; From eaeef499547bb30f5399a0a9300c346dda961b9e Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Mon, 11 Aug 2008 16:55:09 +0530 Subject: [PATCH 156/352] WL#4380 Added a comment to the abi_check related part of configure.in --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index fea03dbf63a..f20aa5ab49b 100644 --- a/configure.in +++ b/configure.in @@ -444,6 +444,8 @@ AC_SUBST(HOSTNAME) AC_SUBST(PERL) AC_SUBST(PERL5) +# Enable the abi_check rule only if gcc is available + if expr "$CC" : ".*gcc.*" then ABI_CHECK="abi_check" From bafa07b2c49c1d64e1b58d1df78889ca1a5cda0d Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 11 Aug 2008 10:08:21 -0300 Subject: [PATCH 157/352] Post-merge fix: Silence warning due to type mismatch. --- client/mysql_upgrade.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 15fa6622f74..74e8c9dd577 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -364,7 +364,9 @@ static void find_tool(char *tool_executable_name, const char *tool_name, } else { - /* + int len; + + /* mysql_upgrade was run absolutely or relatively. We can find a sibling by replacing our name after the LIBCHAR with the new tool name. */ @@ -385,10 +387,10 @@ static void find_tool(char *tool_executable_name, const char *tool_name, last_fn_libchar -= 6; } + len= last_fn_libchar - self_name; + my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s", - (last_fn_libchar - self_name), self_name, - FN_LIBCHAR, - tool_name); + len, self_name, FN_LIBCHAR, tool_name); } verbose("Looking for '%s' as: %s", tool_name, tool_executable_name); From fe39a901bb1dd00e389be62979ff3a360ac920b5 Mon Sep 17 00:00:00 2001 From: Chad MILLER Date: Mon, 11 Aug 2008 11:28:35 -0400 Subject: [PATCH 158/352] Backport compiler warning fix from 5.1-bugteam. --- client/mysql_upgrade.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 15fa6622f74..74e8c9dd577 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -364,7 +364,9 @@ static void find_tool(char *tool_executable_name, const char *tool_name, } else { - /* + int len; + + /* mysql_upgrade was run absolutely or relatively. We can find a sibling by replacing our name after the LIBCHAR with the new tool name. */ @@ -385,10 +387,10 @@ static void find_tool(char *tool_executable_name, const char *tool_name, last_fn_libchar -= 6; } + len= last_fn_libchar - self_name; + my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s", - (last_fn_libchar - self_name), self_name, - FN_LIBCHAR, - tool_name); + len, self_name, FN_LIBCHAR, tool_name); } verbose("Looking for '%s' as: %s", tool_name, tool_executable_name); From 394691cd905de866ef52806d78ac6f9c38016f72 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 11 Aug 2008 10:10:00 -0600 Subject: [PATCH 159/352] Bug#38296 (low memory crash with many conditions in a query) This fix is for 5.0 only : back porting the 6.0 patch manually The parser code in sql/sql_yacc.yy needs to be more robust to out of memory conditions, so that when parsing a query fails due to OOM, the thread gracefully returns an error. Before this fix, a new/alloc returning NULL could: - cause a crash, if dereferencing the NULL pointer, - produce a corrupted parsed tree, containing NULL nodes, - alter the semantic of a query, by silently dropping token values or nodes With this fix: - C++ constructors are *not* executed with a NULL "this" pointer when operator new fails. This is achieved by declaring "operator new" with a "throw ()" clause, so that a failed new gracefully returns NULL on OOM conditions. - calls to new/alloc are tested for a NULL result, - The thread diagnostic area is set to an error status when OOM occurs. This ensures that a request failing in the server properly returns an ER_OUT_OF_RESOURCES error to the client. - OOM conditions cause the parser to stop immediately (MYSQL_YYABORT). This prevents causing further crashes when using a partially built parsed tree in further rules in the parser. No test scripts are provided, since automating OOM failures is not instrumented in the server. Tested under the debugger, to verify that an error in alloc_root cause the thread to returns gracefully all the way to the client application, with an ER_OUT_OF_RESOURCES error. --- mysys/my_alloc.c | 2 +- sql/field.h | 3 +- sql/item.h | 4 +- sql/sp_head.cc | 2 +- sql/sql_lex.h | 4 +- sql/sql_list.h | 4 +- sql/sql_string.h | 2 +- sql/sql_yacc.yy | 1775 ++++++++++++++++++++++++++++++++++++--------- sql/thr_malloc.cc | 31 +- 9 files changed, 1483 insertions(+), 344 deletions(-) diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 5983a29a3e1..99b5aec7eea 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -202,7 +202,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size) { if (mem_root->error_handler) (*mem_root->error_handler)(); - return((gptr) 0); /* purecov: inspected */ + DBUG_RETURN((gptr) 0); /* purecov: inspected */ } mem_root->block_num++; next->next= *prev; diff --git a/sql/field.h b/sql/field.h index 8d771a151a7..241ad61f339 100644 --- a/sql/field.h +++ b/sql/field.h @@ -48,7 +48,8 @@ class Field Field(const Item &); /* Prevent use of these */ void operator=(Field &); public: - static void *operator new(size_t size) {return (void*) sql_alloc((uint) size); } + static void *operator new(size_t size) throw () + { return (void*) sql_alloc((uint) size); } static void operator delete(void *ptr_arg, size_t size) { TRASH(ptr_arg, size); } char *ptr; // Position to field in record diff --git a/sql/item.h b/sql/item.h index a948c5a45f7..126730bb892 100644 --- a/sql/item.h +++ b/sql/item.h @@ -439,9 +439,9 @@ class Item { Item(const Item &); /* Prevent use of these */ void operator=(Item &); public: - static void *operator new(size_t size) + static void *operator new(size_t size) throw () { return (void*) sql_alloc((uint) size); } - static void *operator new(size_t size, MEM_ROOT *mem_root) + static void *operator new(size_t size, MEM_ROOT *mem_root) throw () { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); } static void operator delete(void *ptr, MEM_ROOT *mem_root) {} diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 2d920598c46..b1bfab40acd 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -446,7 +446,7 @@ sp_head::operator new(size_t size) throw() init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC); sp= (sp_head *) alloc_root(&own_root, size); if (sp == NULL) - return NULL; + DBUG_RETURN(NULL); sp->main_mem_root= own_root; DBUG_PRINT("info", ("mem_root 0x%lx", (ulong) &sp->mem_root)); DBUG_RETURN(sp); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index df0db2e209d..563172594d2 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -331,11 +331,11 @@ public: bool no_table_names_allowed; /* used for global order by */ bool no_error; /* suppress error message (convert it to warnings) */ - static void *operator new(size_t size) + static void *operator new(size_t size) throw () { return (void*) sql_alloc((uint) size); } - static void *operator new(size_t size, MEM_ROOT *mem_root) + static void *operator new(size_t size, MEM_ROOT *mem_root) throw () { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); } static void operator delete(void *ptr, MEM_ROOT *mem_root) {} diff --git a/sql/sql_list.h b/sql/sql_list.h index 7913acfd086..1ad2051f065 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -27,7 +27,7 @@ public: { return (void*) sql_alloc((uint) size); } - static void *operator new[](size_t size) + static void *operator new[](size_t size) throw () { return (void*) sql_alloc((uint) size); } @@ -466,7 +466,7 @@ public: struct ilink { struct ilink **prev,*next; - static void *operator new(size_t size) + static void *operator new(size_t size) throw () { return (void*)my_malloc((uint)size, MYF(MY_WME | MY_FAE)); } diff --git a/sql/sql_string.h b/sql/sql_string.h index c1d27cb1791..4432451464e 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -78,7 +78,7 @@ public: Alloced_length=str.Alloced_length; alloced=0; str_charset=str.str_charset; } - static void *operator new(size_t size, MEM_ROOT *mem_root) + static void *operator new(size_t size, MEM_ROOT *mem_root) throw () { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr_arg,size_t size) { TRASH(ptr_arg, size); } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 39851ac66f8..c04eca6bd3f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1540,6 +1540,8 @@ create: { LEX *lex=Lex; Key *key= new Key($2, $4.str, $5, 0, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); @@ -1599,6 +1601,8 @@ sp_name: MYSQL_YYABORT; } $$= new sp_name($1, $3, true); + if ($$ == NULL) + MYSQL_YYABORT; $$->init_qname(YYTHD); } | ident @@ -1614,8 +1618,9 @@ sp_name: if (lex->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; $$= new sp_name(db, $1, false); - if ($$) - $$->init_qname(YYTHD); + if ($$ == NULL) + MYSQL_YYABORT; + $$->init_qname(YYTHD); } ; @@ -1866,6 +1871,8 @@ sp_decl: if (!dflt_value_item) { dflt_value_item= new Item_null(); + if (dflt_value_item == NULL) + MYSQL_YYABORT; /* QQ Set to the var_type with null_value? */ } @@ -1891,10 +1898,17 @@ sp_decl: /* The last instruction is responsible for freeing LEX. */ - lex->sphead->add_instr( - new sp_instr_set(lex->sphead->instructions(), pctx, var_idx, - dflt_value_item, var_type, lex, - (i == num_vars - 1))); + sp_instr_set *is= new sp_instr_set(lex->sphead->instructions(), + pctx, + var_idx, + dflt_value_item, + var_type, + lex, + (i == num_vars - 1)); + if (is == NULL) + MYSQL_YYABORT; + + lex->sphead->add_instr(is); } pctx->declare_var_boundary(0); @@ -1928,6 +1942,8 @@ sp_decl: sp_instr_hpush_jump *i= new sp_instr_hpush_jump(sp->instructions(), ctx, $2, ctx->current_var_count()); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); sp->push_backpatch(i, ctx->push_label((char *)"", 0)); @@ -1980,7 +1996,7 @@ sp_decl: } i= new sp_instr_cpush(sp->instructions(), ctx, $5, ctx->current_cursor_count()); - if ( i==NULL ) + if (i == NULL) MYSQL_YYABORT; sp->add_instr(i); ctx->push_cursor(&$2); @@ -2061,6 +2077,8 @@ sp_cond: ulong_num { /* mysql errno */ $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + YYABORT; $$->type= sp_cond_type_t::number; $$->mysqlerr= $1; } @@ -2072,6 +2090,8 @@ sp_cond: MYSQL_YYABORT; } $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + YYABORT; $$->type= sp_cond_type_t::state; memcpy($$->sqlstate, $3.str, 5); $$->sqlstate[5]= '\0'; @@ -2100,16 +2120,22 @@ sp_hcond: | SQLWARNING_SYM /* SQLSTATEs 01??? */ { $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + YYABORT; $$->type= sp_cond_type_t::warning; } | not FOUND_SYM /* SQLSTATEs 02??? */ { $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + YYABORT; $$->type= sp_cond_type_t::notfound; } | SQLEXCEPTION_SYM /* All other SQLSTATEs */ { $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + YYABORT; $$->type= sp_cond_type_t::exception; } ; @@ -3085,6 +3111,8 @@ key_def: { LEX *lex=Lex; Key *key= new Key($1, $2, $7 ? $7 : $3, 0, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ @@ -3094,6 +3122,8 @@ key_def: LEX *lex=Lex; const char *key_name= $3 ? $3:$1; Key *key= new Key($2, key_name, $4, 0, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ } @@ -3107,10 +3137,14 @@ key_def: lex->fk_delete_opt, lex->fk_update_opt, lex->fk_match_option); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); key= new Key(Key::MULTIPLE, key_name, HA_KEY_ALG_UNDEF, 1, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ } @@ -3400,7 +3434,12 @@ attribute: ; now_or_signed_literal: - NOW_SYM optional_braces { $$= new Item_func_now_local(); } + NOW_SYM optional_braces + { + $$= new Item_func_now_local(); + if ($$ == NULL) + MYSQL_YYABORT; + } | signed_literal { $$=$1; } ; @@ -3526,8 +3565,21 @@ opt_ref_list: | '(' ref_list ')' opt_on_delete {}; ref_list: - ref_list ',' ident { Lex->ref_list.push_back(new key_part_spec($3.str)); } - | ident { Lex->ref_list.push_back(new key_part_spec($1.str)); }; + ref_list ',' ident + { + key_part_spec *key= new key_part_spec($3.str); + if (key == NULL) + MYSQL_YYABORT; + Lex->ref_list.push_back(key); + } + | ident + { + key_part_spec *key= new key_part_spec($1.str); + if (key == NULL) + MYSQL_YYABORT; + Lex->ref_list.push_back(key); + } + ; opt_on_delete: @@ -3618,16 +3670,24 @@ key_list: | key_part order_dir { Lex->col_list.push_back($1); }; key_part: - ident { $$=new key_part_spec($1.str); } - | ident '(' NUM ')' - { - int key_part_len= atoi($3.str); - if (!key_part_len) + ident { - my_error(ER_KEY_PART_0, MYF(0), $1.str); + $$= new key_part_spec($1.str); + if ($$ == NULL) + MYSQL_YYABORT; } - $$=new key_part_spec($1.str,(uint) key_part_len); - }; + | ident '(' NUM ')' + { + int key_part_len= atoi($3.str); + if (!key_part_len) + { + my_error(ER_KEY_PART_0, MYF(0), $1.str); + } + $$=new key_part_spec($1.str,(uint) key_part_len); + if ($$ == NULL) + MYSQL_YYABORT; + } + ; opt_ident: /* empty */ { $$=(char*) 0; } /* Defaultlength */ @@ -3797,8 +3857,10 @@ alter_list_item: | DROP opt_column field_ident opt_restrict { LEX *lex=Lex; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN, - $3.str)); + Alter_drop *ad= new Alter_drop(Alter_drop::COLUMN, $3.str); + if (ad == NULL) + MYSQL_YYABORT; + lex->alter_info.drop_list.push_back(ad); lex->alter_info.flags|= ALTER_DROP_COLUMN; } | DROP FOREIGN KEY_SYM opt_ident @@ -3808,15 +3870,19 @@ alter_list_item: | DROP PRIMARY_SYM KEY_SYM { LEX *lex=Lex; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - primary_key_name)); + Alter_drop *ad= new Alter_drop(Alter_drop::KEY, primary_key_name); + if (ad == NULL) + MYSQL_YYABORT; + lex->alter_info.drop_list.push_back(ad); lex->alter_info.flags|= ALTER_DROP_INDEX; } | DROP key_or_index field_ident { LEX *lex=Lex; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - $3.str)); + Alter_drop *ad= new Alter_drop(Alter_drop::KEY, $3.str); + if (ad == NULL) + MYSQL_YYABORT; + lex->alter_info.drop_list.push_back(ad); lex->alter_info.flags|= ALTER_DROP_INDEX; } | DISABLE_SYM KEYS @@ -3834,14 +3900,19 @@ alter_list_item: | ALTER opt_column field_ident SET DEFAULT signed_literal { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column($3.str,$6)); + Alter_column *ac= new Alter_column($3.str, $6); + if (ac == NULL) + MYSQL_YYABORT; + lex->alter_info.alter_list.push_back(ac); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } | ALTER opt_column field_ident DROP DEFAULT { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column($3.str, - (Item*) 0)); + Alter_column *ac= new Alter_column($3.str, (Item*) 0); + if (ac == NULL) + MYSQL_YYABORT; + lex->alter_info.alter_list.push_back(ac); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } | RENAME opt_to table_ident @@ -4467,10 +4538,11 @@ select_item_list: | '*' { THD *thd= YYTHD; - if (add_item_to_list(thd, - new Item_field(&thd->lex->current_select-> - context, - NULL, NULL, "*"))) + Item *item= new Item_field(&thd->lex->current_select->context, + NULL, NULL, "*"); + if (item == NULL) + MYSQL_YYABORT; + if (add_item_to_list(thd, item)) MYSQL_YYABORT; (thd->lex->current_select->with_wild)++; }; @@ -4577,12 +4649,16 @@ expr: { /* X OR Y */ $$ = new (YYTHD->mem_root) Item_cond_or($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; } } | expr XOR expr %prec XOR { /* XOR is a proprietary extension */ $$ = new (YYTHD->mem_root) Item_cond_xor($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; } | expr and expr %prec AND_SYM { @@ -4623,62 +4699,124 @@ expr: { /* X AND Y */ $$ = new (YYTHD->mem_root) Item_cond_and($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; } } | NOT_SYM expr %prec NOT_SYM - { $$= negate_expression(YYTHD, $2); } + { + $$= negate_expression(YYTHD, $2); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS TRUE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_istrue($1); } + { + $$= new (YYTHD->mem_root) Item_func_istrue($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not TRUE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_isnottrue($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnottrue($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS FALSE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_isfalse($1); } + { + $$= new (YYTHD->mem_root) Item_func_isfalse($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not FALSE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_isnotfalse($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnotfalse($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS UNKNOWN_SYM %prec IS - { $$= new Item_func_isnull($1); } + { + $$= new Item_func_isnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not UNKNOWN_SYM %prec IS - { $$= new Item_func_isnotnull($1); } + { + $$= new Item_func_isnotnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri ; bool_pri: bool_pri IS NULL_SYM %prec IS - { $$= new Item_func_isnull($1); } + { + $$= new Item_func_isnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not NULL_SYM %prec IS - { $$= new Item_func_isnotnull($1); } + { + $$= new Item_func_isnotnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri EQUAL_SYM predicate %prec EQUAL_SYM - { $$= new Item_func_equal($1,$3); } + { + $$= new Item_func_equal($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri comp_op predicate %prec EQ - { $$= (*$2)(0)->create($1,$3); } + { + $$= (*$2)(0)->create($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri comp_op all_or_any '(' subselect ')' %prec EQ - { $$= all_any_subquery_creator($1, $2, $3, $5); } + { + $$= all_any_subquery_creator($1, $2, $3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | predicate ; predicate: bit_expr IN_SYM '(' subselect ')' { $$= new (YYTHD->mem_root) Item_in_subselect($1, $4); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr not IN_SYM '(' subselect ')' { THD *thd= YYTHD; Item *item= new (thd->mem_root) Item_in_subselect($1, $5); + if (item == NULL) + MYSQL_YYABORT; $$= negate_expression(thd, item); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr IN_SYM '(' expr ')' { $$= handle_sql2003_note184_exception(YYTHD, $1, true, $4); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr IN_SYM '(' expr ',' expr_list ')' { $6->push_front($4); $6->push_front($1); $$= new (YYTHD->mem_root) Item_func_in(*$6); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr not IN_SYM '(' expr ')' { $$= handle_sql2003_note184_exception(YYTHD, $1, false, $5); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr not IN_SYM '(' expr ',' expr_list ')' { @@ -4691,54 +4829,146 @@ predicate: $$= item; } | bit_expr BETWEEN_SYM bit_expr AND_SYM predicate - { $$= new Item_func_between($1,$3,$5); } + { + $$= new Item_func_between($1,$3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr not BETWEEN_SYM bit_expr AND_SYM predicate { Item_func_between *item= new Item_func_between($1,$4,$6); + if (item == NULL) + MYSQL_YYABORT; item->negate(); $$= item; } | bit_expr SOUNDS_SYM LIKE bit_expr - { $$= new Item_func_eq(new Item_func_soundex($1), - new Item_func_soundex($4)); } + { + Item *item1= new Item_func_soundex($1); + Item *item4= new Item_func_soundex($4); + if ((item1 == NULL) || (item4 == NULL)) + MYSQL_YYABORT; + $$= new Item_func_eq(item1, item4); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr LIKE simple_expr opt_escape - { $$= new Item_func_like($1,$3,$4,Lex->escape_used); } + { + $$= new Item_func_like($1,$3,$4,Lex->escape_used); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr not LIKE simple_expr opt_escape - { $$= new Item_func_not(new Item_func_like($1,$4,$5, Lex->escape_used)); } - | bit_expr REGEXP bit_expr { $$= new Item_func_regex($1,$3); } + { + Item *item= new Item_func_like($1,$4,$5, Lex->escape_used); + if (item == NULL) + MYSQL_YYABORT; + $$= new Item_func_not(item); + if ($$ == NULL) + MYSQL_YYABORT; + } + | bit_expr REGEXP bit_expr + { + $$= new Item_func_regex($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr not REGEXP bit_expr - { $$= negate_expression(YYTHD, new Item_func_regex($1,$4)); } + { + Item *item= new Item_func_regex($1,$4); + if (item == NULL) + MYSQL_YYABORT; + $$= negate_expression(YYTHD, item); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr ; bit_expr: bit_expr '|' bit_expr %prec '|' - { $$= new Item_func_bit_or($1,$3); } + { + $$= new Item_func_bit_or($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '&' bit_expr %prec '&' - { $$= new Item_func_bit_and($1,$3); } + { + $$= new Item_func_bit_and($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT - { $$= new Item_func_shift_left($1,$3); } + { + $$= new Item_func_shift_left($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT - { $$= new Item_func_shift_right($1,$3); } + { + $$= new Item_func_shift_right($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '+' bit_expr %prec '+' - { $$= new Item_func_plus($1,$3); } + { + $$= new Item_func_plus($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '-' bit_expr %prec '-' - { $$= new Item_func_minus($1,$3); } + { + $$= new Item_func_minus($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '+' interval_expr interval %prec '+' - { $$= new Item_date_add_interval($1,$3,$4,0); } + { + $$= new Item_date_add_interval($1,$3,$4,0); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '-' interval_expr interval %prec '-' - { $$= new Item_date_add_interval($1,$3,$4,1); } + { + $$= new Item_date_add_interval($1,$3,$4,1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '*' bit_expr %prec '*' - { $$= new Item_func_mul($1,$3); } + { + $$= new Item_func_mul($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '/' bit_expr %prec '/' - { $$= new Item_func_div($1,$3); } + { + $$= new Item_func_div($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '%' bit_expr %prec '%' - { $$= new Item_func_mod($1,$3); } + { + $$= new Item_func_mod($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr DIV_SYM bit_expr %prec DIV_SYM - { $$= new Item_func_int_div($1,$3); } + { + $$= new Item_func_int_div($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr MOD_SYM bit_expr %prec MOD_SYM - { $$= new Item_func_mod($1,$3); } + { + $$= new Item_func_mod($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '^' bit_expr - { $$= new Item_func_bit_xor($1,$3); } + { + $$= new Item_func_bit_xor($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | simple_expr ; @@ -4768,67 +4998,118 @@ simple_expr: simple_ident | simple_expr COLLATE_SYM ident_or_text %prec NEG { - $$= new Item_func_set_collation($1, - new Item_string($3.str, - $3.length, - YYTHD->charset())); + Item *item= new Item_string($3.str, $3.length, YYTHD->charset()); + if (item == NULL) + MYSQL_YYABORT; + $$= new Item_func_set_collation($1, item); + if ($$ == NULL) + MYSQL_YYABORT; } | literal | param_marker | variable | sum_expr | simple_expr OR_OR_SYM simple_expr - { $$= new Item_func_concat($1, $3); } - | '+' simple_expr %prec NEG { $$= $2; } - | '-' simple_expr %prec NEG { $$= new Item_func_neg($2); } - | '~' simple_expr %prec NEG { $$= new Item_func_bit_neg($2); } - | not2 simple_expr %prec NEG { $$= negate_expression(YYTHD, $2); } + { + $$= new Item_func_concat($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '+' simple_expr %prec NEG + { $$= $2; } + | '-' simple_expr %prec NEG + { + $$= new Item_func_neg($2); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '~' simple_expr %prec NEG + { + $$= new Item_func_bit_neg($2); + if ($$ == NULL) + MYSQL_YYABORT; + } + | not2 simple_expr %prec NEG + { + $$= negate_expression(YYTHD, $2); + if ($$ == NULL) + MYSQL_YYABORT; + } | '(' subselect ')' { $$= new Item_singlerow_subselect($2); + if ($$ == NULL) + MYSQL_YYABORT; } | '(' expr ')' { $$= $2; } | '(' expr ',' expr_list ')' { $4->push_front($2); $$= new Item_row(*$4); + if ($$ == NULL) + MYSQL_YYABORT; } | ROW_SYM '(' expr ',' expr_list ')' { $5->push_front($3); $$= new Item_row(*$5); + if ($$ == NULL) + MYSQL_YYABORT; } | EXISTS '(' subselect ')' { $$= new Item_exists_subselect($3); + if ($$ == NULL) + MYSQL_YYABORT; } - | '{' ident expr '}' { $$= $3; } + | '{' ident expr '}' + { $$= $3; } | MATCH ident_list_arg AGAINST '(' bit_expr fulltext_options ')' - { $2->push_front($5); - Select->add_ftfunc_to_list((Item_func_match*) - ($$=new Item_func_match(*$2,$6))); } - | ASCII_SYM '(' expr ')' { $$= new Item_func_ascii($3); } + { + $2->push_front($5); + Item_func_match *item= new Item_func_match(*$2,$6); + if (item == NULL) + MYSQL_YYABORT; + Select->add_ftfunc_to_list(item); + $$= item; + } + | ASCII_SYM '(' expr ')' + { + $$= new Item_func_ascii($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | BINARY simple_expr %prec NEG { $$= create_func_cast($2, ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); + if ($$ == NULL) + MYSQL_YYABORT; } | CAST_SYM '(' expr AS cast_type ')' { LEX *lex= Lex; $$= create_func_cast($3, $5, lex->length, lex->dec, lex->charset); - if (!$$) + if ($$ == NULL) MYSQL_YYABORT; } | CASE_SYM opt_expr when_list opt_else END - { $$= new Item_func_case(* $3, $2, $4 ); } + { + $$= new Item_func_case(* $3, $2, $4 ); + if ($$ == NULL) + MYSQL_YYABORT; + } | CONVERT_SYM '(' expr ',' cast_type ')' { $$= create_func_cast($3, $5, Lex->length, Lex->dec, Lex->charset); - if (!$$) + if ($$ == NULL) MYSQL_YYABORT; } | CONVERT_SYM '(' expr USING charset_name ')' - { $$= new Item_func_conv_charset($3,$5); } + { + $$= new Item_func_conv_charset($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | DEFAULT '(' simple_ident ')' { if ($3->is_splocal()) @@ -4839,9 +5120,15 @@ simple_expr: MYSQL_YYABORT; } $$= new Item_default_value(Lex->current_context(), $3); + if ($$ == NULL) + MYSQL_YYABORT; } | VALUES '(' simple_ident_nospvar ')' - { $$= new Item_insert_value(Lex->current_context(), $3); } + { + $$= new Item_insert_value(Lex->current_context(), $3); + if ($$ == NULL) + MYSQL_YYABORT; + } | FUNC_ARG0 '(' ')' { if (!$1.symbol->create_func) @@ -4852,6 +5139,8 @@ simple_expr: MYSQL_YYABORT; } $$= ((Item*(*)(void))($1.symbol->create_func))(); + if ($$ == NULL) + MYSQL_YYABORT; } | FUNC_ARG1 '(' expr ')' { @@ -4863,6 +5152,8 @@ simple_expr: MYSQL_YYABORT; } $$= ((Item*(*)(Item*))($1.symbol->create_func))($3); + if ($$ == NULL) + MYSQL_YYABORT; } | FUNC_ARG2 '(' expr ',' expr ')' { @@ -4874,6 +5165,8 @@ simple_expr: MYSQL_YYABORT; } $$= ((Item*(*)(Item*,Item*))($1.symbol->create_func))($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; } | FUNC_ARG3 '(' expr ',' expr ',' expr ')' { @@ -4885,106 +5178,264 @@ simple_expr: MYSQL_YYABORT; } $$= ((Item*(*)(Item*,Item*,Item*))($1.symbol->create_func))($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; } | ADDDATE_SYM '(' expr ',' expr ')' - { $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0);} + { + $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')' - { $$= new Item_date_add_interval($3, $6, $7, 0); } + { + $$= new Item_date_add_interval($3, $6, $7, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | REPEAT_SYM '(' expr ',' expr ')' - { $$= new Item_func_repeat($3,$5); } + { + $$= new Item_func_repeat($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | ATAN '(' expr ')' - { $$= new Item_func_atan($3); } + { + $$= new Item_func_atan($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | ATAN '(' expr ',' expr ')' - { $$= new Item_func_atan($3,$5); } + { + $$= new Item_func_atan($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | CHAR_SYM '(' expr_list ')' - { $$= new Item_func_char(*$3); } + { + $$= new Item_func_char(*$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | CHAR_SYM '(' expr_list USING charset_name ')' - { $$= new Item_func_char(*$3, $5); } + { + $$= new Item_func_char(*$3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | CHARSET '(' expr ')' - { $$= new Item_func_charset($3); } + { + $$= new Item_func_charset($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COALESCE '(' expr_list ')' - { $$= new Item_func_coalesce(* $3); } + { + $$= new Item_func_coalesce(* $3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COLLATION_SYM '(' expr ')' - { $$= new Item_func_collation($3); } + { + $$= new Item_func_collation($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | CONCAT '(' expr_list ')' - { $$= new Item_func_concat(* $3); } + { + $$= new Item_func_concat(* $3); + if ($$ == NULL) + MYSQL_YYABORT; + } | CONCAT_WS '(' expr ',' expr_list ')' - { $5->push_front($3); $$= new Item_func_concat_ws(*$5); } + { + $5->push_front($3); + $$= new Item_func_concat_ws(*$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | CONVERT_TZ_SYM '(' expr ',' expr ',' expr ')' { if (Lex->add_time_zone_tables_to_query_tables(YYTHD)) MYSQL_YYABORT; $$= new Item_func_convert_tz($3, $5, $7); + if ($$ == NULL) + MYSQL_YYABORT; } | CURDATE optional_braces - { $$= new Item_func_curdate_local(); Lex->safe_to_cache_query=0; } + { + $$= new Item_func_curdate_local(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | CURTIME optional_braces - { $$= new Item_func_curtime_local(); Lex->safe_to_cache_query=0; } + { + $$= new Item_func_curtime_local(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | CURTIME '(' expr ')' { $$= new Item_func_curtime_local($3); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | CURRENT_USER optional_braces { $$= new Item_func_current_user(Lex->current_context()); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query= 0; } | DATE_ADD_INTERVAL '(' expr ',' interval_expr interval ')' - { $$= new Item_date_add_interval($3,$5,$6,0); } + { + $$= new Item_date_add_interval($3,$5,$6,0); + if ($$ == NULL) + MYSQL_YYABORT; + } | DATE_SUB_INTERVAL '(' expr ',' interval_expr interval ')' - { $$= new Item_date_add_interval($3,$5,$6,1); } + { + $$= new Item_date_add_interval($3,$5,$6,1); + if ($$ == NULL) + MYSQL_YYABORT; + } | DATABASE '(' ')' { $$= new Item_func_database(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | DATE_SYM '(' expr ')' - { $$= new Item_date_typecast($3); } + { + $$= new Item_date_typecast($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | DAY_SYM '(' expr ')' - { $$= new Item_func_dayofmonth($3); } + { + $$= new Item_func_dayofmonth($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | ELT_FUNC '(' expr ',' expr_list ')' - { $5->push_front($3); $$= new Item_func_elt(*$5); } + { + $5->push_front($3); + $$= new Item_func_elt(*$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | MAKE_SET_SYM '(' expr ',' expr_list ')' - { $$= new Item_func_make_set($3, *$5); } + { + $$= new Item_func_make_set($3, *$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | ENCRYPT '(' expr ')' { $$= new Item_func_encrypt($3); + if ($$ == NULL) + MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_RAND); } - | ENCRYPT '(' expr ',' expr ')' { $$= new Item_func_encrypt($3,$5); } + | ENCRYPT '(' expr ',' expr ')' + { + $$= new Item_func_encrypt($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | DECODE_SYM '(' expr ',' TEXT_STRING_literal ')' - { $$= new Item_func_decode($3,$5.str); } + { + $$= new Item_func_decode($3,$5.str); + if ($$ == NULL) + MYSQL_YYABORT; + } | ENCODE_SYM '(' expr ',' TEXT_STRING_literal ')' - { $$= new Item_func_encode($3,$5.str); } + { + $$= new Item_func_encode($3,$5.str); + if ($$ == NULL) + MYSQL_YYABORT; + } | DES_DECRYPT_SYM '(' expr ')' - { $$= new Item_func_des_decrypt($3); } + { + $$= new Item_func_des_decrypt($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | DES_DECRYPT_SYM '(' expr ',' expr ')' - { $$= new Item_func_des_decrypt($3,$5); } + { + $$= new Item_func_des_decrypt($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | DES_ENCRYPT_SYM '(' expr ')' - { $$= new Item_func_des_encrypt($3); } + { + $$= new Item_func_des_encrypt($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | DES_ENCRYPT_SYM '(' expr ',' expr ')' - { $$= new Item_func_des_encrypt($3,$5); } + { + $$= new Item_func_des_encrypt($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | EXPORT_SET '(' expr ',' expr ',' expr ')' - { $$= new Item_func_export_set($3, $5, $7); } + { + $$= new Item_func_export_set($3, $5, $7); + if ($$ == NULL) + MYSQL_YYABORT; + } | EXPORT_SET '(' expr ',' expr ',' expr ',' expr ')' - { $$= new Item_func_export_set($3, $5, $7, $9); } + { + $$= new Item_func_export_set($3, $5, $7, $9); + if ($$ == NULL) + MYSQL_YYABORT; + } | EXPORT_SET '(' expr ',' expr ',' expr ',' expr ',' expr ')' - { $$= new Item_func_export_set($3, $5, $7, $9, $11); } + { + $$= new Item_func_export_set($3, $5, $7, $9, $11); + if ($$ == NULL) + MYSQL_YYABORT; + } | FORMAT_SYM '(' expr ',' NUM ')' - { $$= new Item_func_format($3,atoi($5.str)); } + { + $$= new Item_func_format($3,atoi($5.str)); + if ($$ == NULL) + MYSQL_YYABORT; + } | FROM_UNIXTIME '(' expr ')' - { $$= new Item_func_from_unixtime($3); } + { + $$= new Item_func_from_unixtime($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | FROM_UNIXTIME '(' expr ',' expr ')' { - $$= new Item_func_date_format (new Item_func_from_unixtime($3),$5,0); + Item *item= new Item_func_from_unixtime($3); + if (item == NULL) + MYSQL_YYABORT; + $$= new Item_func_date_format (item, $5, 0); + if ($$ == NULL) + MYSQL_YYABORT; } | FIELD_FUNC '(' expr ',' expr_list ')' - { $5->push_front($3); $$= new Item_func_field(*$5); } + { + $5->push_front($3); + $$= new Item_func_field(*$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | geometry_function { #ifdef HAVE_SPATIAL $$= $1; + /* $1 may be NULL, GEOM_NEW not tested for out of memory */ + if ($$ == NULL) + MYSQL_YYABORT; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -4992,16 +5443,36 @@ simple_expr: #endif } | GET_FORMAT '(' date_time_type ',' expr ')' - { $$= new Item_func_get_format($3, $5); } + { + $$= new Item_func_get_format($3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | HOUR_SYM '(' expr ')' - { $$= new Item_func_hour($3); } + { + $$= new Item_func_hour($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | IF '(' expr ',' expr ',' expr ')' - { $$= new Item_func_if($3,$5,$7); } + { + $$= new Item_func_if($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | INSERT '(' expr ',' expr ',' expr ',' expr ')' - { $$= new Item_func_insert($3,$5,$7,$9); } + { + $$= new Item_func_insert($3,$5,$7,$9); + if ($$ == NULL) + MYSQL_YYABORT; + } | interval_expr interval '+' expr /* we cannot put interval before - */ - { $$= new Item_date_add_interval($4,$1,$2,0); } + { + $$= new Item_date_add_interval($4,$1,$2,0); + if ($$ == NULL) + MYSQL_YYABORT; + } | interval_expr { if ($1->type() != Item::ROW_ITEM) @@ -5010,102 +5481,248 @@ simple_expr: MYSQL_YYABORT; } $$= new Item_func_interval((Item_row *)$1); + if ($$ == NULL) + MYSQL_YYABORT; } | LAST_INSERT_ID '(' ')' { $$= new Item_func_last_insert_id(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query= 0; } | LAST_INSERT_ID '(' expr ')' { $$= new Item_func_last_insert_id($3); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query= 0; } | LEFT '(' expr ',' expr ')' - { $$= new Item_func_left($3,$5); } + { + $$= new Item_func_left($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | LOCATE '(' expr ',' expr ')' - { $$= new Item_func_locate($5,$3); } + { + $$= new Item_func_locate($5,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | LOCATE '(' expr ',' expr ',' expr ')' - { $$= new Item_func_locate($5,$3,$7); } + { + $$= new Item_func_locate($5,$3,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | GREATEST_SYM '(' expr ',' expr_list ')' - { $5->push_front($3); $$= new Item_func_max(*$5); } + { + $5->push_front($3); + $$= new Item_func_max(*$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | LEAST_SYM '(' expr ',' expr_list ')' - { $5->push_front($3); $$= new Item_func_min(*$5); } + { + $5->push_front($3); + $$= new Item_func_min(*$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | LOG_SYM '(' expr ')' - { $$= new Item_func_log($3); } + { + $$= new Item_func_log($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | LOG_SYM '(' expr ',' expr ')' - { $$= new Item_func_log($3, $5); } + { + $$= new Item_func_log($3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | MASTER_POS_WAIT '(' expr ',' expr ')' { $$= new Item_master_pos_wait($3, $5); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; - } + } | MASTER_POS_WAIT '(' expr ',' expr ',' expr ')' { $$= new Item_master_pos_wait($3, $5, $7); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | MICROSECOND_SYM '(' expr ')' - { $$= new Item_func_microsecond($3); } + { + $$= new Item_func_microsecond($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | MINUTE_SYM '(' expr ')' - { $$= new Item_func_minute($3); } + { + $$= new Item_func_minute($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | MOD_SYM '(' expr ',' expr ')' - { $$ = new Item_func_mod( $3, $5); } + { + $$= new Item_func_mod( $3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | MONTH_SYM '(' expr ')' - { $$= new Item_func_month($3); } + { + $$= new Item_func_month($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | NOW_SYM optional_braces - { $$= new Item_func_now_local(); Lex->safe_to_cache_query=0;} + { + $$= new Item_func_now_local(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | NOW_SYM '(' expr ')' - { $$= new Item_func_now_local($3); Lex->safe_to_cache_query=0;} + { + $$= new Item_func_now_local($3); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | PASSWORD '(' expr ')' { $$= YYTHD->variables.old_passwords ? (Item *) new Item_func_old_password($3) : (Item *) new Item_func_password($3); + if ($$ == NULL) + MYSQL_YYABORT; } | OLD_PASSWORD '(' expr ')' - { $$= new Item_func_old_password($3); } + { + $$= new Item_func_old_password($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | POSITION_SYM '(' bit_expr IN_SYM expr ')' - { $$ = new Item_func_locate($5,$3); } + { + $$= new Item_func_locate($5,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | QUARTER_SYM '(' expr ')' - { $$ = new Item_func_quarter($3); } + { + $$= new Item_func_quarter($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | RAND '(' expr ')' - { $$= new Item_func_rand($3); Lex->uncacheable(UNCACHEABLE_RAND);} + { + $$= new Item_func_rand($3); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->uncacheable(UNCACHEABLE_RAND); + } | RAND '(' ')' - { $$= new Item_func_rand(); Lex->uncacheable(UNCACHEABLE_RAND);} + { + $$= new Item_func_rand(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->uncacheable(UNCACHEABLE_RAND); + } | REPLACE '(' expr ',' expr ',' expr ')' - { $$= new Item_func_replace($3,$5,$7); } + { + $$= new Item_func_replace($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | RIGHT '(' expr ',' expr ')' - { $$= new Item_func_right($3,$5); } + { + $$= new Item_func_right($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | ROUND '(' expr ')' - { $$= new Item_func_round($3, new Item_int((char*)"0",0,1),0); } - | ROUND '(' expr ',' expr ')' { $$= new Item_func_round($3,$5,0); } + { + Item *item= new Item_int((char*)"0",0,1); + if (item == NULL) + MYSQL_YYABORT; + $$= new Item_func_round($3, item, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } + | ROUND '(' expr ',' expr ')' + { + $$= new Item_func_round($3,$5,0); + if ($$ == NULL) + MYSQL_YYABORT; + } | ROW_COUNT_SYM '(' ')' { $$= new Item_func_row_count(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query= 0; } | SUBDATE_SYM '(' expr ',' expr ')' - { $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 1);} + { + $$= new Item_date_add_interval($3, $5, INTERVAL_DAY, 1); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')' - { $$= new Item_date_add_interval($3, $6, $7, 1); } + { + $$= new Item_date_add_interval($3, $6, $7, 1); + if ($$ == NULL) + MYSQL_YYABORT; + } | SECOND_SYM '(' expr ')' - { $$= new Item_func_second($3); } + { + $$= new Item_func_second($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr ',' expr ',' expr ')' - { $$= new Item_func_substr($3,$5,$7); } + { + $$= new Item_func_substr($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr ',' expr ')' - { $$= new Item_func_substr($3,$5); } + { + $$= new Item_func_substr($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr FROM expr FOR_SYM expr ')' - { $$= new Item_func_substr($3,$5,$7); } + { + $$= new Item_func_substr($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr FROM expr ')' - { $$= new Item_func_substr($3,$5); } + { + $$= new Item_func_substr($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING_INDEX '(' expr ',' expr ',' expr ')' - { $$= new Item_func_substr_index($3,$5,$7); } + { + $$= new Item_func_substr_index($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | SYSDATE optional_braces { if (global_system_variables.sysdate_is_now == 0) $$= new Item_func_sysdate_local(); else $$= new Item_func_now_local(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | SYSDATE '(' expr ')' @@ -5113,36 +5730,94 @@ simple_expr: if (global_system_variables.sysdate_is_now == 0) $$= new Item_func_sysdate_local($3); else $$= new Item_func_now_local($3); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | TIME_SYM '(' expr ')' - { $$= new Item_time_typecast($3); } + { + $$= new Item_time_typecast($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIMESTAMP '(' expr ')' - { $$= new Item_datetime_typecast($3); } + { + $$= new Item_datetime_typecast($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIMESTAMP '(' expr ',' expr ')' - { $$= new Item_func_add_time($3, $5, 1, 0); } + { + $$= new Item_func_add_time($3, $5, 1, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIMESTAMP_ADD '(' interval_time_stamp ',' expr ',' expr ')' - { $$= new Item_date_add_interval($7,$5,$3,0); } + { + $$= new Item_date_add_interval($7,$5,$3,0); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIMESTAMP_DIFF '(' interval_time_stamp ',' expr ',' expr ')' - { $$= new Item_func_timestamp_diff($5,$7,$3); } + { + $$= new Item_func_timestamp_diff($5,$7,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' expr ')' - { $$= new Item_func_trim($3); } + { + $$= new Item_func_trim($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' LEADING expr FROM expr ')' - { $$= new Item_func_ltrim($6,$4); } + { + $$= new Item_func_ltrim($6,$4); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' TRAILING expr FROM expr ')' - { $$= new Item_func_rtrim($6,$4); } + { + $$= new Item_func_rtrim($6,$4); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' BOTH expr FROM expr ')' - { $$= new Item_func_trim($6,$4); } + { + $$= new Item_func_trim($6,$4); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' LEADING FROM expr ')' - { $$= new Item_func_ltrim($5); } + { + $$= new Item_func_ltrim($5); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' TRAILING FROM expr ')' - { $$= new Item_func_rtrim($5); } + { + $$= new Item_func_rtrim($5); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' BOTH FROM expr ')' - { $$= new Item_func_trim($5); } + { + $$= new Item_func_trim($5); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' expr FROM expr ')' - { $$= new Item_func_trim($5,$3); } + { + $$= new Item_func_trim($5,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRUNCATE_SYM '(' expr ',' expr ')' - { $$= new Item_func_round($3,$5,1); } + { + $$= new Item_func_round($3,$5,1); + if ($$ == NULL) + MYSQL_YYABORT; + } | ident '.' ident '(' opt_expr_list ')' { LEX *lex= Lex; @@ -5155,6 +5830,8 @@ simple_expr: $$= new Item_func_sp(Lex->current_context(), name, *$5); else $$= new Item_func_sp(Lex->current_context(), name); + if ($$ == NULL) + MYSQL_YYABORT; lex->safe_to_cache_query=0; } | IDENT_sys '(' @@ -5295,47 +5972,110 @@ simple_expr: else $$= new Item_func_sp(Lex->current_context(), name); } - lex->safe_to_cache_query=0; + lex->safe_to_cache_query=0; + + if ($$ == NULL) + MYSQL_YYABORT; } | UNIQUE_USERS '(' text_literal ',' NUM ',' NUM ',' expr_list ')' { $$= new Item_func_unique_users($3,atoi($5.str),atoi($7.str), * $9); + if ($$ == NULL) + MYSQL_YYABORT; } | UNIX_TIMESTAMP '(' ')' { $$= new Item_func_unix_timestamp(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | UNIX_TIMESTAMP '(' expr ')' - { $$= new Item_func_unix_timestamp($3); } + { + $$= new Item_func_unix_timestamp($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | USER '(' ')' - { $$= new Item_func_user(); Lex->safe_to_cache_query=0; } + { + $$= new Item_func_user(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | UTC_DATE_SYM optional_braces - { $$= new Item_func_curdate_utc(); Lex->safe_to_cache_query=0;} + { + $$= new Item_func_curdate_utc(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | UTC_TIME_SYM optional_braces - { $$= new Item_func_curtime_utc(); Lex->safe_to_cache_query=0;} + { + $$= new Item_func_curtime_utc(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | UTC_TIMESTAMP_SYM optional_braces - { $$= new Item_func_now_utc(); Lex->safe_to_cache_query=0;} + { + $$= new Item_func_now_utc(); + if ($$ == NULL) + MYSQL_YYABORT; + Lex->safe_to_cache_query=0; + } | WEEK_SYM '(' expr ')' { - $$= new Item_func_week($3,new Item_int((char*) "0", - YYTHD->variables.default_week_format,1)); + Item *item= new Item_int((char*) "0", + YYTHD->variables.default_week_format, + 1); + if (item == NULL) + MYSQL_YYABORT; + $$= new Item_func_week($3, item); + if ($$ == NULL) + MYSQL_YYABORT; } | WEEK_SYM '(' expr ',' expr ')' - { $$= new Item_func_week($3,$5); } + { + $$= new Item_func_week($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | YEAR_SYM '(' expr ')' - { $$= new Item_func_year($3); } + { + $$= new Item_func_year($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | YEARWEEK '(' expr ')' - { $$= new Item_func_yearweek($3,new Item_int((char*) "0",0,1)); } + { + Item *item= new Item_int((char*) "0",0,1); + if (item == NULL) + MYSQL_YYABORT; + $$= new Item_func_yearweek($3, item); + if ($$ == NULL) + MYSQL_YYABORT; + } | YEARWEEK '(' expr ',' expr ')' - { $$= new Item_func_yearweek($3, $5); } + { + $$= new Item_func_yearweek($3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | BENCHMARK_SYM '(' ulong_num ',' expr ')' { $$=new Item_func_benchmark($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } | EXTRACT_SYM '(' interval FROM expr ')' - { $$=new Item_extract( $3, $5); }; + { + $$=new Item_extract( $3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } + ; geometry_function: CONTAINS_SYM '(' expr ',' expr ')' @@ -5411,7 +6151,12 @@ udf_expr_list: ; udf_expr_list2: - { Select->expr_list.push_front(new List); } + { + List *list= new List; + if (list == NULL) + MYSQL_YYABORT; + Select->expr_list.push_front(list); + } udf_expr_list3 { $$= Select->expr_list.pop(); } ; @@ -5459,53 +6204,132 @@ udf_expr: ; sum_expr: - AVG_SYM '(' in_sum_expr ')' - { $$=new Item_sum_avg($3); } + AVG_SYM '(' in_sum_expr ')' + { + $$=new Item_sum_avg($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | AVG_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_avg_distinct($4); } + { + $$=new Item_sum_avg_distinct($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | BIT_AND '(' in_sum_expr ')' - { $$=new Item_sum_and($3); } + { + $$=new Item_sum_and($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | BIT_OR '(' in_sum_expr ')' - { $$=new Item_sum_or($3); } + { + $$=new Item_sum_or($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | BIT_XOR '(' in_sum_expr ')' - { $$=new Item_sum_xor($3); } + { + $$=new Item_sum_xor($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COUNT_SYM '(' opt_all '*' ')' - { $$=new Item_sum_count(new Item_int((int32) 0L,1)); } + { + Item *item= new Item_int((int32) 0L,1); + if (item == NULL) + MYSQL_YYABORT; + $$=new Item_sum_count(new Item_int((int32) 0L,1)); + if ($$ == NULL) + MYSQL_YYABORT; + } | COUNT_SYM '(' in_sum_expr ')' - { $$=new Item_sum_count($3); } + { + $$=new Item_sum_count($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COUNT_SYM '(' DISTINCT { Select->in_sum_expr++; } expr_list { Select->in_sum_expr--; } ')' - { $$=new Item_sum_count_distinct(* $5); } + { + $$=new Item_sum_count_distinct(* $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | GROUP_UNIQUE_USERS '(' text_literal ',' NUM ',' NUM ',' in_sum_expr ')' - { $$= new Item_sum_unique_users($3,atoi($5.str),atoi($7.str),$9); } + { + $$= new Item_sum_unique_users($3,atoi($5.str),atoi($7.str),$9); + if ($$ == NULL) + MYSQL_YYABORT; + } | MIN_SYM '(' in_sum_expr ')' - { $$=new Item_sum_min($3); } + { + $$=new Item_sum_min($3); + if ($$ == NULL) + MYSQL_YYABORT; + } /* According to ANSI SQL, DISTINCT is allowed and has no sence inside MIN and MAX grouping functions; so MIN|MAX(DISTINCT ...) is processed like an ordinary MIN | MAX() */ | MIN_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_min($4); } + { + $$=new Item_sum_min($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | MAX_SYM '(' in_sum_expr ')' - { $$=new Item_sum_max($3); } + { + $$=new Item_sum_max($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | MAX_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_max($4); } + { + $$=new Item_sum_max($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | STD_SYM '(' in_sum_expr ')' - { $$=new Item_sum_std($3, 0); } + { + $$=new Item_sum_std($3, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | VARIANCE_SYM '(' in_sum_expr ')' - { $$=new Item_sum_variance($3, 0); } + { + $$=new Item_sum_variance($3, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | STDDEV_SAMP_SYM '(' in_sum_expr ')' - { $$=new Item_sum_std($3, 1); } + { + $$=new Item_sum_std($3, 1); + if ($$ == NULL) + MYSQL_YYABORT; + } | VAR_SAMP_SYM '(' in_sum_expr ')' - { $$=new Item_sum_variance($3, 1); } + { + $$=new Item_sum_variance($3, 1); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUM_SYM '(' in_sum_expr ')' - { $$=new Item_sum_sum($3); } + { + $$=new Item_sum_sum($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUM_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_sum_distinct($4); } + { + $$=new Item_sum_sum_distinct($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | GROUP_CONCAT_SYM '(' opt_distinct { Select->in_sum_expr++; } expr_list opt_gorder_clause @@ -5516,6 +6340,8 @@ sum_expr: sel->in_sum_expr--; $$=new Item_func_group_concat(Lex->current_context(), $3, $5, sel->gorder_list, $7); + if ($$ == NULL) + MYSQL_YYABORT; $5->empty(); }; @@ -5538,12 +6364,16 @@ variable_aux: ident_or_text SET_VAR expr { $$= new Item_func_set_user_var($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } | ident_or_text { $$= new Item_func_get_user_var($1); + if ($$ == NULL) + MYSQL_YYABORT; LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } @@ -5564,11 +6394,14 @@ opt_distinct: |DISTINCT { $$ = 1; }; opt_gconcat_separator: - /* empty */ - { - $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); - } - | SEPARATOR_SYM text_string { $$ = $2; }; + /* empty */ + { + $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | SEPARATOR_SYM text_string { $$ = $2; } + ; opt_gorder_clause: @@ -5582,6 +6415,8 @@ opt_gorder_clause: select->gorder_list= (SQL_LIST*) sql_memdup((char*) &select->order_list, sizeof(st_sql_list)); + if (select->gorder_list == NULL) + MYSQL_YYABORT; select->order_list.empty(); }; @@ -5622,7 +6457,12 @@ opt_expr_list: ; expr_list: - { Select->expr_list.push_front(new List); } + { + List *list= new List; + if (list == NULL) + MYSQL_YYABORT; + Select->expr_list.push_front(list); + } expr_list2 { $$= Select->expr_list.pop(); }; @@ -5635,7 +6475,12 @@ ident_list_arg: | '(' ident_list ')' { $$= $2; }; ident_list: - { Select->expr_list.push_front(new List); } + { + List *list= new List; + if (list == NULL) + MYSQL_YYABORT; + Select->expr_list.push_front(new List); + } ident_list2 { $$= Select->expr_list.pop(); }; @@ -5655,6 +6500,8 @@ when_list: WHEN_SYM expr THEN_SYM expr { $$= new List; + if ($$ == NULL) + MYSQL_YYABORT; $$->push_back($2); $$->push_back($4); } @@ -6061,32 +6908,53 @@ key_list_or_empty: key_usage_list2: key_usage_list2 ',' ident - { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) $3.str, $3.length, - system_charset_info)); } + { + String *s= new (YYTHD->mem_root) String((const char*) $3.str, + $3.length, + system_charset_info); + if (s == NULL) + MYSQL_YYABORT; + Select->interval_list.push_back(s); + } | ident - { Select-> - interval_list.push_back(new (YYTHD->mem_root) String((const char*) $1.str, $1.length, - system_charset_info)); } + { + String *s= new (YYTHD->mem_root) String((const char*) $1.str, + $1.length, + system_charset_info); + if (s == NULL) + MYSQL_YYABORT; + Select->interval_list.push_back(s); + } | PRIMARY_SYM - { Select-> - interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, - system_charset_info)); }; + { + String *s= new (YYTHD->mem_root) String("PRIMARY", 7, + system_charset_info); + if (s == NULL) + MYSQL_YYABORT; + Select->interval_list.push_back(s); + } + ; using_list: ident { if (!($$= new List)) MYSQL_YYABORT; - $$->push_back(new (YYTHD->mem_root) - String((const char *) $1.str, $1.length, - system_charset_info)); + String *s= new (YYTHD->mem_root) String((const char *) $1.str, + $1.length, + system_charset_info); + if (s == NULL) + MYSQL_YYABORT; + $$->push_back(s); } | using_list ',' ident { - $1->push_back(new (YYTHD->mem_root) - String((const char *) $3.str, $3.length, - system_charset_info)); + String *s= new (YYTHD->mem_root) String((const char *) $3.str, + $3.length, + system_charset_info); + if (s == NULL) + MYSQL_YYABORT; + $1->push_back(s); $$= $1; }; @@ -6151,7 +7019,12 @@ table_alias: opt_table_alias: /* empty */ { $$=0; } | table_alias ident - { $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); }; + { + $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); + if ($$ == NULL) + MYSQL_YYABORT; + } + ; opt_all: /* empty */ @@ -6202,6 +7075,8 @@ opt_escape: $$= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? new Item_string("", 0, &my_charset_latin1) : new Item_string("\\", 1, &my_charset_latin1)); + if ($$ == NULL) + MYSQL_YYABORT; } ; @@ -6372,9 +7247,24 @@ limit_option: { ((Item_param *) $1)->limit_clause_param= TRUE; } - | ULONGLONG_NUM { $$= new Item_uint($1.str, $1.length); } - | LONG_NUM { $$= new Item_uint($1.str, $1.length); } - | NUM { $$= new Item_uint($1.str, $1.length); } + | ULONGLONG_NUM + { + $$= new Item_uint($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } + | LONG_NUM + { + $$= new Item_uint($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } + | NUM + { + $$= new Item_uint($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } ; delete_limit_clause: @@ -6427,10 +7317,11 @@ procedure_clause: lex->proc_list.elements=0; lex->proc_list.first=0; lex->proc_list.next= (byte**) &lex->proc_list.first; - if (add_proc_to_list(lex->thd, new Item_field(&lex-> - current_select-> - context, - NULL,NULL,$2.str))) + Item_field *item= new Item_field(&lex->current_select->context, + NULL,NULL,$2.str); + if (item == NULL) + MYSQL_YYABORT; + if (add_proc_to_list(lex->thd, item)) MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } @@ -6481,13 +7372,20 @@ select_var_ident: { LEX *lex=Lex; if (lex->result) - ((select_dumpvar *)lex->result)->var_list.push_back( new my_var($2,0,0,(enum_field_types)0)); + { + my_var *var= new my_var($2,0,0,(enum_field_types)0); + if (var == NULL) + MYSQL_YYABORT; + ((select_dumpvar *)lex->result)->var_list.push_back(var); + } else + { /* The parser won't create select_result instance only if it's an EXPLAIN. */ DBUG_ASSERT(lex->describe); + } } | ident_or_text { @@ -6501,12 +7399,12 @@ select_var_ident: } if (lex->result) { - my_var *var; - ((select_dumpvar *)lex->result)-> - var_list.push_back(var= new my_var($1,1,t->offset,t->type)); + my_var *var= new my_var($1,1,t->offset,t->type); + if (var == NULL) + MYSQL_YYABORT; + ((select_dumpvar *)lex->result)->var_list.push_back(var); #ifndef DBUG_OFF - if (var) - var->sp= lex->sphead; + var->sp= lex->sphead; #endif } else @@ -6591,11 +7489,13 @@ drop: | DROP INDEX_SYM ident ON table_ident {} { LEX *lex=Lex; + Alter_drop *ad= new Alter_drop(Alter_drop::KEY, $3.str); + if (ad == NULL) + MYSQL_YYABORT; lex->sql_command= SQLCOM_DROP_INDEX; lex->alter_info.reset(); lex->alter_info.flags= ALTER_DROP_INDEX; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - $3.str)); + lex->alter_info.drop_list.push_back(ad); if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; @@ -6620,6 +7520,8 @@ drop: lex->sql_command = SQLCOM_DROP_FUNCTION; lex->drop_if_exists= $3; spname= new sp_name($4, $6, true); + if (spname == NULL) + MYSQL_YYABORT; spname->init_qname(thd); lex->spname= spname; } @@ -6639,6 +7541,8 @@ drop: lex->sql_command = SQLCOM_DROP_FUNCTION; lex->drop_if_exists= $3; spname= new sp_name(db, $4, false); + if (spname == NULL) + MYSQL_YYABORT; spname->init_qname(thd); lex->spname= spname; } @@ -6853,7 +7757,12 @@ values: expr_or_default: expr { $$= $1;} - | DEFAULT {$$= new Item_default_value(Lex->current_context()); } + | DEFAULT + { + $$= new Item_default_value(Lex->current_context()); + if ($$ == NULL) + MYSQL_YYABORT; + } ; opt_insert_update: @@ -6971,15 +7880,21 @@ table_wild_list: table_wild_one: ident opt_wild opt_table_alias { - if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3, + Table_ident *ti= new Table_ident($1); + if (ti == NULL) + MYSQL_YYABORT; + if (!Select->add_table_to_list(YYTHD, ti, $3, TL_OPTION_UPDATING | TL_OPTION_ALIAS, Lex->lock_option)) MYSQL_YYABORT; } | ident '.' ident opt_wild opt_table_alias { + Table_ident *ti= new Table_ident(YYTHD, $1, $3, 0); + if (ti == NULL) + MYSQL_YYABORT; if (!Select->add_table_to_list(YYTHD, - new Table_ident(YYTHD, $1, $3, 0), + ti, $5, TL_OPTION_UPDATING | TL_OPTION_ALIAS, @@ -7357,8 +8272,12 @@ binlog_from: wild_and_where: /* empty */ | LIKE TEXT_STRING_sys - { Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length, - system_charset_info); } + { + Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length, + system_charset_info); + if (Lex->wild == NULL) + MYSQL_YYABORT; + } | WHERE expr { Select->where= $2; @@ -7406,7 +8325,14 @@ opt_describe_column: /* empty */ {} | text_string { Lex->wild= $1; } | ident - { Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); }; + { + Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str, + $1.length, + system_charset_info); + if (Lex->wild == NULL) + MYSQL_YYABORT; + } + ; /* flush things */ @@ -7690,7 +8616,11 @@ fields_or_vars: field_or_var: simple_ident_nospvar {$$= $1;} | '@' ident_or_text - { $$= new Item_user_var_as_out_param($2); } + { + $$= new Item_user_var_as_out_param($2); + if ($$ == NULL) + MYSQL_YYABORT; + } ; opt_load_data_set_spec: @@ -7715,9 +8645,14 @@ text_literal: my_charset_is_ascii_based(cs_con))) tmp= $1; else - thd->convert_string(&tmp, cs_con, $1.str, $1.length, cs_cli); + { + if (thd->convert_string(&tmp, cs_con, $1.str, $1.length, cs_cli)) + MYSQL_YYABORT; + } $$= new Item_string(tmp.str, tmp.length, cs_con, DERIVATION_COERCIBLE, repertoire); + if ($$ == NULL) + MYSQL_YYABORT; } | NCHAR_STRING { @@ -7726,10 +8661,14 @@ text_literal: DBUG_ASSERT(my_charset_is_ascii_based(national_charset_info)); $$= new Item_string($1.str, $1.length, national_charset_info, DERIVATION_COERCIBLE, repertoire); + if ($$ == NULL) + MYSQL_YYABORT; } | UNDERSCORE_CHARSET TEXT_STRING { $$= new Item_string($2.str, $2.length, Lex->underscore_charset); + if ($$ == NULL) + MYSQL_YYABORT; ((Item_string*) $$)->set_repertoire_from_value(); } | text_literal TEXT_STRING_literal @@ -7751,28 +8690,37 @@ text_literal: ; text_string: - TEXT_STRING_literal - { $$= new (YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); } + TEXT_STRING_literal + { + $$= new (YYTHD->mem_root) String($1.str, + $1.length, + YYTHD->variables.collation_connection); + if ($$ == NULL) + MYSQL_YYABORT; + } | HEX_NUM { Item *tmp= new Item_hex_string($1.str, $1.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fields, because we need only value of constant */ - $$= tmp ? - tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; + tmp->quick_fix_field(); + $$= tmp->val_str((String*) 0); } | BIN_NUM { Item *tmp= new Item_bin_string($1.str, $1.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fields, because we need only value of constant */ - $$= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; + tmp->quick_fix_field(); + $$= tmp->val_str((String*) 0); } ; @@ -7814,76 +8762,121 @@ literal: | NULL_SYM { $$ = new Item_null(); + if ($$ == NULL) + MYSQL_YYABORT; YYLIP->next_state= MY_LEX_OPERATOR_OR_IDENT; } - | FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); } - | TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); } - | HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);} - | BIN_NUM { $$= new Item_bin_string($1.str, $1.length); } + | FALSE_SYM + { + $$= new Item_int((char*) "FALSE",0,1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | TRUE_SYM + { + $$= new Item_int((char*) "TRUE",1,1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | HEX_NUM + { + $$= new Item_hex_string($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } + | BIN_NUM + { + $$= new Item_bin_string($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } | UNDERSCORE_CHARSET HEX_NUM { Item *tmp= new Item_hex_string($2.str, $2.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fieds, because we need only value of constant */ - String *str= tmp ? - tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; - $$= new Item_string(NULL, /* name will be set in select_item */ - str ? str->ptr() : "", - str ? str->length() : 0, - Lex->underscore_charset); - if (!$$ || !$$->check_well_formed_result(&$$->str_value, TRUE)) + tmp->quick_fix_field(); + String *str= tmp->val_str((String*) 0); + Item_string *item_str; + item_str= new Item_string(NULL, /* name will be set in select_item */ + str ? str->ptr() : "", + str ? str->length() : 0, + Lex->underscore_charset); + if (!item_str || + !item_str->check_well_formed_result(&item_str->str_value, TRUE)) { MYSQL_YYABORT; } - ((Item_string *) $$)->set_repertoire_from_value(); + item_str->set_repertoire_from_value(); + $$= item_str; } | UNDERSCORE_CHARSET BIN_NUM { Item *tmp= new Item_bin_string($2.str, $2.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fieds, because we need only value of constant */ - String *str= tmp ? - tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; - $$= new Item_string(NULL, /* name will be set in select_item */ - str ? str->ptr() : "", - str ? str->length() : 0, - Lex->underscore_charset); - if (!$$ || !$$->check_well_formed_result(&$$->str_value, TRUE)) + tmp->quick_fix_field(); + String *str= tmp->val_str((String*) 0); + Item_string *item_str; + item_str= new Item_string(NULL, /* name will be set in select_item */ + str ? str->ptr() : "", + str ? str->length() : 0, + Lex->underscore_charset); + if (!item_str || + !item_str->check_well_formed_result(&item_str->str_value, TRUE)) { MYSQL_YYABORT; } + $$= item_str; } | DATE_SYM text_literal { $$ = $2; } | TIME_SYM text_literal { $$ = $2; } | TIMESTAMP text_literal { $$ = $2; }; NUM_literal: - NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); } - | LONG_NUM { int error; $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); } - | ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); } + NUM + { + int error; + $$ = new Item_int($1.str, + (longlong) my_strtoll10($1.str, NULL, &error), + $1.length); + } + | LONG_NUM + { + int error; + $$ = new Item_int($1.str, + (longlong) my_strtoll10($1.str, NULL, &error), + $1.length); + } + | ULONGLONG_NUM + { + $$= new Item_uint($1.str, $1.length); + } | DECIMAL_NUM - { - $$= new Item_decimal($1.str, $1.length, YYTHD->charset()); - if (YYTHD->net.report_error) - { - MYSQL_YYABORT; - } - } + { + $$= new Item_decimal($1.str, $1.length, YYTHD->charset()); + if (($$ == NULL) || (YYTHD->net.report_error)) + { + MYSQL_YYABORT; + } + } | FLOAT_NUM - { - $$ = new Item_float($1.str, $1.length); - if (YYTHD->net.report_error) - { - MYSQL_YYABORT; - } - } - ; + { + $$= new Item_float($1.str, $1.length); + if (($$ == NULL) || (YYTHD->net.report_error)) + { + MYSQL_YYABORT; + } + } + ; /********************************************************************** ** Creating different items. @@ -7898,6 +8891,8 @@ table_wild: { SELECT_LEX *sel= Select; $$ = new Item_field(Lex->current_context(), NullS, $1.str, "*"); + if ($$ == NULL) + MYSQL_YYABORT; sel->with_wild++; } | ident '.' ident '.' '*' @@ -7906,6 +8901,8 @@ table_wild: $$ = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & CLIENT_NO_SCHEMA ? NullS : $1.str), $3.str,"*"); + if ($$ == NULL) + MYSQL_YYABORT; sel->with_wild++; } ; @@ -7935,11 +8932,12 @@ simple_ident: lip->tok_start_prev - lex->sphead->m_tmp_query, lip->tok_end - lip->tok_start_prev); + if (splocal == NULL) + MYSQL_YYABORT; #ifndef DBUG_OFF - if (splocal) - splocal->m_sp= lex->sphead; + splocal->m_sp= lex->sphead; #endif - $$ = (Item*) splocal; + $$= splocal; lex->safe_to_cache_query=0; } else @@ -7949,6 +8947,8 @@ simple_ident: sel->get_in_sum_expr() > 0) ? (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) : (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str); + if ($$ == NULL) + MYSQL_YYABORT; } } | simple_ident_q { $$= $1; } @@ -7962,6 +8962,8 @@ simple_ident_nospvar: sel->get_in_sum_expr() > 0) ? (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) : (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str); + if ($$ == NULL) + MYSQL_YYABORT; } | simple_ident_q { $$= $1; } ; @@ -8033,6 +9035,8 @@ simple_ident_q: sel->get_in_sum_expr() > 0) ? (Item*) new Item_field(Lex->current_context(), NullS, $1.str, $3.str) : (Item*) new Item_ref(Lex->current_context(), NullS, $1.str, $3.str); + if ($$ == NULL) + MYSQL_YYABORT; } } | '.' ident '.' ident @@ -8049,6 +9053,8 @@ simple_ident_q: sel->get_in_sum_expr() > 0) ? (Item*) new Item_field(Lex->current_context(), NullS, $2.str, $4.str) : (Item*) new Item_ref(Lex->current_context(), NullS, $2.str, $4.str); + if ($$ == NULL) + MYSQL_YYABORT; } | ident '.' ident '.' ident { @@ -8070,6 +9076,8 @@ simple_ident_q: (YYTHD->client_capabilities & CLIENT_NO_SCHEMA ? NullS : $1.str), $3.str, $5.str); + if ($$ == NULL) + MYSQL_YYABORT; }; @@ -8104,13 +9112,34 @@ field_ident: | '.' ident { $$=$2;} /* For Delphi */; table_ident: - ident { $$=new Table_ident($1); } - | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);} - | '.' ident { $$=new Table_ident($2);} /* For Delphi */ + ident + { + $$=new Table_ident($1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | ident '.' ident + { + $$=new Table_ident(YYTHD, $1,$3,0); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '.' ident + { + $$=new Table_ident($2); /* For Delphi */ + if ($$ == NULL) + MYSQL_YYABORT; + } ; table_ident_nodb: - ident { LEX_STRING db={(char*) any_db,3}; $$=new Table_ident(YYTHD, db,$1,0); } + ident + { + LEX_STRING db={(char*) any_db,3}; + $$=new Table_ident(YYTHD, db,$1,0); + if ($$ == NULL) + MYSQL_YYABORT; + } ; IDENT_sys: @@ -8134,8 +9163,11 @@ IDENT_sys: $$= $1; } else - thd->convert_string(&$$, system_charset_info, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, system_charset_info, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -8146,8 +9178,11 @@ TEXT_STRING_sys: if (thd->charset_is_system_charset) $$= $1; else - thd->convert_string(&$$, system_charset_info, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, system_charset_info, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -8158,8 +9193,11 @@ TEXT_STRING_literal: if (thd->charset_is_collation_connection) $$= $1; else - thd->convert_string(&$$, thd->variables.collation_connection, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, thd->variables.collation_connection, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -8171,8 +9209,11 @@ TEXT_STRING_filesystem: if (thd->charset_is_character_set_filesystem) $$= $1; else - thd->convert_string(&$$, thd->variables.character_set_filesystem, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, thd->variables.character_set_filesystem, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -8182,6 +9223,8 @@ ident: { THD *thd= YYTHD; $$.str= thd->strmake($1.str, $1.length); + if ($$.str == NULL) + MYSQL_YYABORT; $$.length= $1.length; } ; @@ -8192,6 +9235,8 @@ label_ident: { THD *thd= YYTHD; $$.str= thd->strmake($1.str, $1.length); + if ($$.str == NULL) + MYSQL_YYABORT; $$.length= $1.length; } ; @@ -8723,29 +9768,50 @@ sys_option_value: LEX *lex=Lex; if ($1) lex->option_type= $1; - lex->var_list.push_back(new set_var(lex->option_type, - find_sys_var("tx_isolation"), - &null_lex_str, - new Item_int((int32) $5))); + Item *item= new Item_int((int32) $5); + if (item == NULL) + MYSQL_YYABORT; + set_var *var= new set_var(lex->option_type, + find_sys_var("tx_isolation"), + &null_lex_str, + item); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } ; option_value: '@' ident_or_text equal expr { - Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4))); + Item_func_set_user_var *item= new Item_func_set_user_var($2,$4); + if (item == NULL) + MYSQL_YYABORT; + set_var_user *var= new set_var_user(item); + if (var == NULL) + MYSQL_YYABORT; + Lex->var_list.push_back(var); } | '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default { LEX *lex=Lex; - lex->var_list.push_back(new set_var($3, $4.var, &$4.base_name, $6)); + set_var *var= new set_var($3, $4.var, &$4.base_name, $6); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } | charset old_or_new_charset_name_or_default { THD *thd= YYTHD; LEX *lex= Lex; $2= $2 ? $2: global_system_variables.character_set_client; - lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2)); + set_var_collation_client *var; + var= new set_var_collation_client($2, + thd->variables.collation_database, + $2); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } | NAMES_SYM equal expr { @@ -8773,7 +9839,11 @@ option_value: $3->name, $2->csname); MYSQL_YYABORT; } - lex->var_list.push_back(new set_var_collation_client($3,$3,$3)); + set_var_collation_client *var; + var= new set_var_collation_client($3,$3,$3); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } | PASSWORD equal text_or_password { @@ -8794,11 +9864,17 @@ option_value: MYSQL_YYABORT; user->host=null_lex_str; user->user.str=thd->security_ctx->priv_user; - thd->lex->var_list.push_back(new set_var_password(user, $3)); + set_var_password *var= new set_var_password(user, $3); + if (var == NULL) + MYSQL_YYABORT; + thd->lex->var_list.push_back(var); } | PASSWORD FOR_SYM user equal text_or_password { - Lex->var_list.push_back(new set_var_password($3,$5)); + set_var_password *var= new set_var_password($3,$5); + if (var == NULL) + MYSQL_YYABORT; + Lex->var_list.push_back(var); } ; @@ -8912,11 +9988,15 @@ text_or_password: Item_func_old_password::alloc(YYTHD, $3.str) : Item_func_password::alloc(YYTHD, $3.str) : $3.str; + if ($$ == NULL) + MYSQL_YYABORT; } | OLD_PASSWORD '(' TEXT_STRING ')' { $$= $3.length ? Item_func_old_password::alloc(YYTHD, $3.str) : $3.str; + if ($$ == NULL) + MYSQL_YYABORT; } ; @@ -8924,9 +10004,24 @@ text_or_password: set_expr_or_default: expr { $$=$1; } | DEFAULT { $$=0; } - | ON { $$=new Item_string("ON", 2, system_charset_info); } - | ALL { $$=new Item_string("ALL", 3, system_charset_info); } - | BINARY { $$=new Item_string("binary", 6, system_charset_info); } + | ON + { + $$=new Item_string("ON", 2, system_charset_info); + if ($$ == NULL) + MYSQL_YYABORT; + } + | ALL + { + $$=new Item_string("ALL", 3, system_charset_info); + if ($$ == NULL) + MYSQL_YYABORT; + } + | BINARY + { + $$=new Item_string("binary", 6, system_charset_info); + if ($$ == NULL) + MYSQL_YYABORT; + } ; @@ -9027,7 +10122,10 @@ handler: } lex->sql_command = SQLCOM_HA_READ; lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */ - lex->current_select->select_limit= new Item_int((int32) 1); + Item *one= new Item_int((int32) 1); + if (one == NULL) + MYSQL_YYABORT; + lex->current_select->select_limit= one; lex->current_select->offset_limit= 0; if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0)) MYSQL_YYABORT; @@ -9334,8 +10432,9 @@ grant_user: { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1); - if (buff) - make_scrambled_password_323(buff, $4.str); + if (buff == NULL) + MYSQL_YYABORT; + make_scrambled_password_323(buff, $4.str); $1->password.str= buff; $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; } @@ -9343,8 +10442,9 @@ grant_user: { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1); - if (buff) - make_scrambled_password(buff, $4.str); + if (buff == NULL) + MYSQL_YYABORT; + make_scrambled_password(buff, $4.str); $1->password.str= buff; $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH; } @@ -9373,6 +10473,8 @@ column_list_id: ident { String *new_str = new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); + if (new_str == NULL) + MYSQL_YYABORT; List_iterator iter(Lex->columns); class LEX_COLUMN *point; LEX *lex=Lex; @@ -9386,7 +10488,12 @@ column_list_id: if (point) point->rights |= lex->which_columns; else - lex->columns.push_back(new LEX_COLUMN (*new_str,lex->which_columns)); + { + LEX_COLUMN *col= new LEX_COLUMN (*new_str,lex->which_columns); + if (col == NULL) + MYSQL_YYABORT; + lex->columns.push_back(col); + } } ; @@ -9800,13 +10907,17 @@ view_list_opt: view_list: ident { - Lex->view_list.push_back((LEX_STRING*) - sql_memdup(&$1, sizeof(LEX_STRING))); + LEX_STRING *ls= (LEX_STRING*) sql_memdup(&$1, sizeof(LEX_STRING)); + if (ls == NULL) + MYSQL_YYABORT; + Lex->view_list.push_back(ls); } | view_list ',' ident { - Lex->view_list.push_back((LEX_STRING*) - sql_memdup(&$3, sizeof(LEX_STRING))); + LEX_STRING *ls= (LEX_STRING*) sql_memdup(&$3, sizeof(LEX_STRING)); + if (ls == NULL) + MYSQL_YYABORT; + Lex->view_list.push_back(ls); } ; @@ -9979,6 +11090,8 @@ sf_tail: /* Order is important here: new - reset - init */ sp= new sp_head(); + if (sp == NULL) + MYSQL_YYABORT; sp->reset_thd_mem_root(thd); sp->init(lex); sp->init_sp_name(thd, lex->spname); diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index 392db9224c3..4ebcf1c50af 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -21,10 +21,35 @@ extern "C" { void sql_alloc_error_handler(void) { - THD *thd=current_thd; - if (thd) // QQ; To be removed - thd->fatal_error(); /* purecov: inspected */ sql_print_error(ER(ER_OUT_OF_RESOURCES)); + + THD *thd=current_thd; + if (thd) + { + /* + This thread is Out Of Memory. + An OOM condition is a fatal error. + It should not be caught by error handlers in stored procedures. + Also, recording that SQL condition in the condition area could + cause more memory allocations, which in turn could raise more + OOM conditions, causing recursion in the error handling code itself. + As a result, my_error() should not be invoked, and the + thread diagnostics area is set to an error status directly. + The visible result for a client application will be: + - a query fails with an ER_OUT_OF_RESOURCES error, + returned in the error packet. + - SHOW ERROR/SHOW WARNINGS may be empty. + */ + + NET *net= &thd->net; + thd->fatal_error(); + if (!net->last_error[0]) // Return only first message + { + strmake(net->last_error, ER(ER_OUT_OF_RESOURCES), + sizeof(net->last_error)-1); + net->last_errno= ER_OUT_OF_RESOURCES; + } + } } } From 07e9a6dc2a4a6839c874204e660d4981a33bad85 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 11 Aug 2008 20:02:03 +0200 Subject: [PATCH 160/352] Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that partition is corrupt The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION took another code path (over mysql_alter_table instead of mysql_admin_table) which differs in two ways: 1) alter table opens the tables in a different way than admin tables do resulting in returning with error before it tried the command 2) alter table does not start to send any diagnostic rows to the client which the lower admin functions continue to use -> resulting in assertion crash The fix: Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t. Adding check in mysql_admin_table to setup the partition list for which partitions that should be used. Partitioned tables will still not work with REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions to tables, REPAIR TABLE t USE_FRM, and check that the data still fulfills the partitioning function and then move the table back to being a partition. NOTE: I have removed the following functions from the handler interface: analyze_partitions, check_partitions, optimize_partitions, repair_partitions Since they are not longer needed. THIS ALTERS THE STORAGE ENGINE API --- mysql-test/r/handler_innodb.result | 2 + mysql-test/r/innodb.result | 4 + mysql-test/r/innodb_mysql.result | 1 + mysql-test/r/partition.result | 20 +- mysql-test/r/trigger-trans.result | 1 + .../suite/ndb/r/ndb_partition_key.result | 24 +- mysql-test/suite/ndb/t/ndb_partition_key.test | 10 +- .../suite/parts/inc/partition_alter4.inc | 15 + .../parts/r/partition_alter4_innodb.result | 54696 +++++++++++++++- .../parts/r/partition_alter4_myisam.result | 48848 +++++++++++++- .../suite/rpl/r/rpl_failed_optimize.result | 1 + .../suite/rpl/r/rpl_innodb_mixed_dml.result | 1 + mysql-test/t/partition.test | 10 +- sql/ha_partition.cc | 233 +- sql/ha_partition.h | 4 - sql/handler.cc | 60 - sql/handler.h | 12 - sql/mysql_priv.h | 2 + sql/protocol.cc | 3 + sql/sql_partition.cc | 96 +- sql/sql_table.cc | 55 +- sql/sql_yacc.yy | 8 + storage/myisam/mi_check.c | 2 +- 23 files changed, 103302 insertions(+), 806 deletions(-) diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result index 9d269f78d10..3e4cef99480 100644 --- a/mysql-test/r/handler_innodb.result +++ b/mysql-test/r/handler_innodb.result @@ -484,6 +484,7 @@ c1 handler t1 close; read the result from the other connection Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead test.t1 optimize status OK proceed with the normal connection drop table t1; @@ -698,6 +699,7 @@ handler a2 read a first; a 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 handler a1 close; ERROR 42S02: Unknown table 'a1' in HANDLER diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 03d3e019e99..5249781303a 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -166,6 +166,7 @@ level id parent_id 1 1007 101 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 show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -190,6 +191,7 @@ create table t1 (a int) engine=innodb; insert into t1 values (1), (2); 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 delete from t1 where a = 1; select * from t1; @@ -738,6 +740,7 @@ world 2 hello 1 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 show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment @@ -3109,6 +3112,7 @@ BEGIN; INSERT INTO t1 VALUES (1); 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 DROP TABLE t1; CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB; diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 61302be7e23..0b33e51ea35 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -577,6 +577,7 @@ id select_type table type possible_keys key key_len ref rows Extra INSERT INTO t2 SELECT * FROM t1; OPTIMIZE TABLE t2; Table Op Msg_type Msg_text +test.t2 optimize note Table does not support optimize, doing recreate + analyze instead test.t2 optimize status OK EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785; id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 51e851125e9..fac4735b337 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -538,7 +538,7 @@ PARTITION BY LIST (a) (PARTITION x1 VALUES IN (10), PARTITION x2 VALUES IN (20)); analyze table t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK drop table t1; create table t1 (a int) @@ -1239,7 +1239,11 @@ SHOW TABLE STATUS; 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 t1 MyISAM 10 Fixed 1 14 14 0 0 7 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned ALTER TABLE t1 OPTIMIZE PARTITION p0; -ERROR 42000: The storage engine for the table doesn't support optimize partition +Table Op Msg_type Msg_text +test.t1 optimize status OK +SHOW TABLE STATUS; +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 +t1 MyISAM 10 Fixed 1 7 7 0 1024 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned DROP TABLE t1; CREATE TABLE t1 (a int, index(a)) PARTITION BY KEY(a); ALTER TABLE t1 DISABLE KEYS; @@ -1499,13 +1503,17 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1 ALTER TABLE t1 ANALYZE PARTITION p1; -ERROR 42000: The storage engine for the table doesn't support analyze partition +Table Op Msg_type Msg_text +test.t1 analyze status OK ALTER TABLE t1 CHECK PARTITION p1; -ERROR 42000: The storage engine for the table doesn't support check partition +Table Op Msg_type Msg_text +test.t1 check status OK ALTER TABLE t1 REPAIR PARTITION p1; -ERROR 42000: The storage engine for the table doesn't support repair partition +Table Op Msg_type Msg_text +test.t1 repair status OK ALTER TABLE t1 OPTIMIZE PARTITION p1; -ERROR 42000: The storage engine for the table doesn't support optimize partition +Table Op Msg_type Msg_text +test.t1 optimize status OK DROP TABLE t1; CREATE TABLE t1 (s1 BIGINT UNSIGNED) PARTITION BY RANGE (s1) ( diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result index dccaa27c5fd..9e0f1e2c351 100644 --- a/mysql-test/r/trigger-trans.result +++ b/mysql-test/r/trigger-trans.result @@ -19,6 +19,7 @@ a b THE LION 13 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 select trigger_schema, trigger_name, event_object_schema, event_object_table, action_statement from information_schema.triggers diff --git a/mysql-test/suite/ndb/r/ndb_partition_key.result b/mysql-test/suite/ndb/r/ndb_partition_key.result index ed84b90951b..5ce2d860e7d 100644 --- a/mysql-test/suite/ndb/r/ndb_partition_key.result +++ b/mysql-test/suite/ndb/r/ndb_partition_key.result @@ -192,14 +192,30 @@ DROP TABLE t1; CREATE TABLE t1 (a int primary key) ENGINE=NDB PARTITION BY KEY(a); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze note The storage engine for the table doesn't support analyze +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check note The storage engine for the table doesn't support check +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note The storage engine for the table doesn't support optimize +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair ALTER TABLE t1 OPTIMIZE PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option +Table Op Msg_type Msg_text +test.t1 optimize note The storage engine for the table doesn't support optimize ALTER TABLE t1 CHECK PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option +Table Op Msg_type Msg_text +test.t1 check note The storage engine for the table doesn't support check ALTER TABLE t1 REPAIR PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair ALTER TABLE t1 ANALYZE PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option +Table Op Msg_type Msg_text +test.t1 analyze note The storage engine for the table doesn't support analyze ALTER TABLE t1 REBUILD PARTITION p0; ERROR HY000: Table storage engine for 't1' doesn't have this option DROP TABLE t1; diff --git a/mysql-test/suite/ndb/t/ndb_partition_key.test b/mysql-test/suite/ndb/t/ndb_partition_key.test index be76389f38d..a3898407445 100644 --- a/mysql-test/suite/ndb/t/ndb_partition_key.test +++ b/mysql-test/suite/ndb/t/ndb_partition_key.test @@ -175,15 +175,15 @@ DROP TABLE t1; CREATE TABLE t1 (a int primary key) ENGINE=NDB PARTITION BY KEY(a); ---error 1031 +ANALYZE TABLE t1; +CHECK TABLE t1; +OPTIMIZE TABLE t1; +REPAIR TABLE t1; ALTER TABLE t1 OPTIMIZE PARTITION p0; ---error 1031 ALTER TABLE t1 CHECK PARTITION p0; ---error 1031 ALTER TABLE t1 REPAIR PARTITION p0; ---error 1031 ALTER TABLE t1 ANALYZE PARTITION p0; ---error 1031 +--error ER_ILLEGAL_HA ALTER TABLE t1 REBUILD PARTITION p0; DROP TABLE t1; diff --git a/mysql-test/suite/parts/inc/partition_alter4.inc b/mysql-test/suite/parts/inc/partition_alter4.inc index 148d21e95f5..74b1f3a2e74 100644 --- a/mysql-test/suite/parts/inc/partition_alter4.inc +++ b/mysql-test/suite/parts/inc/partition_alter4.inc @@ -31,6 +31,9 @@ let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10 --echo # 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc +--echo # 1.5 ALTER ... ANALYZE PARTITION ALL; +let $alter= ALTER TABLE t1 ANALYZE PARTITION ALL; +--source suite/parts/inc/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 2 ALTER ... CHECK PARTITION @@ -47,6 +50,9 @@ let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; --echo # 2.4 ALTER ... CHECK PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc +--echo # 2.5 ALTER ... CHECK PARTITION ALL; +let $alter= ALTER TABLE t1 CHECK PARTITION ALL; +--source suite/parts/inc/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 3 ALTER ... OPTIMIZE PARTITION @@ -63,6 +69,9 @@ let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_1 --echo # 3.4 ALTER ... OPTIMIZE PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc +--echo # 3.5 ALTER ... OPTIMIZE PARTITION ALL; +let $alter= ALTER TABLE t1 OPTIMIZE PARTITION ALL; +--source suite/parts/inc/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 4 ALTER ... REBUILD PARTITION @@ -79,6 +88,9 @@ let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10 --echo # 4.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc +--echo # 4.5 ALTER ... REBUILD PARTITION ALL; +let $alter= ALTER TABLE t1 REBUILD PARTITION ALL; +--source suite/parts/inc/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 5 ALTER ... REPAIR PARTITION @@ -95,6 +107,9 @@ let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; --echo # 5.4 ALTER ... REPAIR PARTITION part_1,part_1,part_1; let $alter= ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; --source suite/parts/inc/partition_alter_41.inc +--echo # 5.5 ALTER ... REPAIR PARTITION ALL; +let $alter= ALTER TABLE t1 REPAIR PARTITION ALL; +--source suite/parts/inc/partition_alter_41.inc --echo #------------------------------------------------------------------------ --echo # 6 ALTER ... REMOVE PARTITIONING diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result index 0e6f0c22f93..8ec56dc5233 100644 --- a/mysql-test/suite/parts/r/partition_alter4_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result @@ -59,6 +59,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -487,6 +489,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -512,6 +515,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -940,6 +945,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -973,6 +979,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -1401,6 +1409,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -1432,6 +1441,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -1858,6 +1869,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -1887,6 +1899,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -2315,6 +2329,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -2348,6 +2363,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -2774,6 +2791,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -2807,6 +2825,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -3235,6 +3255,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -3264,6 +3285,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -3692,6 +3715,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -3719,6 +3743,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -4147,6 +4173,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -4172,6 +4199,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -4600,6 +4629,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -4633,6 +4663,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -5061,6 +5093,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -5092,6 +5125,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -5518,6 +5553,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -5547,6 +5583,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -5975,6 +6013,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -6008,6 +6047,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -6434,6 +6475,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -6467,6 +6509,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -6895,6 +6939,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -6924,6 +6969,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -7352,6 +7399,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -7379,329 +7427,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(MOD(f_int1,4)) -(PARTITION part_3 VALUES IN (-3), -PARTITION part_2 VALUES IN (-2), -PARTITION part_1 VALUES IN (-1), -PARTITION part_N VALUES IN (NULL), -PARTITION part0 VALUES IN (0), -PARTITION part1 VALUES IN (1), -PARTITION part2 VALUES IN (2), -PARTITION part3 VALUES IN (3)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0), -PARTITION part_1 VALUES LESS THAN (5), -PARTITION part_2 VALUES LESS THAN (10), -PARTITION part_3 VALUES LESS THAN (10 + 5), -PARTITION part_4 VALUES LESS THAN (20), -PARTITION part_5 VALUES LESS THAN (2147483646)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION part_1 VALUES LESS THAN (0), -PARTITION part_2 VALUES LESS THAN (5), -PARTITION part_3 VALUES LESS THAN (10), -PARTITION part_4 VALUES LESS THAN (2147483646)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) -(PARTITION part_1 VALUES LESS THAN (0) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part_2 VALUES LESS THAN (5) -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part_3 VALUES LESS THAN (10) -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part_4 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart41, SUBPARTITION subpart42)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part_1 VALUES IN (0) -(SUBPARTITION sp11, SUBPARTITION sp12), -PARTITION part_2 VALUES IN (1) -(SUBPARTITION sp21, SUBPARTITION sp22), -PARTITION part_3 VALUES IN (2) -(SUBPARTITION sp31, SUBPARTITION sp32), -PARTITION part_4 VALUES IN (NULL) -(SUBPARTITION sp41, SUBPARTITION sp42)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part_1 VALUES IN (0), - PARTITION part_2 VALUES IN (1), - PARTITION part_3 VALUES IN (NULL)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -# 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1; -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(MOD(f_int1,4)) -(PARTITION part_3 VALUES IN (-3), -PARTITION part_2 VALUES IN (-2), -PARTITION part_1 VALUES IN (-1), -PARTITION part_N VALUES IN (NULL), -PARTITION part0 VALUES IN (0), -PARTITION part1 VALUES IN (1), -PARTITION part2 VALUES IN (2), -PARTITION part3 VALUES IN (3)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY RANGE(f_int1) -(PARTITION parta VALUES LESS THAN (0), -PARTITION part_1 VALUES LESS THAN (5), -PARTITION part_2 VALUES LESS THAN (10), -PARTITION part_3 VALUES LESS THAN (10 + 5), -PARTITION part_4 VALUES LESS THAN (20), -PARTITION part_5 VALUES LESS THAN (2147483646)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 -(PARTITION part_1 VALUES LESS THAN (0), -PARTITION part_2 VALUES LESS THAN (5), -PARTITION part_3 VALUES LESS THAN (10), -PARTITION part_4 VALUES LESS THAN (2147483646)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) -(PARTITION part_1 VALUES LESS THAN (0) -(SUBPARTITION subpart11, SUBPARTITION subpart12), -PARTITION part_2 VALUES LESS THAN (5) -(SUBPARTITION subpart21, SUBPARTITION subpart22), -PARTITION part_3 VALUES LESS THAN (10) -(SUBPARTITION subpart31, SUBPARTITION subpart32), -PARTITION part_4 VALUES LESS THAN (2147483646) -(SUBPARTITION subpart41, SUBPARTITION subpart42)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) -(PARTITION part_1 VALUES IN (0) -(SUBPARTITION sp11, SUBPARTITION sp12), -PARTITION part_2 VALUES IN (1) -(SUBPARTITION sp21, SUBPARTITION sp22), -PARTITION part_3 VALUES IN (2) -(SUBPARTITION sp31, SUBPARTITION sp32), -PARTITION part_4 VALUES IN (NULL) -(SUBPARTITION sp41, SUBPARTITION sp42)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY LIST(ABS(MOD(f_int1,2))) -SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 -(PARTITION part_1 VALUES IN (0), - PARTITION part_2 VALUES IN (1), - PARTITION part_3 VALUES IN (NULL)); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE -DROP TABLE t1; -#------------------------------------------------------------------------ -# 2 ALTER ... CHECK PARTITION -#------------------------------------------------------------------------ -# 2.1 ALTER ... CHECK PARTITION part_1; -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -f_int1 INTEGER, -f_int2 INTEGER, -f_char1 CHAR(20), -f_char2 CHAR(20), -f_charbig VARCHAR(1000) - -) -PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template -WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -8130,6 +7857,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -8154,7 +7882,9 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -8583,6 +8313,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -8615,7 +8346,9 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -9044,6 +8777,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -9074,7 +8808,9 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -9501,6 +9237,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -9529,7 +9266,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -9958,6 +9697,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -9990,7 +9730,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -10417,6 +10159,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -10449,7 +10192,9 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -10878,6 +10623,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -10906,7 +10652,9 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 CHECK PARTITION part_1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -11335,6 +11083,11062 @@ Table Checksum test.t1 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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 1.5 ALTER ... ANALYZE PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +#------------------------------------------------------------------------ +# 2 ALTER ... CHECK PARTITION +#------------------------------------------------------------------------ +# 2.1 ALTER ... CHECK PARTITION part_1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -11362,6 +22166,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -11790,6 +22596,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -11815,6 +22622,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -12243,6 +23052,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -12276,6 +23086,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -12704,6 +23516,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -12735,6 +23548,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -13161,6 +23976,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -13190,6 +24006,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -13618,6 +24436,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -13651,6 +24470,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -14077,6 +24898,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -14110,6 +24932,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -14538,6 +25362,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -14567,6 +25392,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -14995,6 +25822,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -15022,7 +25850,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15037,7 +26306,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15060,7 +26770,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15081,7 +27232,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15100,7 +27690,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15123,7 +28154,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15146,7 +28616,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15165,7 +29076,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.4 ALTER ... CHECK PARTITION part_1,part_1,part_1; DROP TABLE IF EXISTS t1; @@ -15182,7 +29534,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15197,7 +29990,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15220,7 +30454,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15241,7 +30916,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15260,7 +31374,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15283,7 +31838,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15306,7 +32300,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15325,7 +32760,4132 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 2.5 ALTER ... CHECK PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 3 ALTER ... OPTIMIZE PARTITION @@ -15345,7 +36905,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15360,7 +37362,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15383,7 +37827,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15404,7 +38290,447 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15423,7 +38749,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15446,7 +39214,447 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15469,7 +39677,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15488,7 +40138,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 3.2 ALTER ... OPTIMIZE PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; @@ -15505,7 +40597,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15520,7 +41054,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15543,7 +41519,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15564,7 +41982,447 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15583,7 +42441,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15606,7 +42906,447 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15629,7 +43369,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15648,7 +43830,449 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; -ERROR HY000: Got error -7 from storage engine +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 3.3 ALTER ... OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; @@ -15665,7 +44289,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15680,7 +44745,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15703,7 +45209,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15724,7 +45671,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15743,7 +46129,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15766,7 +46593,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15789,7 +47055,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15808,7 +47515,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 3.4 ALTER ... OPTIMIZE PARTITION part_1,part_1,part_1; DROP TABLE IF EXISTS t1; @@ -15825,7 +47973,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15840,7 +48429,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15863,7 +48893,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15884,7 +49355,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15903,7 +49813,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15926,7 +50277,446 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15949,7 +50739,448 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15968,7 +51199,4140 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 3.5 ALTER ... OPTIMIZE PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 4 ALTER ... REBUILD PARTITION @@ -16416,6 +55780,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -16869,6 +56234,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -17330,6 +56696,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -17787,6 +57154,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -18244,6 +57612,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -18703,6 +58072,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -19164,6 +58534,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -19621,6 +58992,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -20076,6 +59448,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -20529,6 +59902,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -20990,6 +60364,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -21447,6 +60822,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -21904,6 +61280,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -22363,6 +61740,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -22824,6 +62202,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -23281,6 +62660,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -23613,10 +62993,3678 @@ WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; ERROR HY000: Error in list of partitions to REBUILD DROP TABLE t1; +# 4.5 ALTER ... REBUILD PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; #------------------------------------------------------------------------ # 5 ALTER ... REPAIR PARTITION #------------------------------------------------------------------------ -# 5.1 ALTER ... REBUILD PARTITION part_1; +# 5.1 ALTER ... REPAIR PARTITION part_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23630,7 +66678,9 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -24059,6 +67109,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -24083,7 +67134,9 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -24512,6 +67565,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -24544,7 +67598,9 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -24973,6 +68029,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -25003,7 +68060,9 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -25430,6 +68489,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -25458,7 +68518,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -25887,6 +68949,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -25919,7 +68982,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -26346,6 +69411,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -26378,7 +69444,9 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -26807,6 +69875,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -26835,7 +69904,9 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -27264,6 +70335,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -27276,7 +70348,7 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; -# 5.2 ALTER ... REBUILD PARTITION part_1,part_2; +# 5.2 ALTER ... REPAIR PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -27290,7 +70362,9 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -27719,6 +70793,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -27743,7 +70818,9 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -28172,6 +71249,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -28204,7 +71282,9 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -28633,6 +71713,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -28663,7 +71744,9 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -29090,6 +72173,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -29118,7 +72202,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -29547,6 +72633,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -29579,7 +72666,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -30006,6 +73095,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -30038,7 +73128,9 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -30467,6 +73559,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -30495,7 +73588,9 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -30924,6 +74019,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -30936,7 +74032,7 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; -# 5.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; +# 5.3 ALTER ... REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30950,8 +74046,449 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30965,8 +74502,449 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -30988,8 +74966,449 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31009,8 +75428,447 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31028,8 +75886,449 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31051,8 +76350,447 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31074,8 +76812,449 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31093,10 +77272,451 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; -# 5.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1; +# 5.4 ALTER ... REPAIR PARTITION part_1,part_1,part_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31110,8 +77730,449 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31125,8 +78186,449 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31148,8 +78650,449 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31169,8 +79112,447 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31188,8 +79570,449 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31211,8 +80034,447 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31234,8 +80496,449 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31253,8 +80956,4133 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 5.5 ALTER ... REPAIR PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = InnoDB, PARTITION part_2 ENGINE = InnoDB, PARTITION part_3 ENGINE = InnoDB, PARTITION part_4 ENGINE = InnoDB, PARTITION part_5 ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = InnoDB, PARTITION part_2 VALUES IN (-2) ENGINE = InnoDB, PARTITION part_1 VALUES IN (-1) ENGINE = InnoDB, PARTITION part_N VALUES IN (NULL) ENGINE = InnoDB, PARTITION part0 VALUES IN (0) ENGINE = InnoDB, PARTITION part1 VALUES IN (1) ENGINE = InnoDB, PARTITION part2 VALUES IN (2) ENGINE = InnoDB, PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_1 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (15) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = InnoDB, PARTITION part_2 VALUES LESS THAN (5) ENGINE = InnoDB, PARTITION part_3 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = InnoDB, SUBPARTITION subpart42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = InnoDB, SUBPARTITION sp12 ENGINE = InnoDB), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = InnoDB, SUBPARTITION sp22 ENGINE = InnoDB), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = InnoDB, SUBPARTITION sp32 ENGINE = InnoDB), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = InnoDB, SUBPARTITION sp42 ENGINE = InnoDB)) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = InnoDB, PARTITION part_2 VALUES IN (1) ENGINE = InnoDB, PARTITION part_3 VALUES IN (NULL) ENGINE = InnoDB) */ + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be able to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +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 +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair note The storage engine for the table doesn't support repair +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 6 ALTER ... REMOVE PARTITIONING @@ -31702,6 +85530,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -32155,6 +85984,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -32616,6 +86446,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -33075,6 +86906,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -33532,6 +87364,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -33993,6 +87826,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -34454,6 +88288,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; @@ -34911,6 +88746,7 @@ Table Checksum test.t1 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 # check layout success: 1 REPAIR TABLE t1 EXTENDED; diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result index 8eac8d414de..ec7a612c6f3 100644 --- a/mysql-test/suite/parts/r/partition_alter4_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result @@ -59,6 +59,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -522,6 +524,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -999,6 +1003,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -1480,6 +1486,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -1953,6 +1961,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -2436,6 +2446,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -2917,6 +2929,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -3396,6 +3410,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -3875,6 +3891,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -4338,6 +4356,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -4815,6 +4835,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -5296,6 +5318,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -5769,6 +5793,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -6252,6 +6278,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -6733,6 +6761,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -7212,6 +7242,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 analyze status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -7691,7 +7723,457 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7706,7 +8188,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7729,7 +8667,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7750,7 +9150,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7769,7 +9625,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7792,7 +10110,467 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7815,7 +10593,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7834,7 +11074,471 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 1.4 ALTER ... ANALYZE PARTITION part_1,part_1,part_1; DROP TABLE IF EXISTS t1; @@ -7851,7 +11555,457 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7866,7 +12020,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7889,7 +12499,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7910,7 +12982,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7929,7 +13457,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7952,7 +13942,467 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7975,7 +14425,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -7994,7 +14906,4303 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 ANALYZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to ANALYZE +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 1.5 ALTER ... ANALYZE PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 ANALYZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 analyze status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2 ALTER ... CHECK PARTITION @@ -8014,6 +19222,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -8477,6 +19687,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -8954,6 +20166,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -9435,6 +20649,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -9908,6 +21124,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -10391,6 +21609,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -10872,6 +22092,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -11351,6 +22573,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -11830,6 +23054,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -12293,6 +23519,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -12770,6 +23998,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -13251,6 +24481,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -13724,6 +24956,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -14207,6 +25441,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -14688,6 +25924,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -15167,6 +26405,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 check status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -15646,7 +26886,457 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15661,7 +27351,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15684,7 +27830,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15705,7 +28313,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15724,7 +28788,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15747,7 +29273,467 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15770,7 +29756,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15789,7 +30237,471 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 2.4 ALTER ... CHECK PARTITION part_1,part_1,part_1; DROP TABLE IF EXISTS t1; @@ -15806,7 +30718,457 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15821,7 +31183,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15844,7 +31662,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15865,7 +32145,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15884,7 +32620,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15907,7 +33105,467 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15930,7 +33588,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -15949,7 +34069,4303 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 CHECK PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to CHECK +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 2.5 ALTER ... CHECK PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 CHECK PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 3 ALTER ... OPTIMIZE PARTITION @@ -15969,6 +38385,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -16432,6 +38850,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -16909,6 +39329,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -17390,6 +39812,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -17863,6 +40287,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -18346,6 +40772,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -18827,6 +41255,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -19306,6 +41736,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -19785,6 +42217,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -20248,6 +42682,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -20725,6 +43161,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -21206,6 +43644,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -21679,6 +44119,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -22162,6 +44604,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -22643,6 +45087,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -23122,6 +45568,8 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -23601,7 +46049,457 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23616,7 +46514,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23639,7 +46993,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23660,7 +47476,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23679,7 +47951,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23702,7 +48436,467 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23725,7 +48919,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23744,7 +49400,471 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 3.4 ALTER ... OPTIMIZE PARTITION part_1,part_1,part_1; DROP TABLE IF EXISTS t1; @@ -23761,7 +49881,457 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23776,7 +50346,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23799,7 +50825,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23820,7 +51308,463 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23839,7 +51783,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23862,7 +52268,467 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23885,7 +52751,469 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -23904,7 +53232,4303 @@ INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to OPTIMIZE +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 3.5 ALTER ... OPTIMIZE PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 optimize status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 4 ALTER ... REBUILD PARTITION @@ -31861,10 +65485,3826 @@ WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; ERROR HY000: Error in list of partitions to REBUILD DROP TABLE t1; +# 4.5 ALTER ... REBUILD PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REBUILD PARTITION ALL; +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; #------------------------------------------------------------------------ # 5 ALTER ... REPAIR PARTITION #------------------------------------------------------------------------ -# 5.1 ALTER ... REBUILD PARTITION part_1; +# 5.1 ALTER ... REPAIR PARTITION part_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -31878,7 +69318,9 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -32341,7 +69783,9 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -32818,7 +70262,9 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -33299,7 +70745,9 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -33772,7 +71220,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -34255,7 +71705,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -34736,7 +72188,9 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -35215,7 +72669,9 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1; +ALTER TABLE t1 REPAIR PARTITION part_1; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -35680,7 +73136,7 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; -# 5.2 ALTER ... REBUILD PARTITION part_1,part_2; +# 5.2 ALTER ... REPAIR PARTITION part_1,part_2; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -35694,7 +73150,9 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -36157,7 +73615,9 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -36634,7 +74094,9 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -37115,7 +74577,9 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -37588,7 +75052,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -38071,7 +75537,9 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -38552,7 +76020,9 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -39031,7 +76501,9 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2; +ALTER TABLE t1 REPAIR PARTITION part_1,part_2; +Table Op Msg_type Msg_text +test.t1 repair status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; @@ -39496,7 +76968,7 @@ TRUNCATE t1; # check layout success: 1 # End usability test (inc/partition_check.inc) DROP TABLE t1; -# 5.3 ALTER ... REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; +# 5.3 ALTER ... REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39510,8 +76982,458 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39525,8 +77447,464 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39548,8 +77926,470 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39569,8 +78409,464 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39588,8 +78884,470 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39611,8 +79369,468 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39634,8 +79852,470 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39653,10 +80333,474 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_2,part_5,part_6,part_10; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_2,part_5,part_6,part_10; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; -# 5.4 ALTER ... REBUILD PARTITION part_1,part_1,part_1; +# 5.4 ALTER ... REPAIR PARTITION part_1,part_1,part_1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39670,8 +80814,458 @@ PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39685,8 +81279,464 @@ PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, parti INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39708,8 +81758,470 @@ PARTITION part3 VALUES IN (3)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39729,8 +82241,464 @@ PARTITION part_5 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39748,8 +82716,470 @@ PARTITION part_4 VALUES LESS THAN (2147483646)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39771,8 +83201,468 @@ PARTITION part_4 VALUES LESS THAN (2147483646) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39794,8 +83684,470 @@ PARTITION part_4 VALUES IN (NULL) INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -39813,8 +84165,4304 @@ SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; -ALTER TABLE t1 REBUILD PARTITION part_1,part_1,part_1; -ERROR HY000: Error in list of partitions to REBUILD +ALTER TABLE t1 REPAIR PARTITION part_1,part_1,part_1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +# 5.5 ALTER ... REPAIR PARTITION ALL; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY HASH(f_int1) PARTITIONS 2 (partition part_1, partition part_2); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY KEY(f_int1) PARTITIONS 5 (partition part_1, partition part_2, partition part_3, partition part_4, partition part_5); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(MOD(f_int1,4)) +(PARTITION part_3 VALUES IN (-3), +PARTITION part_2 VALUES IN (-2), +PARTITION part_1 VALUES IN (-1), +PARTITION part_N VALUES IN (NULL), +PARTITION part0 VALUES IN (0), +PARTITION part1 VALUES IN (1), +PARTITION part2 VALUES IN (2), +PARTITION part3 VALUES IN (3)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) +(PARTITION parta VALUES LESS THAN (0), +PARTITION part_1 VALUES LESS THAN (5), +PARTITION part_2 VALUES LESS THAN (10), +PARTITION part_3 VALUES LESS THAN (10 + 5), +PARTITION part_4 VALUES LESS THAN (20), +PARTITION part_5 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +(PARTITION part_1 VALUES LESS THAN (0), +PARTITION part_2 VALUES LESS THAN (5), +PARTITION part_3 VALUES LESS THAN (10), +PARTITION part_4 VALUES LESS THAN (2147483646)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +(PARTITION part_1 VALUES LESS THAN (0) +(SUBPARTITION subpart11, SUBPARTITION subpart12), +PARTITION part_2 VALUES LESS THAN (5) +(SUBPARTITION subpart21, SUBPARTITION subpart22), +PARTITION part_3 VALUES LESS THAN (10) +(SUBPARTITION subpart31, SUBPARTITION subpart32), +PARTITION part_4 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart41, SUBPARTITION subpart42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; +ERROR HY000: Table has no partition for value 2147483647 +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) +(PARTITION part_1 VALUES IN (0) +(SUBPARTITION sp11, SUBPARTITION sp12), +PARTITION part_2 VALUES IN (1) +(SUBPARTITION sp21, SUBPARTITION sp22), +PARTITION part_3 VALUES IN (2) +(SUBPARTITION sp31, SUBPARTITION sp32), +PARTITION part_4 VALUES IN (NULL) +(SUBPARTITION sp41, SUBPARTITION sp42)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) + +) +PARTITION BY LIST(ABS(MOD(f_int1,2))) +SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 +(PARTITION part_1 VALUES IN (0), + PARTITION part_2 VALUES IN (1), + PARTITION part_3 VALUES IN (NULL)); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; +ALTER TABLE t1 REPAIR PARTITION ALL; +Table Op Msg_type Msg_text +test.t1 repair status OK +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 AND @max_row; +# Start usability test (inc/partition_check.inc) +create_command +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int(11) DEFAULT NULL, + `f_int2` int(11) DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ + +unified filelist +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD +$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI +$MYSQLTEST_VARDIR/master-data/test/t1.frm +$MYSQLTEST_VARDIR/master-data/test/t1.par + +# check prerequisites-1 success: 1 +# check COUNT(*) success: 1 +# check MIN/MAX(f_int1) success: 1 +# check MIN/MAX(f_int2) success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'delete me' FROM t0_template +WHERE f_int1 IN (2,3); +# check prerequisites-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'delete me'; +# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE +# check read via f_int1 success: 1 +# check read via f_int2 success: 1 + +# check multiple-1 success: 1 +DELETE FROM t1 WHERE MOD(f_int1,3) = 0; + +# check multiple-2 success: 1 +INSERT INTO t1 SELECT * FROM t0_template +WHERE MOD(f_int1,3) = 0; + +# check multiple-3 success: 1 +UPDATE t1 SET f_int1 = f_int1 + @max_row +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 +AND @max_row_div2 + @max_row_div4; + +# check multiple-4 success: 1 +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row +AND @max_row_div2 + @max_row_div4 + @max_row; + +# check multiple-5 success: 1 +SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-1 success: 1 +SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; +INSERT INTO t1 +SET f_int1 = @cur_value , f_int2 = @cur_value, +f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), +f_charbig = '#SINGLE#'; + +# check single-2 success: 1 +SELECT MIN(f_int1) INTO @cur_value1 FROM t1; +SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value2 +WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; + +# check single-3 success: 1 +SET @cur_value1= -1; +SELECT MAX(f_int1) INTO @cur_value2 FROM t1; +UPDATE t1 SET f_int1 = @cur_value1 +WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; + +# check single-4 success: 1 +SELECT MAX(f_int1) INTO @cur_value FROM t1; +DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; + +# check single-5 success: 1 +DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; + +# check single-6 success: 1 +INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; + +# check single-7 success: 1 +DELETE FROM t1 WHERE f_charbig = '#2147483647##'; +DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; +INSERT t1 SET f_int1 = 0 , f_int2 = 0, +f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), +f_charbig = '#NULL#'; +INSERT INTO t1 +SET f_int1 = NULL , f_int2 = -@max_row, +f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), +f_charbig = '#NULL#'; +# check null success: 1 + +# check null-1 success: 1 +UPDATE t1 SET f_int1 = -@max_row +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-2 success: 1 +UPDATE t1 SET f_int1 = NULL +WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-3 success: 1 +DELETE FROM t1 +WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) +AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; + +# check null-4 success: 1 +DELETE FROM t1 +WHERE f_int1 = 0 AND f_int2 = 0 +AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) +AND f_charbig = '#NULL#'; +SET AUTOCOMMIT= 0; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-1 success: 1 +COMMIT WORK; + +# check transactions-2 success: 1 +ROLLBACK WORK; + +# check transactions-3 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +ROLLBACK WORK; + +# check transactions-4 success: 1 +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, '', '', 'was inserted' +FROM t0_template source_tab +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; + +# check transactions-5 success: 1 +ROLLBACK WORK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back + +# check transactions-6 success: 1 +# INFO: Storage engine used for t1 seems to be not transactional. +COMMIT; + +# check transactions-7 success: 1 +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +SET @@session.sql_mode = 'traditional'; +SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, +'', '', 'was inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; +ERROR 22012: Division by 0 +COMMIT; + +# check transactions-8 success: 1 +# INFO: Storage engine used for t1 seems to be unable to revert +# changes made by the failing statement. +SET @@session.sql_mode = ''; +SET AUTOCOMMIT= 1; +DELETE FROM t1 WHERE f_charbig = 'was inserted'; +COMMIT WORK; +UPDATE t1 SET f_charbig = REPEAT('b', 1000); + +# check special-1 success: 1 +UPDATE t1 SET f_charbig = ''; + +# check special-2 success: 1 +UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-1 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; + +# check trigger-2 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-3 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-4 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = new.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-5 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-6 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-7 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), +'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW +BEGIN +UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, +f_charbig = 'updated by trigger' + WHERE f_int1 = - old.f_int1; +END| +DELETE FROM t0_aux +WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); + +# check trigger-8 success: 1 +DROP TRIGGER trg_1; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = 'just inserted' + WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); +DELETE FROM t0_aux +WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +DELETE FROM t1 +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = old.f_int1 + @max_row, +new.f_int2 = old.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-9 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = new.f_int1 + @max_row, +new.f_int2 = new.f_int2 - @max_row, +new.f_charbig = '####updated per update trigger####'; +END| +UPDATE t1 +SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, +f_charbig = '####updated per update statement itself####'; + +# check trigger-10 success: 1 +DROP TRIGGER trg_2; +UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), +f_int2 = CAST(f_char1 AS SIGNED INT), +f_charbig = CONCAT('===',f_char1,'==='); +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) +SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-11 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +SET new.f_int1 = @my_max1 + @counter, +new.f_int2 = @my_min2 - @counter, +new.f_charbig = '####updated per insert trigger####'; +SET @counter = @counter + 1; +END| +SET @counter = 1; +SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; +INSERT INTO t1 (f_char1, f_char2, f_charbig) +SELECT CAST(f_int1 AS CHAR), +CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template +WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 +ORDER BY f_int1; +DROP TRIGGER trg_3; + +# check trigger-12 success: 1 +DELETE FROM t1 +WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) +AND f_int2 <> CAST(f_char1 AS SIGNED INT) +AND f_charbig = '####updated per insert trigger####'; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CHECK TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 check status OK +CHECKSUM TABLE t1 EXTENDED; +Table Checksum +test.t1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +# check layout success: 1 +REPAIR TABLE t1 EXTENDED; +Table Op Msg_type Msg_text +test.t1 repair status OK +# check layout success: 1 +TRUNCATE t1; + +# check TRUNCATE success: 1 +# check layout success: 1 +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 6 ALTER ... REMOVE PARTITIONING diff --git a/mysql-test/suite/rpl/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result index 7e397550331..5c84b1ff5fd 100644 --- a/mysql-test/suite/rpl/r/rpl_failed_optimize.result +++ b/mysql-test/suite/rpl/r/rpl_failed_optimize.result @@ -9,6 +9,7 @@ BEGIN; INSERT INTO t1 VALUES (1); 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 error Lock wait timeout exceeded; try restarting transaction test.t1 optimize status Operation failed Warnings: diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 520e75c2714..d70d8dadf54 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -570,6 +570,7 @@ test_rpl.t1 1837058639 ******************** OPTIMIZE TABLE ******************** OPTIMIZE TABLE t1; Table Op Msg_type Msg_text +test_rpl.t1 optimize note Table does not support optimize, doing recreate + analyze instead test_rpl.t1 optimize status OK ******************** REPAIR TABLE ******************** diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 669da7ee993..211a9950d67 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1333,11 +1333,9 @@ SHOW TABLE STATUS; DELETE from t1 where a = 1; --replace_column 9 0 12 NULL 13 NULL 14 NULL SHOW TABLE STATUS; -# restore this after WL#4176 is completed --- error ER_CHECK_NOT_IMPLEMENTED ALTER TABLE t1 OPTIMIZE PARTITION p0; -#--replace_column 12 NULL 13 NULL 14 NULL -#SHOW TABLE STATUS; +--replace_column 12 NULL 13 NULL 14 NULL +SHOW TABLE STATUS; DROP TABLE t1; # @@ -1672,13 +1670,9 @@ PARTITION BY RANGE (a) ( ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED; --error ER_PARSE_ERROR ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED; ---error ER_CHECK_NOT_IMPLEMENTED ALTER TABLE t1 ANALYZE PARTITION p1; ---error ER_CHECK_NOT_IMPLEMENTED ALTER TABLE t1 CHECK PARTITION p1; ---error ER_CHECK_NOT_IMPLEMENTED ALTER TABLE t1 REPAIR PARTITION p1; ---error ER_CHECK_NOT_IMPLEMENTED ALTER TABLE t1 OPTIMIZE PARTITION p1; DROP TABLE t1; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index b06e2572f44..287f360fec6 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -841,6 +841,9 @@ int ha_partition::rename_partitions(const char *path) #define CHECK_PARTS 3 #define REPAIR_PARTS 4 +static const char *opt_op_name[]= {NULL, + "optimize", "analyze", "check", "repair" }; + /* Optimize table @@ -858,8 +861,10 @@ int ha_partition::optimize(THD *thd, HA_CHECK_OPT *check_opt) { DBUG_ENTER("ha_partition::optimize"); - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - OPTIMIZE_PARTS, TRUE)); + DBUG_RETURN(handle_opt_partitions(thd, check_opt, + OPTIMIZE_PARTS, + thd->lex->alter_info.flags & + ALTER_OPTIMIZE_PARTITION ? FALSE : TRUE)); } @@ -880,8 +885,10 @@ int ha_partition::analyze(THD *thd, HA_CHECK_OPT *check_opt) { DBUG_ENTER("ha_partition::analyze"); - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - ANALYZE_PARTS, TRUE)); + DBUG_RETURN(handle_opt_partitions(thd, check_opt, + ANALYZE_PARTS, + thd->lex->alter_info.flags & + ALTER_ANALYZE_PARTITION ? FALSE : TRUE)); } @@ -902,8 +909,10 @@ int ha_partition::check(THD *thd, HA_CHECK_OPT *check_opt) { DBUG_ENTER("ha_partition::check"); - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - CHECK_PARTS, TRUE)); + DBUG_RETURN(handle_opt_partitions(thd, check_opt, + CHECK_PARTS, + thd->lex->alter_info.flags & + ALTER_CHECK_PARTITION ? FALSE : TRUE)); } @@ -924,95 +933,12 @@ int ha_partition::repair(THD *thd, HA_CHECK_OPT *check_opt) { DBUG_ENTER("ha_partition::repair"); - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - REPAIR_PARTS, TRUE)); + DBUG_RETURN(handle_opt_partitions(thd, check_opt, + REPAIR_PARTS, + thd->lex->alter_info.flags & + ALTER_REPAIR_PARTITION ? FALSE : TRUE)); } -/* - Optimize partitions - - SYNOPSIS - optimize_partitions() - thd Thread object - RETURN VALUE - >0 Failure - 0 Success - DESCRIPTION - Call optimize on each partition marked with partition state PART_CHANGED -*/ - -int ha_partition::optimize_partitions(THD *thd) -{ - DBUG_ENTER("ha_partition::optimize_partitions"); - - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - OPTIMIZE_PARTS, FALSE)); -} - -/* - Analyze partitions - - SYNOPSIS - analyze_partitions() - thd Thread object - RETURN VALUE - >0 Failure - 0 Success - DESCRIPTION - Call analyze on each partition marked with partition state PART_CHANGED -*/ - -int ha_partition::analyze_partitions(THD *thd) -{ - DBUG_ENTER("ha_partition::analyze_partitions"); - - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - ANALYZE_PARTS, FALSE)); -} - -/* - Check partitions - - SYNOPSIS - check_partitions() - thd Thread object - RETURN VALUE - >0 Failure - 0 Success - DESCRIPTION - Call check on each partition marked with partition state PART_CHANGED -*/ - -int ha_partition::check_partitions(THD *thd) -{ - DBUG_ENTER("ha_partition::check_partitions"); - - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - CHECK_PARTS, FALSE)); -} - -/* - Repair partitions - - SYNOPSIS - repair_partitions() - thd Thread object - RETURN VALUE - >0 Failure - 0 Success - DESCRIPTION - Call repair on each partition marked with partition state PART_CHANGED -*/ - -int ha_partition::repair_partitions(THD *thd) -{ - DBUG_ENTER("ha_partition::repair_partitions"); - - DBUG_RETURN(handle_opt_partitions(thd, &thd->lex->check_opt, - REPAIR_PARTS, FALSE)); -} - - /* Handle optimize/analyze/check/repair of one partition @@ -1028,7 +954,6 @@ int ha_partition::repair_partitions(THD *thd) 0 Success */ -#ifdef WL4176_IS_DONE static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, handler *file, uint flag) { @@ -1036,12 +961,6 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, DBUG_ENTER("handle_opt_part"); DBUG_PRINT("enter", ("flag = %u", flag)); - /* - TODO: - Rewrite the code for ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION WL4176 - */ - DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED); - if (flag == OPTIMIZE_PARTS) error= file->ha_optimize(thd, check_opt); else if (flag == ANALYZE_PARTS) @@ -1059,7 +978,59 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, error= 0; DBUG_RETURN(error); } -#endif + + +/* + print a message row formatted for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE + (modelled after mi_check_print_msg) + TODO: move this into the handler, or rewrite mysql_admin_table. +*/ +static bool print_admin_msg(THD* thd, const char* msg_type, + const char* db_name, const char* table_name, + const char* op_name, const char *fmt, ...) +{ + va_list args; + Protocol *protocol= thd->protocol; + uint length, msg_length; + char msgbuf[MI_MAX_MSG_BUF]; + char name[NAME_LEN*2+2]; + + va_start(args, fmt); + msg_length= my_vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); + va_end(args); + msgbuf[sizeof(msgbuf) - 1] = 0; // healthy paranoia + + + if (!thd->vio_ok()) + { + sql_print_error(msgbuf); + return TRUE; + } + + length=(uint) (strxmov(name, db_name, ".", table_name,NullS) - name); + /* + TODO: switch from protocol to push_warning here. The main reason we didn't + it yet is parallel repair. Due to following trace: + mi_check_print_msg/push_warning/sql_alloc/my_pthread_getspecific_ptr. + + Also we likely need to lock mutex here (in both cases with protocol and + push_warning). + */ + DBUG_PRINT("info",("print_admin_msg: %s, %s, %s, %s", name, op_name, + msg_type, msgbuf)); + protocol->prepare_for_resend(); + protocol->store(name, length, system_charset_info); + protocol->store(op_name, system_charset_info); + protocol->store(msg_type, system_charset_info); + protocol->store(msgbuf, msg_length, system_charset_info); + if (protocol->write()) + { + sql_print_error("Failed on my_net_write, writing to stderr instead: %s\n", + msgbuf); + return TRUE; + } + return FALSE; +} /* @@ -1080,55 +1051,89 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt, int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, uint flag, bool all_parts) { -#ifdef WL4176_IS_DONE List_iterator part_it(m_part_info->partitions); uint no_parts= m_part_info->no_parts; uint no_subparts= m_part_info->no_subparts; uint i= 0; int error; -#endif DBUG_ENTER("ha_partition::handle_opt_partitions"); DBUG_PRINT("enter", ("all_parts %u, flag= %u", all_parts, flag)); - /* - TODO: - Rewrite the code for ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION WL4176 - */ - DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED); -#ifdef WL4176_IS_DONE do { partition_element *part_elem= part_it++; - if (all_parts || part_elem->part_state == PART_CHANGED) + /* + when ALTER TABLE PARTITION ... + it should only do named partitions, otherwise all partitions + */ + if (all_parts || + part_elem->part_state == PART_CHANGED) { if (m_is_sub_partitioned) { + List_iterator subpart_it(part_elem->subpartitions); + partition_element *sub_elem; uint j= 0, part; do { + sub_elem= subpart_it++; part= i * no_subparts + j; - DBUG_PRINT("info", ("Optimize subpartition %u", - part)); + DBUG_PRINT("info", ("Optimize subpartition %u (%s)", + part, sub_elem->partition_name)); +#ifdef NOT_USED + if (print_admin_msg(thd, "note", table_share->db.str, table->alias, + opt_op_name[flag], + "Start to operate on subpartition %s", + sub_elem->partition_name)) + DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR); +#endif if ((error= handle_opt_part(thd, check_opt, m_file[part], flag))) { + /* print a line which partition the error belongs to */ + if (error != HA_ADMIN_NOT_IMPLEMENTED && + error != HA_ADMIN_ALREADY_DONE && + error != HA_ADMIN_TRY_ALTER) + { + print_admin_msg(thd, "error", table_share->db.str, table->alias, + opt_op_name[flag], + "Subpartition %s returned error", + sub_elem->partition_name); + } DBUG_RETURN(error); } } while (++j < no_subparts); } else { - DBUG_PRINT("info", ("Optimize partition %u", i)); + DBUG_PRINT("info", ("Optimize partition %u (%s)", i, + part_elem->partition_name)); +#ifdef NOT_USED + if (print_admin_msg(thd, "note", table_share->db.str, table->alias, + opt_op_name[flag], + "Start to operate on partition %s", + part_elem->partition_name)) + DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR); +#endif if ((error= handle_opt_part(thd, check_opt, m_file[i], flag))) { + /* print a line which partition the error belongs to */ + if (error != HA_ADMIN_NOT_IMPLEMENTED && + error != HA_ADMIN_ALREADY_DONE && + error != HA_ADMIN_TRY_ALTER) + { + print_admin_msg(thd, "error", table_share->db.str, table->alias, + opt_op_name[flag], "Partition %s returned error", + part_elem->partition_name); + } DBUG_RETURN(error); } } } } while (++i < no_parts); DBUG_RETURN(FALSE); -#endif } + /* Prepare by creating a new partition diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 2ec700978bc..e86dc5fea1a 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -932,10 +932,6 @@ public: virtual int analyze(THD* thd, HA_CHECK_OPT *check_opt); virtual int check(THD* thd, HA_CHECK_OPT *check_opt); virtual int repair(THD* thd, HA_CHECK_OPT *check_opt); - virtual int optimize_partitions(THD *thd); - virtual int analyze_partitions(THD *thd); - virtual int check_partitions(THD *thd); - virtual int repair_partitions(THD *thd); private: int handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt, diff --git a/sql/handler.cc b/sql/handler.cc index fe4944ed836..e550295ebba 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3284,66 +3284,6 @@ handler::ha_rename_partitions(const char *path) } -/** - Optimize partitions: public interface. - - @sa handler::optimize_partitions() -*/ - -int -handler::ha_optimize_partitions(THD *thd) -{ - mark_trx_read_write(); - - return optimize_partitions(thd); -} - - -/** - Analyze partitions: public interface. - - @sa handler::analyze_partitions() -*/ - -int -handler::ha_analyze_partitions(THD *thd) -{ - mark_trx_read_write(); - - return analyze_partitions(thd); -} - - -/** - Check partitions: public interface. - - @sa handler::check_partitions() -*/ - -int -handler::ha_check_partitions(THD *thd) -{ - mark_trx_read_write(); - - return check_partitions(thd); -} - - -/** - Repair partitions: public interface. - - @sa handler::repair_partitions() -*/ - -int -handler::ha_repair_partitions(THD *thd) -{ - mark_trx_read_write(); - - return repair_partitions(thd); -} - - /** Tell the storage engine that it is allowed to "disable transaction" in the handler. It is a hint that ACID is not required - it is used in NDB for diff --git a/sql/handler.h b/sql/handler.h index d674c07a57d..df6157f80b4 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1247,10 +1247,6 @@ public: size_t pack_frm_len); int ha_drop_partitions(const char *path); int ha_rename_partitions(const char *path); - int ha_optimize_partitions(THD *thd); - int ha_analyze_partitions(THD *thd); - int ha_check_partitions(THD *thd); - int ha_repair_partitions(THD *thd); void adjust_next_insert_id_after_explicit_value(ulonglong nr); int update_auto_increment(); @@ -1911,14 +1907,6 @@ private: { return HA_ERR_WRONG_COMMAND; } virtual int rename_partitions(const char *path) { return HA_ERR_WRONG_COMMAND; } - virtual int optimize_partitions(THD *thd) - { return HA_ERR_WRONG_COMMAND; } - virtual int analyze_partitions(THD *thd) - { return HA_ERR_WRONG_COMMAND; } - virtual int check_partitions(THD *thd) - { return HA_ERR_WRONG_COMMAND; } - virtual int repair_partitions(THD *thd) - { return HA_ERR_WRONG_COMMAND; } }; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f6ba5fc9739..e9deb479c5e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1571,6 +1571,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, char *db, const char *table_name, uint fast_alter_partition); +uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info, + enum partition_state part_state); uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, HA_CREATE_INFO *create_info, handlerton *old_db_type, diff --git a/sql/protocol.cc b/sql/protocol.cc index 5fe56724d08..4177cd0054d 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -788,6 +788,9 @@ bool Protocol_text::store(const char *from, size_t length, { CHARSET_INFO *tocs= this->thd->variables.character_set_results; #ifndef DBUG_OFF + DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %s", field_pos, + field_count, from)); + DBUG_ASSERT(field_pos < field_count); DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_DECIMAL || field_types[field_pos] == MYSQL_TYPE_BIT || diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 121ee3c22b4..6419d336b9f 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4079,6 +4079,38 @@ error: } +/* + Sets which partitions to be used in the command +*/ +uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info, + enum partition_state part_state) +{ + uint part_count= 0; + uint no_parts_found= 0; + List_iterator part_it(tab_part_info->partitions); + + do + { + partition_element *part_elem= part_it++; + if ((alter_info->flags & ALTER_ALL_PARTITION) || + (is_name_in_list(part_elem->partition_name, + alter_info->partition_names))) + { + /* + Mark the partition. + I.e mark the partition as a partition to be "changed" by + analyzing/optimizing/rebuilding/checking/repairing + */ + no_parts_found++; + part_elem->part_state= part_state; + DBUG_PRINT("info", ("Setting part_state to %u for partition %s", + part_state, part_elem->partition_name)); + } + } while (++part_count < tab_part_info->no_parts); + return no_parts_found; +} + + /* Prepare for ALTER TABLE of partition structure @@ -4534,26 +4566,9 @@ that are reorganised. (alter_info->flags & ALTER_REPAIR_PARTITION) || (alter_info->flags & ALTER_REBUILD_PARTITION)) { + uint no_parts_found; uint no_parts_opt= alter_info->partition_names.elements; - uint part_count= 0; - uint no_parts_found= 0; - List_iterator part_it(tab_part_info->partitions); - - do - { - partition_element *part_elem= part_it++; - if ((alter_info->flags & ALTER_ALL_PARTITION) || - (is_name_in_list(part_elem->partition_name, - alter_info->partition_names))) - { - /* - Mark the partition as a partition to be "changed" by - analyzing/optimizing/rebuilding/checking/repairing - */ - no_parts_found++; - part_elem->part_state= PART_CHANGED; - } - } while (++part_count < tab_part_info->no_parts); + no_parts_found= set_part_state(alter_info, tab_part_info, PART_CHANGED); if (no_parts_found != no_parts_opt && (!(alter_info->flags & ALTER_ALL_PARTITION))) { @@ -6026,48 +6041,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, lpt->pack_frm_len= 0; thd->work_part_info= part_info; - if (alter_info->flags & ALTER_OPTIMIZE_PARTITION || - alter_info->flags & ALTER_ANALYZE_PARTITION || - alter_info->flags & ALTER_CHECK_PARTITION || - alter_info->flags & ALTER_REPAIR_PARTITION) - { - /* - In this case the user has specified that he wants a set of partitions - to be optimised and the partition engine can handle optimising - partitions natively without requiring a full rebuild of the - partitions. - - In this case it is enough to call optimise_partitions, there is no - need to change frm files or anything else. - */ - int error; - written_bin_log= FALSE; - if (((alter_info->flags & ALTER_OPTIMIZE_PARTITION) && - (error= table->file->ha_optimize_partitions(thd))) || - ((alter_info->flags & ALTER_ANALYZE_PARTITION) && - (error= table->file->ha_analyze_partitions(thd))) || - ((alter_info->flags & ALTER_CHECK_PARTITION) && - (error= table->file->ha_check_partitions(thd))) || - ((alter_info->flags & ALTER_REPAIR_PARTITION) && - (error= table->file->ha_repair_partitions(thd)))) - { - if (error == HA_ADMIN_NOT_IMPLEMENTED) { - if (alter_info->flags & ALTER_OPTIMIZE_PARTITION) - my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "optimize partition"); - else if (alter_info->flags & ALTER_ANALYZE_PARTITION) - my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "analyze partition"); - else if (alter_info->flags & ALTER_CHECK_PARTITION) - my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "check partition"); - else if (alter_info->flags & ALTER_REPAIR_PARTITION) - my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "repair partition"); - else - table->file->print_error(error, MYF(0)); - } else - table->file->print_error(error, MYF(0)); - goto err; - } - } - else if (fast_alter_partition & HA_PARTITION_ONE_PHASE) + if (fast_alter_partition & HA_PARTITION_ONE_PHASE) { /* In the case where the engine supports one phase online partition diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2b3b5ef67d9..226facffe7c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4194,6 +4194,46 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, table->next_global= save_next_global; table->next_local= save_next_local; thd->open_options&= ~extra_open_options; +#ifdef WITH_PARTITION_STORAGE_ENGINE + if (table->table && table->table->part_info) + { + /* + Set up which partitions that should be processed + if ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION .. + */ + Alter_info *alter_info= &lex->alter_info; + + if (alter_info->flags & ALTER_ANALYZE_PARTITION || + alter_info->flags & ALTER_CHECK_PARTITION || + alter_info->flags & ALTER_OPTIMIZE_PARTITION || + alter_info->flags & ALTER_REPAIR_PARTITION) + { + uint no_parts_found; + uint no_parts_opt= alter_info->partition_names.elements; + no_parts_found= set_part_state(alter_info, table->table->part_info, + PART_CHANGED); + if (no_parts_found != no_parts_opt && + (!(alter_info->flags & ALTER_ALL_PARTITION))) + { + char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE]; + uint length; + DBUG_PRINT("admin", ("sending non existent partition error")); + protocol->prepare_for_resend(); + protocol->store(table_name, system_charset_info); + protocol->store(operator_name, system_charset_info); + protocol->store(STRING_WITH_LEN("error"), system_charset_info); + length= my_snprintf(buff, sizeof(buff), + ER(ER_DROP_PARTITION_NON_EXISTENT), + table_name); + protocol->store(buff, length, system_charset_info); + if(protocol->write()) + goto err; + my_eof(thd); + goto err; + } + } + } +#endif } DBUG_PRINT("admin", ("table: 0x%lx", (long) table->table)); @@ -4428,9 +4468,17 @@ send_result_message: This is currently used only by InnoDB. ha_innobase::optimize() answers "try with alter", so here we close the table, do an ALTER TABLE, reopen the table and do ha_innobase::analyze() on it. + We have to end the row, so analyze could return more rows. */ + protocol->store(STRING_WITH_LEN("note"), system_charset_info); + protocol->store(STRING_WITH_LEN( + "Table does not support optimize, doing recreate + analyze instead"), + system_charset_info); + if (protocol->write()) + goto err; ha_autocommit_or_rollback(thd, 0); close_thread_tables(thd); + DBUG_PRINT("info", ("HA_ADMIN_TRY_ALTER, trying analyze...")); TABLE_LIST *save_next_local= table->next_local, *save_next_global= table->next_global; table->next_local= table->next_global= 0; @@ -4453,6 +4501,10 @@ send_result_message: ((result_code= table->table->file->ha_analyze(thd, check_opt)) > 0)) result_code= 0; // analyze went ok } + /* Start a new row for the final status row */ + protocol->prepare_for_resend(); + protocol->store(table_name, system_charset_info); + protocol->store(operator_name, system_charset_info); if (result_code) // either mysql_recreate_table or analyze failed { DBUG_ASSERT(thd->is_error()); @@ -4468,7 +4520,8 @@ send_result_message: /* Hijack the row already in-progress. */ protocol->store(STRING_WITH_LEN("error"), system_charset_info); protocol->store(err_msg, system_charset_info); - (void)protocol->write(); + if (protocol->write()) + goto err; /* Start off another row for HA_ADMIN_FAILED */ protocol->prepare_for_resend(); protocol->store(table_name, system_charset_info); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ccd64c24960..c3f691ef808 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5543,6 +5543,7 @@ alter_commands: all_or_alt_part_name_list { LEX *lex= Lex; + lex->sql_command = SQLCOM_OPTIMIZE; lex->alter_info.flags|= ALTER_OPTIMIZE_PARTITION; lex->no_write_to_binlog= $3; lex->check_opt.init(); @@ -5552,6 +5553,7 @@ alter_commands: all_or_alt_part_name_list { LEX *lex= Lex; + lex->sql_command = SQLCOM_ANALYZE; lex->alter_info.flags|= ALTER_ANALYZE_PARTITION; lex->no_write_to_binlog= $3; lex->check_opt.init(); @@ -5559,6 +5561,7 @@ alter_commands: | CHECK_SYM PARTITION_SYM all_or_alt_part_name_list { LEX *lex= Lex; + lex->sql_command = SQLCOM_CHECK; lex->alter_info.flags|= ALTER_CHECK_PARTITION; lex->check_opt.init(); } @@ -5567,6 +5570,7 @@ alter_commands: all_or_alt_part_name_list { LEX *lex= Lex; + lex->sql_command = SQLCOM_REPAIR; lex->alter_info.flags|= ALTER_REPAIR_PARTITION; lex->no_write_to_binlog= $3; lex->check_opt.init(); @@ -6009,6 +6013,7 @@ repair: lex->sql_command = SQLCOM_REPAIR; lex->no_write_to_binlog= $2; lex->check_opt.init(); + lex->alter_info.reset(); } table_list opt_mi_repair_type {} @@ -6037,6 +6042,7 @@ analyze: lex->sql_command = SQLCOM_ANALYZE; lex->no_write_to_binlog= $2; lex->check_opt.init(); + lex->alter_info.reset(); } table_list {} @@ -6062,6 +6068,7 @@ check: } lex->sql_command = SQLCOM_CHECK; lex->check_opt.init(); + lex->alter_info.reset(); } table_list opt_mi_check_type {} @@ -6093,6 +6100,7 @@ optimize: lex->sql_command = SQLCOM_OPTIMIZE; lex->no_write_to_binlog= $2; lex->check_opt.init(); + lex->alter_info.reset(); } table_list {} diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 67216a4cf58..879c171520e 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1338,7 +1338,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) if (splits != info->s->state.split) { mi_check_print_warning(param, - "Found %10s parts Should be: %s parts", + "Found %10s key parts. Should be: %s", llstr(splits,llbuff), llstr(info->s->state.split,llbuff2)); } From fd324dd3ff92594e8aa7fc04b0481639788c41c2 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 11 Aug 2008 15:08:12 -0600 Subject: [PATCH 161/352] Bug#37302 (missing DBUG_RETURN macro in function "find_key_block" (5.0 only)) Fixed missing DBUG_RETURN in the function find_key_block --- mysys/mf_keycache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index f27ade7bfc0..0720d172317 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1382,7 +1382,7 @@ restart: /* We don't need the page in the cache: we are going to write on disk */ hash_link->requests--; unlink_hash(keycache, hash_link); - return 0; + DBUG_RETURN(0); } if (!(block->status & BLOCK_IN_FLUSH)) { @@ -1399,7 +1399,7 @@ restart: flag (see the code below that handles reading requests). */ free_block(keycache, block); - return 0; + DBUG_RETURN(0); } /* Wait intil the page is flushed on disk */ hash_link->requests--; @@ -1429,7 +1429,7 @@ restart: /* Invalidate page in the block if it has not been done yet */ if (block->status) free_block(keycache, block); - return 0; + DBUG_RETURN(0); } if (page_status == PAGE_READ && From d5620961a6acf7d334726dd0a9739b91c2f8a375 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 11 Aug 2008 20:27:09 -0300 Subject: [PATCH 162/352] Bug#38486: Crash when using cursor protocol Post-merge fix: mysql_client_test.c is compiled by C compilers and some C compilers don't support mixed declarations and code and it's explicitly forbidden by ISO C90. --- tests/mysql_client_test.c | 41 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 4336bfa0c59..ac5473a1ccd 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16196,25 +16196,28 @@ static void test_bug32265() static void test_bug38486(void) { - myheader("test_bug38486"); - - MYSQL_STMT *stmt; - stmt= mysql_stmt_init(mysql); - unsigned long type= CURSOR_TYPE_READ_ONLY; - mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); - const char *sql= "CREATE TABLE t1 (a INT)"; - mysql_stmt_prepare(stmt,sql,strlen(sql)); - - mysql_stmt_execute(stmt); - mysql_stmt_close(stmt); - - stmt= mysql_stmt_init(mysql); - mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); - const char *sql2= "INSERT INTO t1 VALUES (1)"; - mysql_stmt_prepare(stmt,sql2,strlen(sql2)); - mysql_stmt_execute(stmt); - - mysql_stmt_close(stmt); + MYSQL_STMT *stmt; + const char *stmt_text; + unsigned long type= CURSOR_TYPE_READ_ONLY; + + DBUG_ENTER("test_bug38486"); + myheader("test_bug38486"); + + stmt= mysql_stmt_init(mysql); + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + stmt_text= "CREATE TABLE t1 (a INT)"; + mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + mysql_stmt_execute(stmt); + mysql_stmt_close(stmt); + + stmt= mysql_stmt_init(mysql); + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + stmt_text= "INSERT INTO t1 VALUES (1)"; + mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + mysql_stmt_execute(stmt); + mysql_stmt_close(stmt); + + DBUG_VOID_RETURN; } From 4cb12690c75eaa17e85236fcdc28b9e5faf0629f Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 12 Aug 2008 10:02:30 +0200 Subject: [PATCH 163/352] Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that partition is corrupt Updated result files after merge --- .../r/partition_alter1_1_2_innodb.result | 392 +- .../r/partition_alter1_1_2_myisam.result | 128 +- .../parts/r/partition_alter1_1_innodb.result | 224 +- .../parts/r/partition_alter1_1_myisam.result | 128 +- .../parts/r/partition_alter1_2_innodb.result | 560 +- .../parts/r/partition_alter1_2_myisam.result | 256 +- .../parts/r/partition_alter2_innodb.result | 1680 ++--- .../parts/r/partition_alter2_myisam.result | 1152 ++-- .../parts/r/partition_alter4_myisam.result | 5752 ++++++++--------- .../parts/r/partition_basic_innodb.result | 448 +- .../parts/r/partition_basic_myisam.result | 256 +- .../r/partition_basic_symlink_myisam.result | 312 +- .../parts/r/partition_engine_innodb.result | 77 +- .../parts/r/partition_engine_myisam.result | 88 +- mysql-test/suite/parts/t/disabled.def | 2 - 15 files changed, 5968 insertions(+), 5487 deletions(-) diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result index 210d249c2f5..7d817bd419d 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result @@ -515,16 +515,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1004,16 +1005,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1501,16 +1503,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1994,16 +1997,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2485,16 +2489,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2980,16 +2985,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3477,16 +3483,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3970,16 +3977,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4460,16 +4468,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4949,16 +4958,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5446,16 +5456,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5939,16 +5950,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6430,16 +6442,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6925,16 +6938,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7422,16 +7436,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7915,16 +7930,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8422,16 +8438,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8927,16 +8944,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9440,16 +9458,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9949,16 +9968,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10456,16 +10476,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10967,16 +10988,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11480,16 +11502,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11989,16 +12012,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12495,16 +12519,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13000,16 +13025,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13513,16 +13539,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14022,16 +14049,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14529,16 +14557,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15040,16 +15069,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15553,16 +15583,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16062,16 +16093,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16554,16 +16586,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17044,16 +17077,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17542,16 +17576,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18036,16 +18071,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18528,16 +18564,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19024,16 +19061,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19522,16 +19560,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20016,16 +20055,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20507,16 +20547,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20997,16 +21038,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21495,16 +21537,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21989,16 +22032,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22481,16 +22525,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22977,16 +23022,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23475,16 +23521,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23969,16 +24016,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24460,16 +24508,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24950,16 +24999,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25448,16 +25498,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25942,16 +25993,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26434,16 +26486,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26930,16 +26983,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27428,16 +27482,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27922,16 +27977,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result index d93377694a6..07ad5b0e1e9 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result @@ -541,20 +541,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1062,20 +1062,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1597,20 +1597,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2124,20 +2124,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2653,20 +2653,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3186,20 +3186,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3721,20 +3721,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4254,20 +4254,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4770,20 +4770,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5291,20 +5291,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5826,20 +5826,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6353,20 +6353,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6882,20 +6882,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7415,20 +7415,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7950,20 +7950,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8483,20 +8483,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result index 68acfcc3a60..69cd4a26c89 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result @@ -833,16 +833,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1322,16 +1323,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1819,16 +1821,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2312,16 +2315,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2805,16 +2809,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3300,16 +3305,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3797,16 +3803,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4290,16 +4297,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4780,16 +4788,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5269,16 +5278,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5766,16 +5776,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6259,16 +6270,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6752,16 +6764,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7247,16 +7260,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7744,16 +7758,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8237,16 +8252,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8744,16 +8760,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9249,16 +9266,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9762,16 +9780,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10271,16 +10290,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10780,16 +10800,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11291,16 +11312,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11804,16 +11826,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12313,16 +12336,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12819,16 +12843,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13324,16 +13349,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13837,16 +13863,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14346,16 +14373,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14855,16 +14883,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15366,16 +15395,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15879,16 +15909,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16388,16 +16419,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result index 3b6832d06ae..3565e02e5ae 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result @@ -700,20 +700,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1221,20 +1221,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1756,20 +1756,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2283,20 +2283,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2814,20 +2814,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3347,20 +3347,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3882,20 +3882,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4415,20 +4415,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4931,20 +4931,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5452,20 +5452,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5987,20 +5987,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6514,20 +6514,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7045,20 +7045,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7578,20 +7578,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8113,20 +8113,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8646,20 +8646,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result index 685b9909553..1d2346b95e3 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result @@ -462,16 +462,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -899,16 +900,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1344,16 +1346,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1785,16 +1788,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2226,16 +2230,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2669,16 +2674,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3114,16 +3120,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3555,16 +3562,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3993,16 +4001,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4430,16 +4439,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4875,16 +4885,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5316,16 +5327,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5757,16 +5769,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6200,16 +6213,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6645,16 +6659,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7086,16 +7101,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7540,16 +7556,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7993,16 +8010,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8454,16 +8472,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8911,16 +8930,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9368,16 +9388,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9827,16 +9848,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10288,16 +10310,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10745,16 +10768,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11187,16 +11211,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11624,16 +11649,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12069,16 +12095,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12510,16 +12537,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12949,16 +12977,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13392,16 +13421,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13837,16 +13867,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14278,16 +14309,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14716,16 +14748,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15153,16 +15186,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15598,16 +15632,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16039,16 +16074,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16478,16 +16514,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16921,16 +16958,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17366,16 +17404,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17807,16 +17846,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18262,16 +18302,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18715,16 +18756,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19176,16 +19218,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19633,16 +19676,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20088,16 +20132,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20547,16 +20592,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21008,16 +21054,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21465,16 +21512,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21919,16 +21967,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22372,16 +22421,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22833,16 +22883,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23290,16 +23341,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23745,16 +23797,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24204,16 +24257,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24665,16 +24719,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25122,16 +25177,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25561,16 +25617,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25998,16 +26055,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26443,16 +26501,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26884,16 +26943,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27323,16 +27383,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27766,16 +27827,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -28211,16 +28273,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -28652,16 +28715,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -29090,16 +29154,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -29527,16 +29592,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -29972,16 +30038,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -30413,16 +30480,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -30852,16 +30920,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -31295,16 +31364,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -31740,16 +31810,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -32181,16 +32252,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -32635,16 +32707,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -33088,16 +33161,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -33549,16 +33623,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -34006,16 +34081,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -34461,16 +34537,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -34920,16 +34997,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -35381,16 +35459,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -35838,16 +35917,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result index ce80c58aa3a..811ddf5384e 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result @@ -487,20 +487,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -956,20 +956,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1439,20 +1439,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1914,20 +1914,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2393,20 +2393,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2874,20 +2874,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3357,20 +3357,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3838,20 +3838,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4306,20 +4306,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4775,20 +4775,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5258,20 +5258,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5733,20 +5733,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6210,20 +6210,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6691,20 +6691,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7174,20 +7174,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7655,20 +7655,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8119,20 +8119,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8588,20 +8588,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9071,20 +9071,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9546,20 +9546,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10023,20 +10023,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10504,20 +10504,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10987,20 +10987,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11468,20 +11468,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11932,20 +11932,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12401,20 +12401,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12884,20 +12884,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13359,20 +13359,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13836,20 +13836,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -14317,20 +14317,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -14800,20 +14800,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -15281,20 +15281,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/r/partition_alter2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_innodb.result index 7000cb7e7ae..a39ff23ad65 100644 --- a/mysql-test/suite/parts/r/partition_alter2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_innodb.result @@ -479,16 +479,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -932,16 +933,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1393,16 +1395,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1850,16 +1853,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2307,16 +2311,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2766,16 +2771,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3227,16 +3233,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3684,16 +3691,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4175,16 +4183,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4664,16 +4673,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5161,16 +5171,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5654,16 +5665,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6147,16 +6159,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6642,16 +6655,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7139,16 +7153,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7632,16 +7647,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8122,16 +8138,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8611,16 +8628,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9108,16 +9126,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9601,16 +9620,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10094,16 +10114,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10589,16 +10610,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11086,16 +11108,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11579,16 +11602,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12086,16 +12110,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12591,16 +12616,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13104,16 +13130,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13613,16 +13640,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14122,16 +14150,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14633,16 +14662,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15146,16 +15176,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15655,16 +15686,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16161,16 +16193,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16666,16 +16699,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17179,16 +17213,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17688,16 +17723,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18197,16 +18233,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18708,16 +18745,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19221,16 +19259,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19730,16 +19769,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20189,16 +20229,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20642,16 +20683,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21103,16 +21145,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21560,16 +21603,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22017,16 +22061,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22476,16 +22521,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22937,16 +22983,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23394,16 +23441,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23848,16 +23896,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24301,16 +24350,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24762,16 +24812,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25219,16 +25270,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25674,16 +25726,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26133,16 +26186,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26594,16 +26648,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27051,16 +27106,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27542,16 +27598,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -28031,16 +28088,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -28528,16 +28586,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -29021,16 +29080,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -29514,16 +29574,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -30009,16 +30070,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -30506,16 +30568,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -30999,16 +31062,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -31489,16 +31553,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -31978,16 +32043,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -32475,16 +32541,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -32968,16 +33035,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -33459,16 +33527,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -33954,16 +34023,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -34451,16 +34521,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -34944,16 +35015,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -35434,16 +35506,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -35923,16 +35996,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -36420,16 +36494,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -36913,16 +36988,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -37406,16 +37482,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -37901,16 +37978,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -38398,16 +38476,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -38891,16 +38970,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -39381,16 +39461,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -39870,16 +39951,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -40367,16 +40449,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -40860,16 +40943,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -41351,16 +41435,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -41846,16 +41931,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -42343,16 +42429,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -42836,16 +42923,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -43343,16 +43431,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -43848,16 +43937,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -44361,16 +44451,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -44870,16 +44961,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -45379,16 +45471,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -45890,16 +45983,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -46403,16 +46497,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -46912,16 +47007,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -47418,16 +47514,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -47923,16 +48020,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -48436,16 +48534,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -48945,16 +49044,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -49452,16 +49552,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -49963,16 +50064,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -50476,16 +50578,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -50985,16 +51088,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -51491,16 +51595,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -51996,16 +52101,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -52509,16 +52615,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -53018,16 +53125,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -53527,16 +53635,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -54038,16 +54147,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -54551,16 +54661,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -55060,16 +55171,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -55566,16 +55678,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -56071,16 +56184,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -56584,16 +56698,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -57093,16 +57208,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -57600,16 +57716,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -58111,16 +58228,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -58624,16 +58742,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -59133,16 +59252,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -59598,16 +59718,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -60053,16 +60174,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -60516,16 +60638,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -60973,16 +61096,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -61432,16 +61556,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -61891,16 +62016,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -62354,16 +62480,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -62813,16 +62940,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -63305,16 +63433,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -63796,16 +63925,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -64295,16 +64425,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -64788,16 +64919,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -65283,16 +65415,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -65778,16 +65911,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -66277,16 +66411,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -66772,16 +66907,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -67264,16 +67400,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -67755,16 +67892,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -68254,16 +68392,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -68747,16 +68886,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -69242,16 +69382,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -69737,16 +69878,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -70236,16 +70378,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -70731,16 +70874,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -71240,16 +71384,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -71747,16 +71892,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -72262,16 +72408,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -72771,16 +72918,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -73282,16 +73430,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -73793,16 +73942,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -74308,16 +74458,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -74819,16 +74970,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -75327,16 +75479,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -75834,16 +75987,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -76349,16 +76503,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -76858,16 +77013,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -77369,16 +77525,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -77880,16 +78037,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -78395,16 +78553,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -78906,16 +79065,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -79367,16 +79527,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -79823,16 +79984,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -80287,16 +80449,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -80749,16 +80912,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -81209,16 +81373,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -81673,16 +81838,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -82137,16 +82303,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -82597,16 +82764,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -83054,16 +83222,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -83510,16 +83679,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -83974,16 +84144,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -84436,16 +84607,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -84896,16 +85068,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -85360,16 +85533,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -85824,16 +85998,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -86284,16 +86459,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -86778,16 +86954,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -87270,16 +87447,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -87770,16 +87948,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -88268,16 +88447,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -88764,16 +88944,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -89264,16 +89445,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -89764,16 +89946,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -90260,16 +90443,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -90753,16 +90937,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -91245,16 +91430,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -91745,16 +91931,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -92243,16 +92430,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -92739,16 +92927,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -93239,16 +93428,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -93739,16 +93929,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -94235,16 +94426,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -94728,16 +94920,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -95220,16 +95413,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -95720,16 +95914,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -96218,16 +96413,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -96714,16 +96910,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -97214,16 +97411,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -97714,16 +97912,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -98210,16 +98409,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -98703,16 +98903,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -99195,16 +99396,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -99695,16 +99897,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -100193,16 +100396,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -100689,16 +100893,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -101189,16 +101394,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -101689,16 +101895,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -102185,16 +102392,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -102695,16 +102903,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -103203,16 +103412,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -103719,16 +103929,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -104233,16 +104444,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -104745,16 +104957,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -105261,16 +105474,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -105777,16 +105991,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -106289,16 +106504,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -106798,16 +107014,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -107306,16 +107523,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -107822,16 +108040,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -108336,16 +108555,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -108848,16 +109068,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -109364,16 +109585,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -109880,16 +110102,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -110392,16 +110615,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -110901,16 +111125,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -111409,16 +111634,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -111925,16 +112151,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -112439,16 +112666,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -112951,16 +113179,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -113467,16 +113696,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -113983,16 +114213,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -114495,16 +114726,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -115004,16 +115236,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -115512,16 +115745,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -116028,16 +116262,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -116542,16 +116777,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -117054,16 +117290,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -117570,16 +117807,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -118086,16 +118324,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -118598,16 +118837,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/parts/r/partition_alter2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_myisam.result index 4111a19ace5..e9b1e1c86ef 100644 --- a/mysql-test/suite/parts/r/partition_alter2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_myisam.result @@ -489,20 +489,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -958,20 +958,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1441,20 +1441,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1916,20 +1916,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2395,20 +2395,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2876,20 +2876,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3359,20 +3359,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3840,20 +3840,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4357,20 +4357,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4878,20 +4878,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5413,20 +5413,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5940,20 +5940,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6471,20 +6471,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7004,20 +7004,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7539,20 +7539,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8072,20 +8072,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8588,20 +8588,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9109,20 +9109,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9644,20 +9644,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10171,20 +10171,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10702,20 +10702,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11235,20 +11235,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11770,20 +11770,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12303,20 +12303,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12772,20 +12772,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13241,20 +13241,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13724,20 +13724,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -14199,20 +14199,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -14678,20 +14678,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -15159,20 +15159,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -15642,20 +15642,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -16123,20 +16123,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -16587,20 +16587,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -17056,20 +17056,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -17539,20 +17539,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -18014,20 +18014,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -18491,20 +18491,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -18972,20 +18972,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -19455,20 +19455,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -19936,20 +19936,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -20453,20 +20453,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -20974,20 +20974,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -21509,20 +21509,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -22036,20 +22036,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -22567,20 +22567,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -23100,20 +23100,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -23635,20 +23635,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -24168,20 +24168,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -24684,20 +24684,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -25205,20 +25205,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -25740,20 +25740,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -26267,20 +26267,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -26796,20 +26796,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -27329,20 +27329,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -27864,20 +27864,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -28397,20 +28397,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -28913,20 +28913,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -29434,20 +29434,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -29969,20 +29969,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -30496,20 +30496,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -31027,20 +31027,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -31560,20 +31560,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -32095,20 +32095,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -32628,20 +32628,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -33144,20 +33144,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -33665,20 +33665,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -34200,20 +34200,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -34727,20 +34727,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -35256,20 +35256,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -35789,20 +35789,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -36324,20 +36324,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -36857,20 +36857,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -37332,20 +37332,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -37803,20 +37803,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -38288,20 +38288,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -38763,20 +38763,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -39244,20 +39244,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -39725,20 +39725,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -40210,20 +40210,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -40693,20 +40693,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -41212,20 +41212,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -41735,20 +41735,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -42272,20 +42272,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -42799,20 +42799,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -43332,20 +43332,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -43865,20 +43865,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -44402,20 +44402,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -44937,20 +44937,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -45455,20 +45455,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -45978,20 +45978,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -46515,20 +46515,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -47042,20 +47042,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -47575,20 +47575,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -48108,20 +48108,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -48645,20 +48645,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -49180,20 +49180,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -49651,20 +49651,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -50123,20 +50123,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -50609,20 +50609,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -51089,20 +51089,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -51571,20 +51571,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -52057,20 +52057,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -52543,20 +52543,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -53027,20 +53027,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -53494,20 +53494,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -53966,20 +53966,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -54452,20 +54452,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -54932,20 +54932,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -55414,20 +55414,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -55900,20 +55900,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -56386,20 +56386,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -56870,20 +56870,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -57390,20 +57390,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -57914,20 +57914,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -58452,20 +58452,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -58984,20 +58984,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -59518,20 +59518,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -60056,20 +60056,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -60594,20 +60594,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -61130,20 +61130,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -61649,20 +61649,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -62173,20 +62173,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -62711,20 +62711,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -63243,20 +63243,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -63777,20 +63777,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -64315,20 +64315,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -64853,20 +64853,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -65389,20 +65389,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -65908,20 +65908,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -66432,20 +66432,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -66970,20 +66970,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -67502,20 +67502,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -68036,20 +68036,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -68574,20 +68574,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -69112,20 +69112,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -69648,20 +69648,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -70167,20 +70167,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -70691,20 +70691,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -71229,20 +71229,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -71761,20 +71761,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -72295,20 +72295,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -72833,20 +72833,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -73371,20 +73371,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -73907,20 +73907,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/r/partition_alter4_myisam.result b/mysql-test/suite/parts/r/partition_alter4_myisam.result index ec7a612c6f3..e8d0e2afa37 100644 --- a/mysql-test/suite/parts/r/partition_alter4_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter4_myisam.result @@ -77,12 +77,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -542,18 +542,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1021,24 +1021,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1504,20 +1504,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1979,24 +1979,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2464,24 +2464,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -2947,24 +2947,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3428,26 +3428,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3909,12 +3909,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4374,18 +4374,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4853,24 +4853,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5336,20 +5336,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5811,24 +5811,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6296,24 +6296,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6779,24 +6779,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7260,26 +7260,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -7741,12 +7741,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8206,18 +8206,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -8685,24 +8685,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9168,20 +9168,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -9643,24 +9643,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10128,24 +10128,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -10611,24 +10611,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11092,26 +11092,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -11573,12 +11573,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12038,18 +12038,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -12517,24 +12517,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13000,20 +13000,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13475,24 +13475,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -13960,24 +13960,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14443,24 +14443,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -14924,26 +14924,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15405,12 +15405,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -15870,18 +15870,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16349,24 +16349,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -16832,20 +16832,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17307,24 +17307,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -17792,24 +17792,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18275,24 +18275,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -18756,26 +18756,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19240,12 +19240,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -19705,18 +19705,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20184,24 +20184,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -20667,20 +20667,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21142,24 +21142,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -21627,24 +21627,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22110,24 +22110,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -22591,26 +22591,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23072,12 +23072,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -23537,18 +23537,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24016,24 +24016,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24499,20 +24499,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -24974,24 +24974,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25459,24 +25459,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -25942,24 +25942,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26423,26 +26423,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -26904,12 +26904,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27369,18 +27369,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -27848,24 +27848,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28331,20 +28331,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -28806,24 +28806,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29291,24 +29291,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -29774,24 +29774,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30255,26 +30255,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -30736,12 +30736,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31201,18 +31201,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -31680,24 +31680,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32163,20 +32163,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -32638,24 +32638,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33123,24 +33123,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -33606,24 +33606,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34087,26 +34087,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -34568,12 +34568,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35033,18 +35033,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35512,24 +35512,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -35995,20 +35995,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -36470,24 +36470,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -36955,24 +36955,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -37438,24 +37438,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -37919,26 +37919,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -38403,12 +38403,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -38868,18 +38868,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -39347,24 +39347,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -39830,20 +39830,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -40305,24 +40305,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -40790,24 +40790,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -41273,24 +41273,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -41754,26 +41754,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -42235,12 +42235,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -42700,18 +42700,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -43179,24 +43179,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -43662,20 +43662,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -44137,24 +44137,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -44622,24 +44622,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -45105,24 +45105,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -45586,26 +45586,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -46067,12 +46067,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -46532,18 +46532,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -47011,24 +47011,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -47494,20 +47494,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -47969,24 +47969,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -48454,24 +48454,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -48937,24 +48937,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -49418,26 +49418,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -49899,12 +49899,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -50364,18 +50364,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -50843,24 +50843,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -51326,20 +51326,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -51801,24 +51801,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -52286,24 +52286,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -52769,24 +52769,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -53250,26 +53250,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -53731,12 +53731,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54196,18 +54196,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -54675,24 +54675,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -55158,20 +55158,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -55633,24 +55633,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -56118,24 +56118,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -56601,24 +56601,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -57082,26 +57082,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -57564,12 +57564,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -58027,18 +58027,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -58504,24 +58504,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -58985,20 +58985,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -59458,24 +59458,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -59941,24 +59941,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -60422,24 +60422,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -60901,26 +60901,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -61380,12 +61380,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -61843,18 +61843,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -62320,24 +62320,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -62801,20 +62801,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -63274,24 +63274,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -63757,24 +63757,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -64238,24 +64238,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -64717,26 +64717,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -65516,12 +65516,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -65979,18 +65979,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -66456,24 +66456,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -66937,20 +66937,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -67410,24 +67410,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -67893,24 +67893,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -68374,24 +68374,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -68853,26 +68853,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -69337,12 +69337,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -69802,18 +69802,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -70281,24 +70281,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -70764,20 +70764,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -71239,24 +71239,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -71724,24 +71724,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -72207,24 +72207,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -72688,26 +72688,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -73169,12 +73169,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -73634,18 +73634,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -74113,24 +74113,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -74596,20 +74596,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -75071,24 +75071,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -75556,24 +75556,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -76039,24 +76039,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -76520,26 +76520,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -77001,12 +77001,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -77466,18 +77466,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -77945,24 +77945,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -78428,20 +78428,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -78903,24 +78903,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -79388,24 +79388,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -79871,24 +79871,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -80352,26 +80352,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -80833,12 +80833,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -81298,18 +81298,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -81777,24 +81777,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -82260,20 +82260,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -82735,24 +82735,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -83220,24 +83220,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -83703,24 +83703,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -84184,26 +84184,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -84665,12 +84665,12 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -85130,18 +85130,18 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (f_int1) (PARTITION part_1 ENGINE = MyISAM, PARTITION part_2 ENGINE = MyISAM, PARTITION part_3 ENGINE = MyISAM, PARTITION part_4 ENGINE = MyISAM, PARTITION part_5 ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -85609,24 +85609,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,4)) (PARTITION part_3 VALUES IN (-3) ENGINE = MyISAM, PARTITION part_2 VALUES IN (-2) ENGINE = MyISAM, PARTITION part_1 VALUES IN (-1) ENGINE = MyISAM, PARTITION part_N VALUES IN (NULL) ENGINE = MyISAM, PARTITION part0 VALUES IN (0) ENGINE = MyISAM, PARTITION part1 VALUES IN (1) ENGINE = MyISAM, PARTITION part2 VALUES IN (2) ENGINE = MyISAM, PARTITION part3 VALUES IN (3) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_N.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part0.MYD +t1#P#part0.MYI +t1#P#part1.MYD +t1#P#part1.MYI +t1#P#part2.MYD +t1#P#part2.MYI +t1#P#part3.MYD +t1#P#part3.MYI +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_N.MYD +t1#P#part_N.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -86092,20 +86092,20 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) (PARTITION parta VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_1 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (15) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (20) ENGINE = MyISAM, PARTITION part_5 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_5.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#parta.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1.MYD +t1#P#part_1.MYI +t1#P#part_2.MYD +t1#P#part_2.MYI +t1#P#part_3.MYD +t1#P#part_3.MYI +t1#P#part_4.MYD +t1#P#part_4.MYI +t1#P#part_5.MYD +t1#P#part_5.MYI +t1#P#parta.MYD +t1#P#parta.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -86567,24 +86567,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1 DIV 2) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part_1 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION part_2 VALUES LESS THAN (5) ENGINE = MyISAM, PARTITION part_3 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION part_4 VALUES LESS THAN (2147483646) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#part_4sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_4#SP#part_4sp0.MYD +t1#P#part_4#SP#part_4sp0.MYI +t1#P#part_4#SP#part_4sp1.MYD +t1#P#part_4#SP#part_4sp1.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -87052,24 +87052,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY KEY (f_int1) (PARTITION part_1 VALUES LESS THAN (0) (SUBPARTITION subpart11 ENGINE = MyISAM, SUBPARTITION subpart12 ENGINE = MyISAM), PARTITION part_2 VALUES LESS THAN (5) (SUBPARTITION subpart21 ENGINE = MyISAM, SUBPARTITION subpart22 ENGINE = MyISAM), PARTITION part_3 VALUES LESS THAN (10) (SUBPARTITION subpart31 ENGINE = MyISAM, SUBPARTITION subpart32 ENGINE = MyISAM), PARTITION part_4 VALUES LESS THAN (2147483646) (SUBPARTITION subpart41 ENGINE = MyISAM, SUBPARTITION subpart42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#subpart12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#subpart22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#subpart32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#subpart42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#subpart11.MYD +t1#P#part_1#SP#subpart11.MYI +t1#P#part_1#SP#subpart12.MYD +t1#P#part_1#SP#subpart12.MYI +t1#P#part_2#SP#subpart21.MYD +t1#P#part_2#SP#subpart21.MYI +t1#P#part_2#SP#subpart22.MYD +t1#P#part_2#SP#subpart22.MYI +t1#P#part_3#SP#subpart31.MYD +t1#P#part_3#SP#subpart31.MYI +t1#P#part_3#SP#subpart32.MYD +t1#P#part_3#SP#subpart32.MYI +t1#P#part_4#SP#subpart41.MYD +t1#P#part_4#SP#subpart41.MYI +t1#P#part_4#SP#subpart42.MYD +t1#P#part_4#SP#subpart42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -87535,24 +87535,24 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,3))) SUBPARTITION BY HASH (f_int1 + 1) (PARTITION part_1 VALUES IN (0) (SUBPARTITION sp11 ENGINE = MyISAM, SUBPARTITION sp12 ENGINE = MyISAM), PARTITION part_2 VALUES IN (1) (SUBPARTITION sp21 ENGINE = MyISAM, SUBPARTITION sp22 ENGINE = MyISAM), PARTITION part_3 VALUES IN (2) (SUBPARTITION sp31 ENGINE = MyISAM, SUBPARTITION sp32 ENGINE = MyISAM), PARTITION part_4 VALUES IN (NULL) (SUBPARTITION sp41 ENGINE = MyISAM, SUBPARTITION sp42 ENGINE = MyISAM)) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp11.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#sp12.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp21.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#sp22.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp31.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#sp32.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp41.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_4#SP#sp42.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#sp11.MYD +t1#P#part_1#SP#sp11.MYI +t1#P#part_1#SP#sp12.MYD +t1#P#part_1#SP#sp12.MYI +t1#P#part_2#SP#sp21.MYD +t1#P#part_2#SP#sp21.MYI +t1#P#part_2#SP#sp22.MYD +t1#P#part_2#SP#sp22.MYI +t1#P#part_3#SP#sp31.MYD +t1#P#part_3#SP#sp31.MYI +t1#P#part_3#SP#sp32.MYD +t1#P#part_3#SP#sp32.MYI +t1#P#part_4#SP#sp41.MYD +t1#P#part_4#SP#sp41.MYI +t1#P#part_4#SP#sp42.MYD +t1#P#part_4#SP#sp42.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -88016,26 +88016,26 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (ABS(MOD(f_int1,2))) SUBPARTITION BY KEY (f_int1) SUBPARTITIONS 3 (PARTITION part_1 VALUES IN (0) ENGINE = MyISAM, PARTITION part_2 VALUES IN (1) ENGINE = MyISAM, PARTITION part_3 VALUES IN (NULL) ENGINE = MyISAM) */ unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_1#SP#part_1sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_2#SP#part_2sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp0.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYD -$MYSQLTEST_VARDIR/master-data/test/t1#P#part_3#SP#part_3sp2.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm -$MYSQLTEST_VARDIR/master-data/test/t1.par +t1#P#part_1#SP#part_1sp0.MYD +t1#P#part_1#SP#part_1sp0.MYI +t1#P#part_1#SP#part_1sp1.MYD +t1#P#part_1#SP#part_1sp1.MYI +t1#P#part_1#SP#part_1sp2.MYD +t1#P#part_1#SP#part_1sp2.MYI +t1#P#part_2#SP#part_2sp0.MYD +t1#P#part_2#SP#part_2sp0.MYI +t1#P#part_2#SP#part_2sp1.MYD +t1#P#part_2#SP#part_2sp1.MYI +t1#P#part_2#SP#part_2sp2.MYD +t1#P#part_2#SP#part_2sp2.MYI +t1#P#part_3#SP#part_3sp0.MYD +t1#P#part_3#SP#part_3sp0.MYI +t1#P#part_3#SP#part_3sp1.MYD +t1#P#part_3#SP#part_3sp1.MYI +t1#P#part_3#SP#part_3sp2.MYD +t1#P#part_3#SP#part_3sp2.MYI +t1.frm +t1.par # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -88498,9 +88498,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -88958,9 +88958,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -89426,9 +89426,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -89892,9 +89892,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -90356,9 +90356,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -90824,9 +90824,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -91292,9 +91292,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -91756,9 +91756,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 unified filelist -$MYSQLTEST_VARDIR/master-data/test/t1.MYD -$MYSQLTEST_VARDIR/master-data/test/t1.MYI -$MYSQLTEST_VARDIR/master-data/test/t1.frm +t1.MYD +t1.MYI +t1.frm # check prerequisites-1 success: 1 # check COUNT(*) success: 1 diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result index 1c340d913bf..2f6e58b186a 100644 --- a/mysql-test/suite/parts/r/partition_basic_innodb.result +++ b/mysql-test/suite/parts/r/partition_basic_innodb.result @@ -482,16 +482,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -934,16 +935,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1394,16 +1396,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1850,16 +1853,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2306,16 +2310,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2764,16 +2769,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3228,16 +3234,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3684,16 +3691,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4138,16 +4146,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4590,16 +4599,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5050,16 +5060,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5506,16 +5517,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5960,16 +5972,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6418,16 +6431,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -6878,16 +6892,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7334,16 +7349,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -7829,16 +7845,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8318,16 +8335,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -8815,16 +8833,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9308,16 +9327,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -9801,16 +9821,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10296,16 +10317,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -10797,16 +10819,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11290,16 +11313,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -11780,16 +11804,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12269,16 +12294,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -12766,16 +12792,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13259,16 +13286,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -13752,16 +13780,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14247,16 +14276,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -14748,16 +14778,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15241,16 +15272,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -15747,16 +15779,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16252,16 +16285,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -16765,16 +16799,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17274,16 +17309,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -17783,16 +17819,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18294,16 +18331,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -18811,16 +18849,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19320,16 +19359,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -19815,16 +19855,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20304,16 +20345,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -20801,16 +20843,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21294,16 +21337,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -21785,16 +21829,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22280,16 +22325,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -22777,16 +22823,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23270,16 +23317,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -23760,16 +23808,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24249,16 +24298,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -24746,16 +24796,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25239,16 +25290,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -25730,16 +25782,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26225,16 +26278,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -26722,16 +26776,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27215,16 +27270,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -27721,16 +27777,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -28226,16 +28283,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -28739,16 +28797,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -29248,16 +29307,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -29755,16 +29815,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -30266,16 +30327,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -30779,16 +30841,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -31288,16 +31351,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/parts/r/partition_basic_myisam.result b/mysql-test/suite/parts/r/partition_basic_myisam.result index 72592d8ee92..abb9518f89a 100644 --- a/mysql-test/suite/parts/r/partition_basic_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_myisam.result @@ -488,20 +488,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -952,20 +952,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1430,20 +1430,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1900,20 +1900,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2374,20 +2374,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2850,20 +2850,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3332,20 +3332,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3808,20 +3808,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4268,20 +4268,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4732,20 +4732,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5210,20 +5210,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5680,20 +5680,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6152,20 +6152,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6628,20 +6628,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7106,20 +7106,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7582,20 +7582,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8099,20 +8099,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8616,20 +8616,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9147,20 +9147,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9670,20 +9670,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10197,20 +10197,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10726,20 +10726,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11261,20 +11261,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11790,20 +11790,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12307,20 +12307,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12824,20 +12824,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13355,20 +13355,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13878,20 +13878,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -14403,20 +14403,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -14932,20 +14932,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -15463,20 +15463,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -15992,20 +15992,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result index 658e255dfac..2d7df9225ac 100644 --- a/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result +++ b/mysql-test/suite/parts/r/partition_basic_symlink_myisam.result @@ -502,20 +502,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -991,20 +991,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1493,20 +1493,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1987,20 +1987,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2485,20 +2485,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2981,20 +2981,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3499,20 +3499,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3999,20 +3999,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4469,20 +4469,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4958,20 +4958,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5460,20 +5460,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5954,20 +5954,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6450,20 +6450,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -6946,20 +6946,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7464,20 +7464,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -7964,20 +7964,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -8491,20 +8491,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9033,20 +9033,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -9588,20 +9588,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10135,20 +10135,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -10686,20 +10686,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11235,20 +11235,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -11806,20 +11806,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12359,20 +12359,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -12886,20 +12886,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13428,20 +13428,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -13983,20 +13983,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -14530,20 +14530,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -15079,20 +15079,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -15628,20 +15628,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -16199,20 +16199,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -16752,20 +16752,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -17273,20 +17273,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -17805,20 +17805,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -18353,20 +18353,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -18888,20 +18888,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -19427,20 +19427,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -19968,20 +19968,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -20529,20 +20529,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/r/partition_engine_innodb.result b/mysql-test/suite/parts/r/partition_engine_innodb.result index 4aad4c3c36a..638b1fc67e6 100644 --- a/mysql-test/suite/parts/r/partition_engine_innodb.result +++ b/mysql-test/suite/parts/r/partition_engine_innodb.result @@ -473,16 +473,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -927,16 +928,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1380,16 +1382,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -1896,16 +1899,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2388,16 +2392,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -2841,16 +2846,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3296,16 +3302,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -3749,16 +3756,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4205,16 +4213,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -4656,16 +4665,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text @@ -5105,16 +5115,17 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/parts/r/partition_engine_myisam.result b/mysql-test/suite/parts/r/partition_engine_myisam.result index 79fdfbb62b0..233bffd75b0 100644 --- a/mysql-test/suite/parts/r/partition_engine_myisam.result +++ b/mysql-test/suite/parts/r/partition_engine_myisam.result @@ -483,20 +483,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -947,20 +947,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1414,20 +1414,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -1944,20 +1944,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2450,20 +2450,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -2917,20 +2917,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3382,20 +3382,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -3849,20 +3849,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4319,20 +4319,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -4778,20 +4778,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; @@ -5237,20 +5237,20 @@ AND f_int2 <> CAST(f_char1 AS SIGNED INT) AND f_charbig = '####updated per insert trigger####'; ANALYZE TABLE t1; Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze +test.t1 analyze status OK CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check +test.t1 check status OK CHECKSUM TABLE t1 EXTENDED; Table Checksum test.t1 OPTIMIZE TABLE t1; Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize +test.t1 optimize status OK # check layout success: 1 REPAIR TABLE t1 EXTENDED; Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair +test.t1 repair status OK # check layout success: 1 TRUNCATE t1; diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index c2707f5a763..1885e17d73d 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -7,5 +7,3 @@ partition_syntax_ndb : Bug#36735 Not supported partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function partition_value_ndb : Bug#30581 partition_value tests use disallowed CAST() function -partition_alter4_myisam : Bug#20129 / WL#4176 -partition_alter4_innodb : Bug#20129 / WL#4176 From 87b43cf0df055f15187d1b53d0834a505e39dbb6 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Tue, 12 Aug 2008 17:09:36 +0800 Subject: [PATCH 164/352] Apply tomas's patch to fix rpl_row_basic.test, this can fix BUG#37884, BUG#38369, enable rpl_row_basic_7ndb test --- mysql-test/extra/rpl_tests/rpl_row_basic.test | 68 +++++++++++------- .../suite/rpl/r/rpl_row_basic_2myisam.result | 26 ++++--- .../suite/rpl/r/rpl_row_basic_3innodb.result | 26 ++++--- .../suite/rpl_ndb/r/rpl_row_basic_7ndb.result | 71 ++++++++++++++++++- mysql-test/suite/rpl_ndb/t/disabled.def | 1 - 5 files changed, 146 insertions(+), 46 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 4be7ad54cb3..91894e12726 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -309,52 +309,54 @@ sync_slave_with_master; # 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8 connection master; -CREATE TABLE t1 (i INT NOT NULL, - c CHAR(16) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t1 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; -CREATE TABLE t2 (i INT NOT NULL, - c CHAR(16) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t2 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t3 (i INT NOT NULL, - c CHAR(128) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t3 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t4 (i INT NOT NULL, - c CHAR(128) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t4 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; -CREATE TABLE t5 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t5 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t6 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t6 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t7 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t7 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; --echo [expecting slave to replicate correctly] connection master; INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t1; let $diff_table_2=slave:test.t1; source include/diff_tables.inc; @@ -364,6 +366,8 @@ connection master; INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t2; let $diff_table_2=slave:test.t2; source include/diff_tables.inc; @@ -379,7 +383,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -388,6 +396,8 @@ connection master; INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t4; let $diff_table_2=slave:test.t4; source include/diff_tables.inc; @@ -403,7 +413,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -418,7 +432,11 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -427,6 +445,8 @@ connection master; INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +sync_slave_with_master; + let $diff_table_1=master:test.t7; let $diff_table_2=slave:test.t7; source include/diff_tables.inc; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index a001a771541..4cb1b037345 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -453,29 +453,29 @@ a b c DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); @@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index b67902f414a..913ca8d4a49 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -453,29 +453,29 @@ a b c DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); @@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result index b1554bec156..c2cbb6885f2 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result @@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; Last_SQL_Error -0 + SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** @@ -451,3 +451,72 @@ SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +CREATE TABLE t1 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +CREATE TABLE t2 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t3 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t4 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +CREATE TABLE t5 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t6 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t7 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +[expecting slave to replicate correctly] +INSERT INTO t1 VALUES (1, "", 1); +INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t1 and slave:test.t1 +[expecting slave to replicate correctly] +INSERT INTO t2 VALUES (1, "", 1); +INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t2 and slave:test.t2 +[expecting slave to stop] +INSERT INTO t3 VALUES (1, "", 1); +INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t4 VALUES (1, "", 1); +INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +Comparing tables master:test.t4 and slave:test.t4 +[expecting slave to stop] +INSERT INTO t5 VALUES (1, "", 1); +INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to stop] +INSERT INTO t6 VALUES (1, "", 1); +INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t7 VALUES (1, "", 1); +INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +Comparing tables master:test.t7 and slave:test.t7 +drop table t1, t2, t3, t4, t5, t6, t7; diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 7010fba26b2..ebc99feeac6 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -12,6 +12,5 @@ rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication. rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication. -rpl_row_basic_7ndb : Bug#38369 rpl_ndb.rpl_row_basic_7ndb fails # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open From 9b619d2d496e01b849ad7132487c111b38a184ee Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Tue, 12 Aug 2008 17:05:19 -0600 Subject: [PATCH 165/352] Bug#38296 (low memory crash with many conditions in a query) This fix is for 5.1 only : back porting the 6.0 patch manually The parser code in sql/sql_yacc.yy needs to be more robust to out of memory conditions, so that when parsing a query fails due to OOM, the thread gracefully returns an error. Before this fix, a new/alloc returning NULL could: - cause a crash, if dereferencing the NULL pointer, - produce a corrupted parsed tree, containing NULL nodes, - alter the semantic of a query, by silently dropping token values or nodes With this fix: - C++ constructors are *not* executed with a NULL "this" pointer when operator new fails. This is achieved by declaring "operator new" with a "throw ()" clause, so that a failed new gracefully returns NULL on OOM conditions. - calls to new/alloc are tested for a NULL result, - The thread diagnostic area is set to an error status when OOM occurs. This ensures that a request failing in the server properly returns an ER_OUT_OF_RESOURCES error to the client. - OOM conditions cause the parser to stop immediately (MYSQL_YYABORT). This prevents causing further crashes when using a partially built parsed tree in further rules in the parser. No test scripts are provided, since automating OOM failures is not instrumented in the server. Tested under the debugger, to verify that an error in alloc_root cause the thread to returns gracefully all the way to the client application, with an ER_OUT_OF_RESOURCES error. --- sql/sql_yacc.yy | 1648 ++++++++++++++++++++++++++++++++++++--------- sql/thr_malloc.cc | 30 +- 2 files changed, 1342 insertions(+), 336 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ccd64c24960..b5bcbd4207f 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1715,6 +1715,8 @@ create: } key= new Key($2, $4.str, &lex->key_create_info, 0, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); } @@ -1869,7 +1871,10 @@ opt_ev_status: ev_starts: /* empty */ { - Lex->event_parse_data->item_starts= new Item_func_now_local(); + Item *item= new (YYTHD->mem_root) Item_func_now_local(); + if (item == NULL) + MYSQL_YYABORT; + Lex->event_parse_data->item_starts= item; } | STARTS_SYM expr { @@ -2016,6 +2021,8 @@ sp_name: MYSQL_YYABORT; } $$= new sp_name($1, $3, true); + if ($$ == NULL) + MYSQL_YYABORT; $$->init_qname(YYTHD); } | ident @@ -2030,8 +2037,9 @@ sp_name: if (lex->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; $$= new sp_name(db, $1, false); - if ($$) - $$->init_qname(thd); + if ($$ == NULL) + MYSQL_YYABORT; + $$->init_qname(thd); } ; @@ -2268,6 +2276,7 @@ sp_decl: type sp_opt_default { + THD *thd= YYTHD; LEX *lex= Lex; sp_pcontext *pctx= lex->spcont; uint num_vars= pctx->context_var_count(); @@ -2276,7 +2285,9 @@ sp_decl: if (!dflt_value_item) { - dflt_value_item= new Item_null(); + dflt_value_item= new (thd->mem_root) Item_null(); + if (dflt_value_item == NULL) + MYSQL_YYABORT; /* QQ Set to the var_type with null_value? */ } @@ -2302,10 +2313,17 @@ sp_decl: /* The last instruction is responsible for freeing LEX. */ - lex->sphead->add_instr( - new sp_instr_set(lex->sphead->instructions(), pctx, var_idx, - dflt_value_item, var_type, lex, - (i == num_vars - 1))); + sp_instr_set *is= new sp_instr_set(lex->sphead->instructions(), + pctx, + var_idx, + dflt_value_item, + var_type, + lex, + (i == num_vars - 1)); + if (is == NULL) + MYSQL_YYABORT; + + lex->sphead->add_instr(is); } pctx->declare_var_boundary(0); @@ -2339,7 +2357,8 @@ sp_decl: sp_instr_hpush_jump *i= new sp_instr_hpush_jump(sp->instructions(), ctx, $2, ctx->current_var_count()); - + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); sp->push_backpatch(i, ctx->push_label((char *)"", 0)); } @@ -2355,12 +2374,15 @@ sp_decl: { i= new sp_instr_hreturn(sp->instructions(), ctx, ctx->current_var_count()); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); } else { /* EXIT or UNDO handler, just jump to the end of the block */ i= new sp_instr_hreturn(sp->instructions(), ctx, 0); - + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */ } @@ -2388,6 +2410,8 @@ sp_decl: } i= new sp_instr_cpush(sp->instructions(), ctx, $5, ctx->current_cursor_count()); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); ctx->push_cursor(&$2); $$.vars= $$.conds= $$.hndlrs= 0; @@ -2457,6 +2481,8 @@ sp_cond: ulong_num { /* mysql errno */ $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + MYSQL_YYABORT; $$->type= sp_cond_type_t::number; $$->mysqlerr= $1; } @@ -2468,6 +2494,8 @@ sp_cond: MYSQL_YYABORT; } $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + MYSQL_YYABORT; $$->type= sp_cond_type_t::state; memcpy($$->sqlstate, $3.str, 5); $$->sqlstate[5]= '\0'; @@ -2496,16 +2524,22 @@ sp_hcond: | SQLWARNING_SYM /* SQLSTATEs 01??? */ { $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + MYSQL_YYABORT; $$->type= sp_cond_type_t::warning; } | not FOUND_SYM /* SQLSTATEs 02??? */ { $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + MYSQL_YYABORT; $$->type= sp_cond_type_t::notfound; } | SQLEXCEPTION_SYM /* All other SQLSTATEs */ { $$= (sp_cond_type_t *)YYTHD->alloc(sizeof(sp_cond_type_t)); + if ($$ == NULL) + MYSQL_YYABORT; $$->type= sp_cond_type_t::exception; } ; @@ -2604,6 +2638,8 @@ sp_proc_stmt_statement: { sp_instr_stmt *i=new sp_instr_stmt(sp->instructions(), lex->spcont, lex); + if (i == NULL) + MYSQL_YYABORT; /* Extract the query statement from the tokenizer. The @@ -2642,6 +2678,8 @@ sp_proc_stmt_return: i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3, sp->m_return_field_def.sql_type, lex); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); sp->m_flags|= sp_head::HAS_RETURN; } @@ -2752,6 +2790,8 @@ sp_proc_stmt_iterate: sp->add_instr(cpop); } i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */ + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); } } @@ -2771,6 +2811,8 @@ sp_proc_stmt_open: MYSQL_YYABORT; } i= new sp_instr_copen(sp->instructions(), lex->spcont, offset); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); } ; @@ -2789,6 +2831,8 @@ sp_proc_stmt_fetch: MYSQL_YYABORT; } i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); } sp_fetch_list @@ -2809,6 +2853,8 @@ sp_proc_stmt_close: MYSQL_YYABORT; } i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); } ; @@ -2872,6 +2918,8 @@ sp_if: uint ip= sp->instructions(); sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx, $2, lex); + if (i == NULL) + MYSQL_YYABORT; sp->push_backpatch(i, ctx->push_label((char *)"", 0)); sp->add_cont_backpatch(i); @@ -2884,6 +2932,8 @@ sp_if: sp_pcontext *ctx= Lex->spcont; uint ip= sp->instructions(); sp_instr_jump *i = new sp_instr_jump(ip, ctx); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); sp->backpatch(ctx->pop_label()); @@ -3007,6 +3057,8 @@ else_clause_opt: uint ip= sp->instructions(); sp_instr_error *i= new sp_instr_error(ip, lex->spcont, ER_SP_CASE_NOT_FOUND); + if (i == NULL) + MYSQL_YYABORT; sp->add_instr(i); } | ELSE sp_proc_stmts1 @@ -3115,14 +3167,23 @@ sp_block_content: LEX *lex= Lex; sp_head *sp= lex->sphead; sp_pcontext *ctx= lex->spcont; + sp_instr *i; sp->backpatch(ctx->last_label()); /* We always have a label */ if ($3.hndlrs) - sp->add_instr(new sp_instr_hpop(sp->instructions(), ctx, - $3.hndlrs)); + { + i= new sp_instr_hpop(sp->instructions(), ctx, $3.hndlrs); + if (i == NULL) + MYSQL_YYABORT; + sp->add_instr(i); + } if ($3.curs) - sp->add_instr(new sp_instr_cpop(sp->instructions(), ctx, - $3.curs)); + { + i= new sp_instr_cpop(sp->instructions(), ctx, $3.curs); + if (i == NULL) + MYSQL_YYABORT; + sp->add_instr(i); + } lex->spcont= ctx->pop_context(); } ; @@ -3135,7 +3196,8 @@ sp_unlabeled_control: uint ip= lex->sphead->instructions(); sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */ sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip); - + if (i == NULL) + MYSQL_YYABORT; lex->sphead->add_instr(i); } | WHILE_SYM @@ -3147,7 +3209,8 @@ sp_unlabeled_control: uint ip= sp->instructions(); sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, $3, lex); - + if (i == NULL) + MYSQL_YYABORT; /* Jumping forward */ sp->push_backpatch(i, lex->spcont->last_label()); sp->new_cont_backpatch(i); @@ -3160,7 +3223,8 @@ sp_unlabeled_control: uint ip= lex->sphead->instructions(); sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */ sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip); - + if (i == NULL) + MYSQL_YYABORT; lex->sphead->add_instr(i); lex->sphead->do_cont_backpatch(); } @@ -3174,6 +3238,8 @@ sp_unlabeled_control: sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, $5, lab->ip, lex); + if (i == NULL) + MYSQL_YYABORT; lex->sphead->add_instr(i); lex->sphead->restore_lex(YYTHD); /* We can shortcut the cont_backpatch here */ @@ -3390,6 +3456,8 @@ tablespace_name: { LEX *lex= Lex; lex->alter_tablespace_info= new st_alter_tablespace(); + if (lex->alter_tablespace_info == NULL) + MYSQL_YYABORT; lex->alter_tablespace_info->tablespace_name= $1.str; lex->sql_command= SQLCOM_ALTER_TABLESPACE; } @@ -3400,6 +3468,8 @@ logfile_group_name: { LEX *lex= Lex; lex->alter_tablespace_info= new st_alter_tablespace(); + if (lex->alter_tablespace_info == NULL) + MYSQL_YYABORT; lex->alter_tablespace_info->logfile_group_name= $1.str; lex->sql_command= SQLCOM_ALTER_TABLESPACE; } @@ -3775,7 +3845,10 @@ part_func: uint expr_len= (uint)($4 - $2) - 1; lex->part_info->list_of_part_fields= FALSE; lex->part_info->part_expr= $3; - lex->part_info->part_func_string= (char* ) sql_memdup($2+1, expr_len); + char *func_string= (char*) sql_memdup($2+1, expr_len); + if (func_string == NULL) + MYSQL_YYABORT; + lex->part_info->part_func_string= func_string; lex->part_info->part_func_len= expr_len; } ; @@ -3787,7 +3860,10 @@ sub_part_func: uint expr_len= (uint)($4 - $2) - 1; lex->part_info->list_of_subpart_fields= FALSE; lex->part_info->subpart_expr= $3; - lex->part_info->subpart_func_string= (char* ) sql_memdup($2+1, expr_len); + char *func_string= (char*) sql_memdup($2+1, expr_len); + if (func_string == NULL) + MYSQL_YYABORT; + lex->part_info->subpart_func_string= func_string; lex->part_info->subpart_func_len= expr_len; } ; @@ -4579,6 +4655,8 @@ key_def: } Key *key= new Key($1, $2, &lex->key_create_info, 0, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ } @@ -4589,6 +4667,8 @@ key_def: const char *key_name= $3 ? $3 : $1; Key *key= new Key($2, key_name, &lex->key_create_info, 0, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ } @@ -4603,10 +4683,14 @@ key_def: lex->fk_delete_opt, lex->fk_update_opt, lex->fk_match_option); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); key= new Key(Key::MULTIPLE, key_name, &default_key_create_info, 1, lex->col_list); + if (key == NULL) + MYSQL_YYABORT; lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ /* Only used for ALTER TABLE. Ignored otherwise. */ @@ -4944,7 +5028,12 @@ attribute: | not NULL_SYM { Lex->type|= NOT_NULL_FLAG; } | DEFAULT now_or_signed_literal { Lex->default_value=$2; } | ON UPDATE_SYM NOW_SYM optional_braces - { Lex->on_update_value= new Item_func_now_local(); } + { + Item *item= new (YYTHD->mem_root) Item_func_now_local(); + if (item == NULL) + MYSQL_YYABORT; + Lex->on_update_value= item; + } | AUTO_INC { Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG; } | SERIAL_SYM DEFAULT VALUE_SYM { @@ -4988,7 +5077,11 @@ attribute: now_or_signed_literal: NOW_SYM optional_braces - { $$= new Item_func_now_local(); } + { + $$= new (YYTHD->mem_root) Item_func_now_local(); + if ($$ == NULL) + MYSQL_YYABORT; + } | signed_literal { $$=$1; } ; @@ -5125,8 +5218,20 @@ opt_ref_list: ; ref_list: - ref_list ',' ident { Lex->ref_list.push_back(new Key_part_spec($3.str)); } - | ident { Lex->ref_list.push_back(new Key_part_spec($1.str)); } + ref_list ',' ident + { + Key_part_spec *key= new Key_part_spec($3.str); + if (key == NULL) + MYSQL_YYABORT; + Lex->ref_list.push_back(key); + } + | ident + { + Key_part_spec *key= new Key_part_spec($1.str); + if (key == NULL) + MYSQL_YYABORT; + Lex->ref_list.push_back(key); + } ; opt_on_delete: @@ -5267,7 +5372,12 @@ key_list: ; key_part: - ident { $$=new Key_part_spec($1.str); } + ident + { + $$= new Key_part_spec($1.str); + if ($$ == NULL) + MYSQL_YYABORT; + } | ident '(' NUM ')' { int key_part_len= atoi($3.str); @@ -5275,7 +5385,9 @@ key_part: { my_error(ER_KEY_PART_0, MYF(0), $1.str); } - $$=new Key_part_spec($1.str,(uint) key_part_len); + $$= new Key_part_spec($1.str,(uint) key_part_len); + if ($$ == NULL) + MYSQL_YYABORT; } ; @@ -5635,7 +5747,7 @@ reorg_partition_rule: lex->part_info= new partition_info(); if (!lex->part_info) { - mem_alloc_error(sizeof(partition_info)); + mem_alloc_error(sizeof(partition_info)); MYSQL_YYABORT; } lex->no_write_to_binlog= $3; @@ -5735,8 +5847,10 @@ alter_list_item: | DROP opt_column field_ident opt_restrict { LEX *lex=Lex; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN, - $3.str)); + Alter_drop *ad= new Alter_drop(Alter_drop::COLUMN, $3.str); + if (ad == NULL) + MYSQL_YYABORT; + lex->alter_info.drop_list.push_back(ad); lex->alter_info.flags|= ALTER_DROP_COLUMN; } | DROP FOREIGN KEY_SYM opt_ident @@ -5746,15 +5860,19 @@ alter_list_item: | DROP PRIMARY_SYM KEY_SYM { LEX *lex=Lex; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - primary_key_name)); + Alter_drop *ad= new Alter_drop(Alter_drop::KEY, primary_key_name); + if (ad == NULL) + MYSQL_YYABORT; + lex->alter_info.drop_list.push_back(ad); lex->alter_info.flags|= ALTER_DROP_INDEX; } | DROP key_or_index field_ident { LEX *lex=Lex; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - $3.str)); + Alter_drop *ad= new Alter_drop(Alter_drop::KEY, $3.str); + if (ad == NULL) + MYSQL_YYABORT; + lex->alter_info.drop_list.push_back(ad); lex->alter_info.flags|= ALTER_DROP_INDEX; } | DISABLE_SYM KEYS @@ -5772,14 +5890,19 @@ alter_list_item: | ALTER opt_column field_ident SET DEFAULT signed_literal { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column($3.str,$6)); + Alter_column *ac= new Alter_column($3.str,$6); + if (ac == NULL) + MYSQL_YYABORT; + lex->alter_info.alter_list.push_back(ac); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } | ALTER opt_column field_ident DROP DEFAULT { LEX *lex=Lex; - lex->alter_info.alter_list.push_back(new Alter_column($3.str, - (Item*) 0)); + Alter_column *ac= new Alter_column($3.str, (Item*) 0); + if (ac == NULL) + MYSQL_YYABORT; + lex->alter_info.alter_list.push_back(ac); lex->alter_info.flags|= ALTER_CHANGE_COLUMN_DEFAULT; } | RENAME opt_to table_ident @@ -6419,10 +6542,12 @@ select_item_list: | '*' { THD *thd= YYTHD; - if (add_item_to_list(thd, - new Item_field(&thd->lex->current_select-> - context, - NULL, NULL, "*"))) + Item *item= new (thd->mem_root) + Item_field(&thd->lex->current_select->context, + NULL, NULL, "*"); + if (item == NULL) + MYSQL_YYABORT; + if (add_item_to_list(thd, item)) MYSQL_YYABORT; (thd->lex->current_select->with_wild)++; } @@ -6533,12 +6658,16 @@ expr: { /* X OR Y */ $$ = new (YYTHD->mem_root) Item_cond_or($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; } } | expr XOR expr %prec XOR { /* XOR is a proprietary extension */ $$ = new (YYTHD->mem_root) Item_cond_xor($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; } | expr and expr %prec AND_SYM { @@ -6579,36 +6708,86 @@ expr: { /* X AND Y */ $$ = new (YYTHD->mem_root) Item_cond_and($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; } } | NOT_SYM expr %prec NOT_SYM - { $$= negate_expression(YYTHD, $2); } + { + $$= negate_expression(YYTHD, $2); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS TRUE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_istrue($1); } + { + $$= new (YYTHD->mem_root) Item_func_istrue($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not TRUE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_isnottrue($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnottrue($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS FALSE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_isfalse($1); } + { + $$= new (YYTHD->mem_root) Item_func_isfalse($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not FALSE_SYM %prec IS - { $$= new (YYTHD->mem_root) Item_func_isnotfalse($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnotfalse($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS UNKNOWN_SYM %prec IS - { $$= new Item_func_isnull($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not UNKNOWN_SYM %prec IS - { $$= new Item_func_isnotnull($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnotnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri ; bool_pri: bool_pri IS NULL_SYM %prec IS - { $$= new Item_func_isnull($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri IS not NULL_SYM %prec IS - { $$= new Item_func_isnotnull($1); } + { + $$= new (YYTHD->mem_root) Item_func_isnotnull($1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri EQUAL_SYM predicate %prec EQUAL_SYM - { $$= new Item_func_equal($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_equal($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri comp_op predicate %prec EQ - { $$= (*$2)(0)->create($1,$3); } + { + $$= (*$2)(0)->create($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bool_pri comp_op all_or_any '(' subselect ')' %prec EQ - { $$= all_any_subquery_creator($1, $2, $3, $5); } + { + $$= all_any_subquery_creator($1, $2, $3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | predicate ; @@ -6616,87 +6795,193 @@ predicate: bit_expr IN_SYM '(' subselect ')' { $$= new (YYTHD->mem_root) Item_in_subselect($1, $4); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr not IN_SYM '(' subselect ')' { THD *thd= YYTHD; Item *item= new (thd->mem_root) Item_in_subselect($1, $5); + if (item == NULL) + MYSQL_YYABORT; $$= negate_expression(thd, item); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr IN_SYM '(' expr ')' { $$= handle_sql2003_note184_exception(YYTHD, $1, true, $4); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr IN_SYM '(' expr ',' expr_list ')' { $6->push_front($4); $6->push_front($1); $$= new (YYTHD->mem_root) Item_func_in(*$6); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr not IN_SYM '(' expr ')' { $$= handle_sql2003_note184_exception(YYTHD, $1, false, $5); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr not IN_SYM '(' expr ',' expr_list ')' { $7->push_front($5); $7->push_front($1); Item_func_in *item = new (YYTHD->mem_root) Item_func_in(*$7); + if (item == NULL) + MYSQL_YYABORT; item->negate(); $$= item; } | bit_expr BETWEEN_SYM bit_expr AND_SYM predicate - { $$= new Item_func_between($1,$3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_between($1,$3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr not BETWEEN_SYM bit_expr AND_SYM predicate { - Item_func_between *item= new Item_func_between($1,$4,$6); + Item_func_between *item; + item= new (YYTHD->mem_root) Item_func_between($1,$4,$6); + if (item == NULL) + MYSQL_YYABORT; item->negate(); $$= item; } | bit_expr SOUNDS_SYM LIKE bit_expr { - $$= new Item_func_eq(new Item_func_soundex($1), - new Item_func_soundex($4)); + Item *item1= new (YYTHD->mem_root) Item_func_soundex($1); + Item *item4= new (YYTHD->mem_root) Item_func_soundex($4); + if ((item1 == NULL) || (item4 == NULL)) + MYSQL_YYABORT; + $$= new (YYTHD->mem_root) Item_func_eq(item1, item4); + if ($$ == NULL) + MYSQL_YYABORT; } | bit_expr LIKE simple_expr opt_escape - { $$= new Item_func_like($1,$3,$4,Lex->escape_used); } + { + $$= new (YYTHD->mem_root) Item_func_like($1,$3,$4,Lex->escape_used); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr not LIKE simple_expr opt_escape - { $$= new Item_func_not(new Item_func_like($1,$4,$5, Lex->escape_used)); } - | bit_expr REGEXP bit_expr { $$= new Item_func_regex($1,$3); } + { + Item *item= new (YYTHD->mem_root) Item_func_like($1,$4,$5, + Lex->escape_used); + if (item == NULL) + MYSQL_YYABORT; + $$= new (YYTHD->mem_root) Item_func_not(item); + if ($$ == NULL) + MYSQL_YYABORT; + } + | bit_expr REGEXP bit_expr + { + $$= new (YYTHD->mem_root) Item_func_regex($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr not REGEXP bit_expr - { $$= negate_expression(YYTHD, new Item_func_regex($1,$4)); } + { + Item *item= new (YYTHD->mem_root) Item_func_regex($1,$4); + if (item == NULL) + MYSQL_YYABORT; + $$= negate_expression(YYTHD, item); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr ; bit_expr: bit_expr '|' bit_expr %prec '|' - { $$= new Item_func_bit_or($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_bit_or($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '&' bit_expr %prec '&' - { $$= new Item_func_bit_and($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_bit_and($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr SHIFT_LEFT bit_expr %prec SHIFT_LEFT - { $$= new Item_func_shift_left($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_shift_left($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr SHIFT_RIGHT bit_expr %prec SHIFT_RIGHT - { $$= new Item_func_shift_right($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_shift_right($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '+' bit_expr %prec '+' - { $$= new Item_func_plus($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_plus($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '-' bit_expr %prec '-' - { $$= new Item_func_minus($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_minus($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '+' INTERVAL_SYM expr interval %prec '+' - { $$= new Item_date_add_interval($1,$4,$5,0); } + { + $$= new (YYTHD->mem_root) Item_date_add_interval($1,$4,$5,0); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '-' INTERVAL_SYM expr interval %prec '-' - { $$= new Item_date_add_interval($1,$4,$5,1); } + { + $$= new (YYTHD->mem_root) Item_date_add_interval($1,$4,$5,1); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '*' bit_expr %prec '*' - { $$= new Item_func_mul($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_mul($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '/' bit_expr %prec '/' - { $$= new Item_func_div($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_div($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '%' bit_expr %prec '%' - { $$= new Item_func_mod($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_mod($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr DIV_SYM bit_expr %prec DIV_SYM - { $$= new Item_func_int_div($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_int_div($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr MOD_SYM bit_expr %prec MOD_SYM - { $$= new Item_func_mod($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_mod($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | bit_expr '^' bit_expr - { $$= new Item_func_bit_xor($1,$3); } + { + $$= new (YYTHD->mem_root) Item_func_bit_xor($1,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | simple_expr ; @@ -6746,45 +7031,80 @@ simple_expr: Item *i1= new (thd->mem_root) Item_string($3.str, $3.length, thd->charset()); + if (i1 == NULL) + MYSQL_YYABORT; $$= new (thd->mem_root) Item_func_set_collation($1, i1); + if ($$ == NULL) + MYSQL_YYABORT; } | literal | param_marker | variable | sum_expr | simple_expr OR_OR_SYM simple_expr - { $$= new (YYTHD->mem_root) Item_func_concat($1, $3); } - | '+' simple_expr %prec NEG { $$= $2; } + { + $$= new (YYTHD->mem_root) Item_func_concat($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '+' simple_expr %prec NEG + { + $$= $2; + } | '-' simple_expr %prec NEG - { $$= new (YYTHD->mem_root) Item_func_neg($2); } + { + $$= new (YYTHD->mem_root) Item_func_neg($2); + if ($$ == NULL) + MYSQL_YYABORT; + } | '~' simple_expr %prec NEG - { $$= new (YYTHD->mem_root) Item_func_bit_neg($2); } + { + $$= new (YYTHD->mem_root) Item_func_bit_neg($2); + if ($$ == NULL) + MYSQL_YYABORT; + } | not2 simple_expr %prec NEG - { $$= negate_expression(YYTHD, $2); } + { + $$= negate_expression(YYTHD, $2); + if ($$ == NULL) + MYSQL_YYABORT; + } | '(' subselect ')' { - $$= new (YYTHD->mem_root) Item_singlerow_subselect($2); + $$= new (YYTHD->mem_root) Item_singlerow_subselect($2); + if ($$ == NULL) + MYSQL_YYABORT; } - | '(' expr ')' { $$= $2; } + | '(' expr ')' + { $$= $2; } | '(' expr ',' expr_list ')' { $4->push_front($2); $$= new (YYTHD->mem_root) Item_row(*$4); + if ($$ == NULL) + MYSQL_YYABORT; } | ROW_SYM '(' expr ',' expr_list ')' { $5->push_front($3); $$= new (YYTHD->mem_root) Item_row(*$5); + if ($$ == NULL) + MYSQL_YYABORT; } | EXISTS '(' subselect ')' { - $$= new (YYTHD->mem_root) Item_exists_subselect($3); + $$= new (YYTHD->mem_root) Item_exists_subselect($3); + if ($$ == NULL) + MYSQL_YYABORT; } - | '{' ident expr '}' { $$= $3; } + | '{' ident expr '}' + { $$= $3; } | MATCH ident_list_arg AGAINST '(' bit_expr fulltext_options ')' { $2->push_front($5); Item_func_match *i1= new (YYTHD->mem_root) Item_func_match(*$2, $6); + if (i1 == NULL) + MYSQL_YYABORT; Select->add_ftfunc_to_list(i1); $$= i1; } @@ -6792,26 +7112,36 @@ simple_expr: { $$= create_func_cast(YYTHD, $2, ITEM_CAST_CHAR, NULL, NULL, &my_charset_bin); + if ($$ == NULL) + MYSQL_YYABORT; } | CAST_SYM '(' expr AS cast_type ')' { LEX *lex= Lex; $$= create_func_cast(YYTHD, $3, $5, lex->length, lex->dec, lex->charset); - if (!$$) + if ($$ == NULL) MYSQL_YYABORT; } | CASE_SYM opt_expr when_list opt_else END - { $$= new (YYTHD->mem_root) Item_func_case(* $3, $2, $4 ); } + { + $$= new (YYTHD->mem_root) Item_func_case(* $3, $2, $4 ); + if ($$ == NULL) + MYSQL_YYABORT; + } | CONVERT_SYM '(' expr ',' cast_type ')' { $$= create_func_cast(YYTHD, $3, $5, Lex->length, Lex->dec, Lex->charset); - if (!$$) + if ($$ == NULL) MYSQL_YYABORT; } | CONVERT_SYM '(' expr USING charset_name ')' - { $$= new (YYTHD->mem_root) Item_func_conv_charset($3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_conv_charset($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | DEFAULT '(' simple_ident ')' { if ($3->is_splocal()) @@ -6823,15 +7153,23 @@ simple_expr: } $$= new (YYTHD->mem_root) Item_default_value(Lex->current_context(), $3); + if ($$ == NULL) + MYSQL_YYABORT; } | VALUES '(' simple_ident_nospvar ')' { $$= new (YYTHD->mem_root) Item_insert_value(Lex->current_context(), $3); + if ($$ == NULL) + MYSQL_YYABORT; } | INTERVAL_SYM expr interval '+' expr %prec INTERVAL_SYM /* we cannot put interval before - */ - { $$= new (YYTHD->mem_root) Item_date_add_interval($5,$2,$3,0); } + { + $$= new (YYTHD->mem_root) Item_date_add_interval($5,$2,$3,0); + if ($$ == NULL) + MYSQL_YYABORT; + } ; /* @@ -6842,31 +7180,63 @@ simple_expr: */ function_call_keyword: CHAR_SYM '(' expr_list ')' - { $$= new (YYTHD->mem_root) Item_func_char(*$3); } + { + $$= new (YYTHD->mem_root) Item_func_char(*$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | CHAR_SYM '(' expr_list USING charset_name ')' - { $$= new (YYTHD->mem_root) Item_func_char(*$3, $5); } + { + $$= new (YYTHD->mem_root) Item_func_char(*$3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | CURRENT_USER optional_braces { $$= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context()); + if ($$ == NULL) + MYSQL_YYABORT; Lex->set_stmt_unsafe(); Lex->safe_to_cache_query= 0; } | DATE_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_date_typecast($3); } + { + $$= new (YYTHD->mem_root) Item_date_typecast($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | DAY_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_dayofmonth($3); } + { + $$= new (YYTHD->mem_root) Item_func_dayofmonth($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | HOUR_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_hour($3); } + { + $$= new (YYTHD->mem_root) Item_func_hour($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | INSERT '(' expr ',' expr ',' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_insert($3,$5,$7,$9); } + { + $$= new (YYTHD->mem_root) Item_func_insert($3,$5,$7,$9); + if ($$ == NULL) + MYSQL_YYABORT; + } | INTERVAL_SYM '(' expr ',' expr ')' %prec INTERVAL_SYM { THD *thd= YYTHD; List *list= new (thd->mem_root) List; + if (list == NULL) + MYSQL_YYABORT; list->push_front($5); list->push_front($3); Item_row *item= new (thd->mem_root) Item_row(*list); + if (item == NULL) + MYSQL_YYABORT; $$= new (thd->mem_root) Item_func_interval(item); + if ($$ == NULL) + MYSQL_YYABORT; } | INTERVAL_SYM '(' expr ',' expr ',' expr_list ')' %prec INTERVAL_SYM { @@ -6874,48 +7244,122 @@ function_call_keyword: $7->push_front($5); $7->push_front($3); Item_row *item= new (thd->mem_root) Item_row(*$7); + if (item == NULL) + MYSQL_YYABORT; $$= new (thd->mem_root) Item_func_interval(item); + if ($$ == NULL) + MYSQL_YYABORT; } | LEFT '(' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_left($3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_left($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | MINUTE_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_minute($3); } + { + $$= new (YYTHD->mem_root) Item_func_minute($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | MONTH_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_month($3); } + { + $$= new (YYTHD->mem_root) Item_func_month($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | RIGHT '(' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_right($3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_right($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | SECOND_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_second($3); } + { + $$= new (YYTHD->mem_root) Item_func_second($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIME_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_time_typecast($3); } + { + $$= new (YYTHD->mem_root) Item_time_typecast($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIMESTAMP '(' expr ')' - { $$= new (YYTHD->mem_root) Item_datetime_typecast($3); } + { + $$= new (YYTHD->mem_root) Item_datetime_typecast($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIMESTAMP '(' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_add_time($3, $5, 1, 0); } + { + $$= new (YYTHD->mem_root) Item_func_add_time($3, $5, 1, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_trim($3); } + { + $$= new (YYTHD->mem_root) Item_func_trim($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' LEADING expr FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_ltrim($6,$4); } + { + $$= new (YYTHD->mem_root) Item_func_ltrim($6,$4); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' TRAILING expr FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_rtrim($6,$4); } + { + $$= new (YYTHD->mem_root) Item_func_rtrim($6,$4); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' BOTH expr FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_trim($6,$4); } + { + $$= new (YYTHD->mem_root) Item_func_trim($6,$4); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' LEADING FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_ltrim($5); } + { + $$= new (YYTHD->mem_root) Item_func_ltrim($5); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' TRAILING FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_rtrim($5); } + { + $$= new (YYTHD->mem_root) Item_func_rtrim($5); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' BOTH FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_trim($5); } + { + $$= new (YYTHD->mem_root) Item_func_trim($5); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRIM '(' expr FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_trim($5,$3); } + { + $$= new (YYTHD->mem_root) Item_func_trim($5,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | USER '(' ')' { $$= new (YYTHD->mem_root) Item_func_user(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->set_stmt_unsafe(); Lex->safe_to_cache_query=0; } | YEAR_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_year($3); } + { + $$= new (YYTHD->mem_root) Item_func_year($3); + if ($$ == NULL) + MYSQL_YYABORT; + } ; /* @@ -6935,65 +7379,127 @@ function_call_nonkeyword: { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $5, INTERVAL_DAY, 0); + if ($$ == NULL) + MYSQL_YYABORT; } | ADDDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')' - { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 0); } + { + $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | CURDATE optional_braces { $$= new (YYTHD->mem_root) Item_func_curdate_local(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | CURTIME optional_braces { $$= new (YYTHD->mem_root) Item_func_curtime_local(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | CURTIME '(' expr ')' { $$= new (YYTHD->mem_root) Item_func_curtime_local($3); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } - | DATE_ADD_INTERVAL '(' expr ',' INTERVAL_SYM expr interval ')' %prec INTERVAL_SYM - { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$6,$7,0); } - | DATE_SUB_INTERVAL '(' expr ',' INTERVAL_SYM expr interval ')' %prec INTERVAL_SYM - { $$= new (YYTHD->mem_root) Item_date_add_interval($3,$6,$7,1); } + | DATE_ADD_INTERVAL '(' expr ',' INTERVAL_SYM expr interval ')' + %prec INTERVAL_SYM + { + $$= new (YYTHD->mem_root) Item_date_add_interval($3,$6,$7,0); + if ($$ == NULL) + MYSQL_YYABORT; + } + | DATE_SUB_INTERVAL '(' expr ',' INTERVAL_SYM expr interval ')' + %prec INTERVAL_SYM + { + $$= new (YYTHD->mem_root) Item_date_add_interval($3,$6,$7,1); + if ($$ == NULL) + MYSQL_YYABORT; + } | EXTRACT_SYM '(' interval FROM expr ')' - { $$=new (YYTHD->mem_root) Item_extract( $3, $5); } + { + $$=new (YYTHD->mem_root) Item_extract( $3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | GET_FORMAT '(' date_time_type ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_get_format($3, $5); } + { + $$= new (YYTHD->mem_root) Item_func_get_format($3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | NOW_SYM optional_braces { $$= new (YYTHD->mem_root) Item_func_now_local(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | NOW_SYM '(' expr ')' { $$= new (YYTHD->mem_root) Item_func_now_local($3); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | POSITION_SYM '(' bit_expr IN_SYM expr ')' - { $$ = new (YYTHD->mem_root) Item_func_locate($5,$3); } + { + $$ = new (YYTHD->mem_root) Item_func_locate($5,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBDATE_SYM '(' expr ',' expr ')' { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $5, INTERVAL_DAY, 1); + if ($$ == NULL) + MYSQL_YYABORT; } | SUBDATE_SYM '(' expr ',' INTERVAL_SYM expr interval ')' - { $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 1); } + { + $$= new (YYTHD->mem_root) Item_date_add_interval($3, $6, $7, 1); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr ',' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); } + { + $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_substr($3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_substr($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr FROM expr FOR_SYM expr ')' - { $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); } + { + $$= new (YYTHD->mem_root) Item_func_substr($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUBSTRING '(' expr FROM expr ')' - { $$= new (YYTHD->mem_root) Item_func_substr($3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_substr($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | SYSDATE optional_braces { if (global_system_variables.sysdate_is_now == 0) $$= new (YYTHD->mem_root) Item_func_sysdate_local(); else $$= new (YYTHD->mem_root) Item_func_now_local(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | SYSDATE '(' expr ')' @@ -7002,25 +7508,41 @@ function_call_nonkeyword: $$= new (YYTHD->mem_root) Item_func_sysdate_local($3); else $$= new (YYTHD->mem_root) Item_func_now_local($3); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | TIMESTAMP_ADD '(' interval_time_stamp ',' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_date_add_interval($7,$5,$3,0); } + { + $$= new (YYTHD->mem_root) Item_date_add_interval($7,$5,$3,0); + if ($$ == NULL) + MYSQL_YYABORT; + } | TIMESTAMP_DIFF '(' interval_time_stamp ',' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_timestamp_diff($5,$7,$3); } + { + $$= new (YYTHD->mem_root) Item_func_timestamp_diff($5,$7,$3); + if ($$ == NULL) + MYSQL_YYABORT; + } | UTC_DATE_SYM optional_braces { $$= new (YYTHD->mem_root) Item_func_curdate_utc(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | UTC_TIME_SYM optional_braces { $$= new (YYTHD->mem_root) Item_func_curtime_utc(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | UTC_TIMESTAMP_SYM optional_braces { $$= new (YYTHD->mem_root) Item_func_now_utc(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } ; @@ -7032,26 +7554,60 @@ function_call_nonkeyword: */ function_call_conflict: ASCII_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_ascii($3); } + { + $$= new (YYTHD->mem_root) Item_func_ascii($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | CHARSET '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_charset($3); } + { + $$= new (YYTHD->mem_root) Item_func_charset($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COALESCE '(' expr_list ')' - { $$= new (YYTHD->mem_root) Item_func_coalesce(* $3); } + { + $$= new (YYTHD->mem_root) Item_func_coalesce(* $3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COLLATION_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_collation($3); } + { + $$= new (YYTHD->mem_root) Item_func_collation($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | DATABASE '(' ')' { $$= new (YYTHD->mem_root) Item_func_database(); + if ($$ == NULL) + MYSQL_YYABORT; Lex->safe_to_cache_query=0; } | IF '(' expr ',' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_if($3,$5,$7); } + { + $$= new (YYTHD->mem_root) Item_func_if($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | MICROSECOND_SYM '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_microsecond($3); } + { + $$= new (YYTHD->mem_root) Item_func_microsecond($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | MOD_SYM '(' expr ',' expr ')' - { $$ = new (YYTHD->mem_root) Item_func_mod( $3, $5); } + { + $$ = new (YYTHD->mem_root) Item_func_mod($3, $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | OLD_PASSWORD '(' expr ')' - { $$= new (YYTHD->mem_root) Item_func_old_password($3); } + { + $$= new (YYTHD->mem_root) Item_func_old_password($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | PASSWORD '(' expr ')' { THD *thd= YYTHD; @@ -7060,31 +7616,59 @@ function_call_conflict: i1= new (thd->mem_root) Item_func_old_password($3); else i1= new (thd->mem_root) Item_func_password($3); + if (i1 == NULL) + MYSQL_YYABORT; $$= i1; } | QUARTER_SYM '(' expr ')' - { $$ = new (YYTHD->mem_root) Item_func_quarter($3); } + { + $$ = new (YYTHD->mem_root) Item_func_quarter($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | REPEAT_SYM '(' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_repeat($3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_repeat($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | REPLACE '(' expr ',' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_replace($3,$5,$7); } + { + $$= new (YYTHD->mem_root) Item_func_replace($3,$5,$7); + if ($$ == NULL) + MYSQL_YYABORT; + } | TRUNCATE_SYM '(' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_round($3,$5,1); } + { + $$= new (YYTHD->mem_root) Item_func_round($3,$5,1); + if ($$ == NULL) + MYSQL_YYABORT; + } | WEEK_SYM '(' expr ')' { THD *thd= YYTHD; Item *i1= new (thd->mem_root) Item_int((char*) "0", thd->variables.default_week_format, 1); - + if (i1 == NULL) + MYSQL_YYABORT; $$= new (thd->mem_root) Item_func_week($3, i1); + if ($$ == NULL) + MYSQL_YYABORT; } | WEEK_SYM '(' expr ',' expr ')' - { $$= new (YYTHD->mem_root) Item_func_week($3,$5); } + { + $$= new (YYTHD->mem_root) Item_func_week($3,$5); + if ($$ == NULL) + MYSQL_YYABORT; + } | geometry_function { #ifdef HAVE_SPATIAL $$= $1; + /* $1 may be NULL, GEOM_NEW not tested for out of memory */ + if ($$ == NULL) + MYSQL_YYABORT; #else my_error(ER_FEATURE_DISABLED, MYF(0), sym_group_geom.name, sym_group_geom.needed_define); @@ -7136,7 +7720,9 @@ geometry_function: Geometry::wkb_polygon)); } | POINT_SYM '(' expr ',' expr ')' - { $$= GEOM_NEW(YYTHD, Item_func_point($3,$5)); } + { + $$= GEOM_NEW(YYTHD, Item_func_point($3,$5)); + } | POLYGON '(' expr_list ')' { $$= GEOM_NEW(YYTHD, @@ -7281,6 +7867,8 @@ udf_expr_list: udf_expr { $$= new (YYTHD->mem_root) List; + if ($$ == NULL) + MYSQL_YYABORT; $$->push_back($1); } | udf_expr_list ',' udf_expr @@ -7312,50 +7900,125 @@ udf_expr: sum_expr: AVG_SYM '(' in_sum_expr ')' - { $$=new Item_sum_avg($3); } + { + $$= new (YYTHD->mem_root) Item_sum_avg($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | AVG_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_avg_distinct($4); } + { + $$= new (YYTHD->mem_root) Item_sum_avg_distinct($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | BIT_AND '(' in_sum_expr ')' - { $$=new Item_sum_and($3); } + { + $$= new (YYTHD->mem_root) Item_sum_and($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | BIT_OR '(' in_sum_expr ')' - { $$=new Item_sum_or($3); } + { + $$= new (YYTHD->mem_root) Item_sum_or($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | BIT_XOR '(' in_sum_expr ')' - { $$=new Item_sum_xor($3); } + { + $$= new (YYTHD->mem_root) Item_sum_xor($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COUNT_SYM '(' opt_all '*' ')' - { $$=new Item_sum_count(new Item_int((int32) 0L,1)); } + { + Item *item= new (YYTHD->mem_root) Item_int((int32) 0L,1); + if (item == NULL) + MYSQL_YYABORT; + $$= new (YYTHD->mem_root) Item_sum_count(item); + if ($$ == NULL) + MYSQL_YYABORT; + } | COUNT_SYM '(' in_sum_expr ')' - { $$=new Item_sum_count($3); } + { + $$= new (YYTHD->mem_root) Item_sum_count($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | COUNT_SYM '(' DISTINCT { Select->in_sum_expr++; } expr_list { Select->in_sum_expr--; } ')' - { $$=new Item_sum_count_distinct(* $5); } + { + $$= new (YYTHD->mem_root) Item_sum_count_distinct(* $5); + if ($$ == NULL) + MYSQL_YYABORT; + } | MIN_SYM '(' in_sum_expr ')' - { $$=new Item_sum_min($3); } + { + $$= new (YYTHD->mem_root) Item_sum_min($3); + if ($$ == NULL) + MYSQL_YYABORT; + } /* According to ANSI SQL, DISTINCT is allowed and has no sense inside MIN and MAX grouping functions; so MIN|MAX(DISTINCT ...) is processed like an ordinary MIN | MAX() */ | MIN_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_min($4); } + { + $$= new (YYTHD->mem_root) Item_sum_min($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | MAX_SYM '(' in_sum_expr ')' - { $$=new Item_sum_max($3); } + { + $$= new (YYTHD->mem_root) Item_sum_max($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | MAX_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_max($4); } + { + $$= new (YYTHD->mem_root) Item_sum_max($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | STD_SYM '(' in_sum_expr ')' - { $$=new Item_sum_std($3, 0); } + { + $$= new (YYTHD->mem_root) Item_sum_std($3, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | VARIANCE_SYM '(' in_sum_expr ')' - { $$=new Item_sum_variance($3, 0); } + { + $$= new (YYTHD->mem_root) Item_sum_variance($3, 0); + if ($$ == NULL) + MYSQL_YYABORT; + } | STDDEV_SAMP_SYM '(' in_sum_expr ')' - { $$=new Item_sum_std($3, 1); } + { + $$= new (YYTHD->mem_root) Item_sum_std($3, 1); + if ($$ == NULL) + MYSQL_YYABORT; + } | VAR_SAMP_SYM '(' in_sum_expr ')' - { $$=new Item_sum_variance($3, 1); } + { + $$= new (YYTHD->mem_root) Item_sum_variance($3, 1); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUM_SYM '(' in_sum_expr ')' - { $$=new Item_sum_sum($3); } + { + $$= new (YYTHD->mem_root) Item_sum_sum($3); + if ($$ == NULL) + MYSQL_YYABORT; + } | SUM_SYM '(' DISTINCT in_sum_expr ')' - { $$=new Item_sum_sum_distinct($4); } + { + $$= new (YYTHD->mem_root) Item_sum_sum_distinct($4); + if ($$ == NULL) + MYSQL_YYABORT; + } | GROUP_CONCAT_SYM '(' opt_distinct { Select->in_sum_expr++; } expr_list opt_gorder_clause @@ -7364,8 +8027,11 @@ sum_expr: { SELECT_LEX *sel= Select; sel->in_sum_expr--; - $$=new Item_func_group_concat(Lex->current_context(), $3, $5, - sel->gorder_list, $7); + $$= new (YYTHD->mem_root) + Item_func_group_concat(Lex->current_context(), $3, $5, + sel->gorder_list, $7); + if ($$ == NULL) + MYSQL_YYABORT; $5->empty(); } ; @@ -7388,13 +8054,17 @@ variable: variable_aux: ident_or_text SET_VAR expr { - $$= new Item_func_set_user_var($1, $3); + $$= new (YYTHD->mem_root) Item_func_set_user_var($1, $3); + if ($$ == NULL) + MYSQL_YYABORT; LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } | ident_or_text { - $$= new Item_func_get_user_var($1); + $$= new (YYTHD->mem_root) Item_func_get_user_var($1); + if ($$ == NULL) + MYSQL_YYABORT; LEX *lex= Lex; lex->uncacheable(UNCACHEABLE_RAND); } @@ -7420,9 +8090,11 @@ opt_distinct: opt_gconcat_separator: /* empty */ - { - $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); - } + { + $$= new (YYTHD->mem_root) String(",", 1, &my_charset_latin1); + if ($$ == NULL) + MYSQL_YYABORT; + } | SEPARATOR_SYM text_string { $$ = $2; } ; @@ -7437,6 +8109,8 @@ opt_gorder_clause: select->gorder_list= (SQL_LIST*) sql_memdup((char*) &select->order_list, sizeof(st_sql_list)); + if (select->gorder_list == NULL) + MYSQL_YYABORT; select->order_list.empty(); } ; @@ -7492,6 +8166,8 @@ expr_list: expr { $$= new (YYTHD->mem_root) List; + if ($$ == NULL) + MYSQL_YYABORT; $$->push_back($1); } | expr_list ',' expr @@ -7510,6 +8186,8 @@ ident_list: simple_ident { $$= new (YYTHD->mem_root) List; + if ($$ == NULL) + MYSQL_YYABORT; $$->push_back($1); } | ident_list ',' simple_ident @@ -7533,6 +8211,8 @@ when_list: WHEN_SYM expr THEN_SYM expr { $$= new List; + if ($$ == NULL) + MYSQL_YYABORT; $$->push_back($2); $$->push_back($4); } @@ -7784,8 +8464,11 @@ table_factor: SELECT_LEX *sel= lex->current_select; SELECT_LEX_UNIT *unit= sel->master_unit(); lex->current_select= sel= unit->outer_select(); + Table_ident *ti= new Table_ident(unit); + if (ti == NULL) + MYSQL_YYABORT; if (!($$= sel->add_table_to_list(lex->thd, - new Table_ident(unit), $6, 0, + ti, $6, 0, TL_READ))) MYSQL_YYABORT; @@ -7952,15 +8635,21 @@ using_list: { if (!($$= new List)) MYSQL_YYABORT; - $$->push_back(new (YYTHD->mem_root) - String((const char *) $1.str, $1.length, - system_charset_info)); + String *s= new (YYTHD->mem_root) String((const char *) $1.str, + $1.length, + system_charset_info); + if (s == NULL) + MYSQL_YYABORT; + $$->push_back(s); } | using_list ',' ident { - $1->push_back(new (YYTHD->mem_root) - String((const char *) $3.str, $3.length, - system_charset_info)); + String *s= new (YYTHD->mem_root) String((const char *) $3.str, + $3.length, + system_charset_info); + if (s == NULL) + MYSQL_YYABORT; + $1->push_back(s); $$= $1; } ; @@ -8028,7 +8717,11 @@ table_alias: opt_table_alias: /* empty */ { $$=0; } | table_alias ident - { $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); } + { + $$= (LEX_STRING*) sql_memdup(&$2,sizeof(LEX_STRING)); + if ($$ == NULL) + MYSQL_YYABORT; + } ; opt_all: @@ -8076,10 +8769,13 @@ opt_escape: } | /* empty */ { + THD *thd= YYTHD; Lex->escape_used= FALSE; - $$= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? - new Item_string("", 0, &my_charset_latin1) : - new Item_string("\\", 1, &my_charset_latin1)); + $$= ((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? + new (thd->mem_root) Item_string("", 0, &my_charset_latin1) : + new (thd->mem_root) Item_string("\\", 1, &my_charset_latin1)); + if ($$ == NULL) + MYSQL_YYABORT; } ; @@ -8256,9 +8952,24 @@ limit_option: { ((Item_param *) $1)->limit_clause_param= TRUE; } - | ULONGLONG_NUM { $$= new Item_uint($1.str, $1.length); } - | LONG_NUM { $$= new Item_uint($1.str, $1.length); } - | NUM { $$= new Item_uint($1.str, $1.length); } + | ULONGLONG_NUM + { + $$= new (YYTHD->mem_root) Item_uint($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } + | LONG_NUM + { + $$= new (YYTHD->mem_root) Item_uint($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } + | NUM + { + $$= new (YYTHD->mem_root) Item_uint($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } ; delete_limit_clause: @@ -8342,10 +9053,12 @@ procedure_clause: lex->proc_list.elements=0; lex->proc_list.first=0; lex->proc_list.next= (uchar**) &lex->proc_list.first; - if (add_proc_to_list(lex->thd, new Item_field(&lex-> - current_select-> - context, - NULL,NULL,$2.str))) + Item_field *item= new (YYTHD->mem_root) + Item_field(&lex->current_select->context, + NULL, NULL, $2.str); + if (item == NULL) + MYSQL_YYABORT; + if (add_proc_to_list(lex->thd, item)) MYSQL_YYABORT; Lex->uncacheable(UNCACHEABLE_SIDEEFFECT); } @@ -8395,13 +9108,20 @@ select_var_ident: { LEX *lex=Lex; if (lex->result) - ((select_dumpvar *)lex->result)->var_list.push_back( new my_var($2,0,0,(enum_field_types)0)); + { + my_var *var= new my_var($2,0,0,(enum_field_types)0); + if (var == NULL) + MYSQL_YYABORT; + ((select_dumpvar *)lex->result)->var_list.push_back(var); + } else + { /* The parser won't create select_result instance only if it's an EXPLAIN. */ DBUG_ASSERT(lex->describe); + } } | ident_or_text { @@ -8415,12 +9135,12 @@ select_var_ident: } if (lex->result) { - my_var *var; - ((select_dumpvar *)lex->result)-> - var_list.push_back(var= new my_var($1,1,t->offset,t->type)); + my_var *var= new my_var($1,1,t->offset,t->type); + if (var == NULL) + MYSQL_YYABORT; + ((select_dumpvar *)lex->result)->var_list.push_back(var); #ifndef DBUG_OFF - if (var) - var->sp= lex->sphead; + var->sp= lex->sphead; #endif } else @@ -8506,11 +9226,13 @@ drop: | DROP INDEX_SYM ident ON table_ident {} { LEX *lex=Lex; + Alter_drop *ad= new Alter_drop(Alter_drop::KEY, $3.str); + if (ad == NULL) + MYSQL_YYABORT; lex->sql_command= SQLCOM_DROP_INDEX; lex->alter_info.reset(); lex->alter_info.flags= ALTER_DROP_INDEX; - lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, - $3.str)); + lex->alter_info.drop_list.push_back(ad); if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL, TL_OPTION_UPDATING)) MYSQL_YYABORT; @@ -8535,6 +9257,8 @@ drop: lex->sql_command = SQLCOM_DROP_FUNCTION; lex->drop_if_exists= $3; spname= new sp_name($4, $6, true); + if (spname == NULL) + MYSQL_YYABORT; spname->init_qname(thd); lex->spname= spname; } @@ -8554,6 +9278,8 @@ drop: lex->sql_command = SQLCOM_DROP_FUNCTION; lex->drop_if_exists= $3; spname= new sp_name(db, $4, false); + if (spname == NULL) + MYSQL_YYABORT; spname->init_qname(thd); lex->spname= spname; } @@ -8821,7 +9547,12 @@ values: expr_or_default: expr { $$= $1;} - | DEFAULT {$$= new Item_default_value(Lex->current_context()); } + | DEFAULT + { + $$= new (YYTHD->mem_root) Item_default_value(Lex->current_context()); + if ($$ == NULL) + MYSQL_YYABORT; + } ; opt_insert_update: @@ -8945,7 +9676,11 @@ table_wild_list: table_wild_one: ident opt_wild opt_table_alias { - if (!Select->add_table_to_list(YYTHD, new Table_ident($1), + Table_ident *ti= new Table_ident($1); + if (ti == NULL) + MYSQL_YYABORT; + if (!Select->add_table_to_list(YYTHD, + ti, $3, TL_OPTION_UPDATING | TL_OPTION_ALIAS, Lex->lock_option)) @@ -8953,8 +9688,11 @@ table_wild_one: } | ident '.' ident opt_wild opt_table_alias { + Table_ident *ti= new Table_ident(YYTHD, $1, $3, 0); + if (ti == NULL) + MYSQL_YYABORT; if (!Select->add_table_to_list(YYTHD, - new Table_ident(YYTHD, $1, $3, 0), + ti, $5, TL_OPTION_UPDATING | TL_OPTION_ALIAS, Lex->lock_option)) @@ -9450,6 +10188,8 @@ wild_and_where: { Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length, system_charset_info); + if (Lex->wild == NULL) + MYSQL_YYABORT; } | WHERE expr { @@ -9502,6 +10242,8 @@ opt_describe_column: Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str, $1.length, system_charset_info); + if (Lex->wild == NULL) + MYSQL_YYABORT; } ; @@ -9820,7 +10562,11 @@ fields_or_vars: field_or_var: simple_ident_nospvar {$$= $1;} | '@' ident_or_text - { $$= new Item_user_var_as_out_param($2); } + { + $$= new (YYTHD->mem_root) Item_user_var_as_out_param($2); + if ($$ == NULL) + MYSQL_YYABORT; + } ; opt_load_data_set_spec: @@ -9845,21 +10591,34 @@ text_literal: my_charset_is_ascii_based(cs_con))) tmp= $1; else - thd->convert_string(&tmp, cs_con, $1.str, $1.length, cs_cli); - $$= new Item_string(tmp.str, tmp.length, cs_con, - DERIVATION_COERCIBLE, repertoire); + { + if (thd->convert_string(&tmp, cs_con, $1.str, $1.length, cs_cli)) + MYSQL_YYABORT; + } + $$= new (thd->mem_root) Item_string(tmp.str, tmp.length, cs_con, + DERIVATION_COERCIBLE, + repertoire); + if ($$ == NULL) + MYSQL_YYABORT; } | NCHAR_STRING { uint repertoire= Lex->text_string_is_7bit ? MY_REPERTOIRE_ASCII : MY_REPERTOIRE_UNICODE30; DBUG_ASSERT(my_charset_is_ascii_based(national_charset_info)); - $$= new Item_string($1.str, $1.length, national_charset_info, - DERIVATION_COERCIBLE, repertoire); + $$= new (YYTHD->mem_root) Item_string($1.str, $1.length, + national_charset_info, + DERIVATION_COERCIBLE, + repertoire); + if ($$ == NULL) + MYSQL_YYABORT; } | UNDERSCORE_CHARSET TEXT_STRING { - Item_string *str= new Item_string($2.str, $2.length, $1); + Item_string *str= new (YYTHD->mem_root) Item_string($2.str, + $2.length, $1); + if (str == NULL) + MYSQL_YYABORT; str->set_repertoire_from_value(); str->set_cs_specified(TRUE); @@ -9889,27 +10648,32 @@ text_string: $$= new (YYTHD->mem_root) String($1.str, $1.length, YYTHD->variables.collation_connection); + if ($$ == NULL) + MYSQL_YYABORT; } | HEX_NUM { - Item *tmp= new Item_hex_string($1.str, $1.length); + Item *tmp= new (YYTHD->mem_root) Item_hex_string($1.str, $1.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fields, because we need only value of constant */ - $$= tmp ? - tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; + tmp->quick_fix_field(); + $$= tmp->val_str((String*) 0); } | BIN_NUM { - Item *tmp= new Item_bin_string($1.str, $1.length); + Item *tmp= new (YYTHD->mem_root) Item_bin_string($1.str, $1.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fields, because we need only value of constant */ - $$= tmp ? tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; + tmp->quick_fix_field(); + $$= tmp->val_str((String*) 0); } ; @@ -9925,7 +10689,7 @@ param_marker: my_error(ER_VIEW_SELECT_VARIABLE, MYF(0)); MYSQL_YYABORT; } - item= new Item_param((uint) (lip->get_tok_start() - thd->query)); + item= new (thd->mem_root) Item_param((uint) (lip->get_tok_start() - thd->query)); if (!($$= item) || lex->param_list.push_back(item)) { my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); @@ -9949,29 +10713,53 @@ literal: | NUM_literal { $$ = $1; } | NULL_SYM { - $$ = new Item_null(); + $$ = new (YYTHD->mem_root) Item_null(); + if ($$ == NULL) + MYSQL_YYABORT; YYLIP->next_state= MY_LEX_OPERATOR_OR_IDENT; } - | FALSE_SYM { $$= new Item_int((char*) "FALSE",0,1); } - | TRUE_SYM { $$= new Item_int((char*) "TRUE",1,1); } - | HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);} - | BIN_NUM { $$= new Item_bin_string($1.str, $1.length); } + | FALSE_SYM + { + $$= new (YYTHD->mem_root) Item_int((char*) "FALSE",0,1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | TRUE_SYM + { + $$= new (YYTHD->mem_root) Item_int((char*) "TRUE",1,1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | HEX_NUM + { + $$ = new (YYTHD->mem_root) Item_hex_string($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } + | BIN_NUM + { + $$= new (YYTHD->mem_root) Item_bin_string($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } | UNDERSCORE_CHARSET HEX_NUM { - Item *tmp= new Item_hex_string($2.str, $2.length); + Item *tmp= new (YYTHD->mem_root) Item_hex_string($2.str, $2.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fieds, because we need only value of constant */ - String *str= tmp ? - tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; + tmp->quick_fix_field(); + String *str= tmp->val_str((String*) 0); - Item_string *item_str= - new Item_string(NULL, /* name will be set in select_item */ - str ? str->ptr() : "", - str ? str->length() : 0, - $1); + Item_string *item_str; + item_str= new (YYTHD->mem_root) + Item_string(NULL, /* name will be set in select_item */ + str ? str->ptr() : "", + str ? str->length() : 0, + $1); if (!item_str || !item_str->check_well_formed_result(&item_str->str_value, TRUE)) { @@ -9985,20 +10773,22 @@ literal: } | UNDERSCORE_CHARSET BIN_NUM { - Item *tmp= new Item_bin_string($2.str, $2.length); + Item *tmp= new (YYTHD->mem_root) Item_bin_string($2.str, $2.length); + if (tmp == NULL) + MYSQL_YYABORT; /* it is OK only emulate fix_fieds, because we need only value of constant */ - String *str= tmp ? - tmp->quick_fix_field(), tmp->val_str((String*) 0) : - (String*) 0; + tmp->quick_fix_field(); + String *str= tmp->val_str((String*) 0); - Item_string *item_str= - new Item_string(NULL, /* name will be set in select_item */ - str ? str->ptr() : "", - str ? str->length() : 0, - $1); + Item_string *item_str; + item_str= new (YYTHD->mem_root) + Item_string(NULL, /* name will be set in select_item */ + str ? str->ptr() : "", + str ? str->length() : 0, + $1); if (!item_str || !item_str->check_well_formed_result(&item_str->str_value, TRUE)) { @@ -10018,27 +10808,42 @@ NUM_literal: NUM { int error; - $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); + $$= new (YYTHD->mem_root) + Item_int($1.str, + (longlong) my_strtoll10($1.str, NULL, &error), + $1.length); + if ($$ == NULL) + MYSQL_YYABORT; } | LONG_NUM { int error; - $$ = new Item_int($1.str, (longlong) my_strtoll10($1.str, NULL, &error), $1.length); + $$= new (YYTHD->mem_root) + Item_int($1.str, + (longlong) my_strtoll10($1.str, NULL, &error), + $1.length); + if ($$ == NULL) + MYSQL_YYABORT; } | ULONGLONG_NUM - { $$ = new Item_uint($1.str, $1.length); } + { + $$= new (YYTHD->mem_root) Item_uint($1.str, $1.length); + if ($$ == NULL) + MYSQL_YYABORT; + } | DECIMAL_NUM { - $$= new Item_decimal($1.str, $1.length, YYTHD->charset()); - if (YYTHD->is_error()) + $$= new (YYTHD->mem_root) Item_decimal($1.str, $1.length, + YYTHD->charset()); + if (($$ == NULL) || (YYTHD->is_error())) { MYSQL_YYABORT; } } | FLOAT_NUM { - $$ = new Item_float($1.str, $1.length); - if (YYTHD->is_error()) + $$= new (YYTHD->mem_root) Item_float($1.str, $1.length); + if (($$ == NULL) || (YYTHD->is_error())) { MYSQL_YYABORT; } @@ -10058,15 +10863,23 @@ table_wild: ident '.' '*' { SELECT_LEX *sel= Select; - $$ = new Item_field(Lex->current_context(), NullS, $1.str, "*"); + $$= new (YYTHD->mem_root) Item_field(Lex->current_context(), + NullS, $1.str, "*"); + if ($$ == NULL) + MYSQL_YYABORT; sel->with_wild++; } | ident '.' ident '.' '*' { + THD *thd= YYTHD; SELECT_LEX *sel= Select; - $$ = new Item_field(Lex->current_context(), (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : $1.str), - $3.str,"*"); + const char* schema= thd->client_capabilities & CLIENT_NO_SCHEMA ? + NullS : $1.str; + $$= new (thd->mem_root) Item_field(Lex->current_context(), + schema, + $3.str,"*"); + if ($$ == NULL) + MYSQL_YYABORT; sel->with_wild++; } ; @@ -10093,24 +10906,34 @@ simple_ident: } Item_splocal *splocal; - splocal= new Item_splocal($1, spv->offset, spv->type, - lip->get_tok_start_prev() - - lex->sphead->m_tmp_query, - lip->get_tok_end() - lip->get_tok_start_prev()); + splocal= new (thd->mem_root) + Item_splocal($1, spv->offset, spv->type, + lip->get_tok_start_prev() - lex->sphead->m_tmp_query, + lip->get_tok_end() - lip->get_tok_start_prev()); + if (splocal == NULL) + MYSQL_YYABORT; #ifndef DBUG_OFF - if (splocal) - splocal->m_sp= lex->sphead; + splocal->m_sp= lex->sphead; #endif - $$ = (Item*) splocal; + $$= splocal; lex->safe_to_cache_query=0; } else { SELECT_LEX *sel=Select; - $$= (sel->parsing_place != IN_HAVING || - sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str); + if ((sel->parsing_place != IN_HAVING) || + (sel->get_in_sum_expr() > 0)) + { + $$= new (thd->mem_root) Item_field(Lex->current_context(), + NullS, NullS, $1.str); + } + else + { + $$= new (thd->mem_root) Item_ref(Lex->current_context(), + NullS, NullS, $1.str); + } + if ($$ == NULL) + MYSQL_YYABORT; } } | simple_ident_q { $$= $1; } @@ -10119,11 +10942,21 @@ simple_ident: simple_ident_nospvar: ident { + THD *thd= YYTHD; SELECT_LEX *sel=Select; - $$= (sel->parsing_place != IN_HAVING || - sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, NullS, $1.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, NullS, $1.str); + if ((sel->parsing_place != IN_HAVING) || + (sel->get_in_sum_expr() > 0)) + { + $$= new (thd->mem_root) Item_field(Lex->current_context(), + NullS, NullS, $1.str); + } + else + { + $$= new (thd->mem_root) Item_ref(Lex->current_context(), + NullS, NullS, $1.str); + } + if ($$ == NULL) + MYSQL_YYABORT; } | simple_ident_q { $$= $1; } ; @@ -10165,13 +10998,15 @@ simple_ident_q: lex->trg_chistics.event == TRG_EVENT_UPDATE)); const bool read_only= !(new_row && lex->trg_chistics.action_time == TRG_ACTION_BEFORE); - if (!(trg_fld= new Item_trigger_field(Lex->current_context(), - new_row ? - Item_trigger_field::NEW_ROW: - Item_trigger_field::OLD_ROW, - $3.str, - SELECT_ACL, - read_only))) + trg_fld= new (thd->mem_root) + Item_trigger_field(Lex->current_context(), + new_row ? + Item_trigger_field::NEW_ROW: + Item_trigger_field::OLD_ROW, + $3.str, + SELECT_ACL, + read_only); + if (trg_fld == NULL) MYSQL_YYABORT; /* @@ -10181,7 +11016,7 @@ simple_ident_q: lex->trg_table_fields.link_in_list((uchar*) trg_fld, (uchar**) &trg_fld->next_trg_field); - $$= (Item *)trg_fld; + $$= trg_fld; } else { @@ -10191,10 +11026,19 @@ simple_ident_q: my_error(ER_TABLENAME_NOT_ALLOWED_HERE, MYF(0), $1.str, thd->where); } - $$= (sel->parsing_place != IN_HAVING || - sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, $1.str, $3.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, $1.str, $3.str); + if ((sel->parsing_place != IN_HAVING) || + (sel->get_in_sum_expr() > 0)) + { + $$= new (thd->mem_root) Item_field(Lex->current_context(), + NullS, $1.str, $3.str); + } + else + { + $$= new (thd->mem_root) Item_ref(Lex->current_context(), + NullS, $1.str, $3.str); + } + if ($$ == NULL) + MYSQL_YYABORT; } } | '.' ident '.' ident @@ -10207,31 +11051,48 @@ simple_ident_q: my_error(ER_TABLENAME_NOT_ALLOWED_HERE, MYF(0), $2.str, thd->where); } - $$= (sel->parsing_place != IN_HAVING || - sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), NullS, $2.str, $4.str) : - (Item*) new Item_ref(Lex->current_context(), NullS, $2.str, $4.str); + if ((sel->parsing_place != IN_HAVING) || + (sel->get_in_sum_expr() > 0)) + { + $$= new (thd->mem_root) Item_field(Lex->current_context(), + NullS, $2.str, $4.str); + + } + else + { + $$= new (thd->mem_root) Item_ref(Lex->current_context(), + NullS, $2.str, $4.str); + } + if ($$ == NULL) + MYSQL_YYABORT; } | ident '.' ident '.' ident { THD *thd= YYTHD; LEX *lex= thd->lex; SELECT_LEX *sel= lex->current_select; + const char* schema= (thd->client_capabilities & CLIENT_NO_SCHEMA ? + NullS : $1.str); if (sel->no_table_names_allowed) { my_error(ER_TABLENAME_NOT_ALLOWED_HERE, MYF(0), $3.str, thd->where); } - $$= (sel->parsing_place != IN_HAVING || - sel->get_in_sum_expr() > 0) ? - (Item*) new Item_field(Lex->current_context(), - (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : $1.str), - $3.str, $5.str) : - (Item*) new Item_ref(Lex->current_context(), - (YYTHD->client_capabilities & - CLIENT_NO_SCHEMA ? NullS : $1.str), - $3.str, $5.str); + if ((sel->parsing_place != IN_HAVING) || + (sel->get_in_sum_expr() > 0)) + { + $$= new (thd->mem_root) Item_field(Lex->current_context(), + schema, + $3.str, $5.str); + } + else + { + $$= new (thd->mem_root) Item_ref(Lex->current_context(), + schema, + $3.str, $5.str); + } + if ($$ == NULL) + MYSQL_YYABORT; } ; @@ -10267,16 +11128,34 @@ field_ident: ; table_ident: - ident { $$=new Table_ident($1); } - | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);} - | '.' ident { $$=new Table_ident($2);} /* For Delphi */ + ident + { + $$= new Table_ident($1); + if ($$ == NULL) + MYSQL_YYABORT; + } + | ident '.' ident + { + $$= new Table_ident(YYTHD, $1,$3,0); + if ($$ == NULL) + MYSQL_YYABORT; + } + | '.' ident + { + /* For Delphi */ + $$= new Table_ident($2); + if ($$ == NULL) + MYSQL_YYABORT; + } ; table_ident_nodb: ident { LEX_STRING db={(char*) any_db,3}; - $$=new Table_ident(YYTHD, db,$1,0); + $$= new Table_ident(YYTHD, db,$1,0); + if ($$ == NULL) + MYSQL_YYABORT; } ; @@ -10302,8 +11181,11 @@ IDENT_sys: $$= $1; } else - thd->convert_string(&$$, system_charset_info, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, system_charset_info, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -10315,8 +11197,11 @@ TEXT_STRING_sys: if (thd->charset_is_system_charset) $$= $1; else - thd->convert_string(&$$, system_charset_info, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, system_charset_info, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -10328,8 +11213,11 @@ TEXT_STRING_literal: if (thd->charset_is_collation_connection) $$= $1; else - thd->convert_string(&$$, thd->variables.collation_connection, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, thd->variables.collation_connection, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -10341,8 +11229,12 @@ TEXT_STRING_filesystem: if (thd->charset_is_character_set_filesystem) $$= $1; else - thd->convert_string(&$$, thd->variables.character_set_filesystem, - $1.str, $1.length, thd->charset()); + { + if (thd->convert_string(&$$, + thd->variables.character_set_filesystem, + $1.str, $1.length, thd->charset())) + MYSQL_YYABORT; + } } ; @@ -10352,6 +11244,8 @@ ident: { THD *thd= YYTHD; $$.str= thd->strmake($1.str, $1.length); + if ($$.str == NULL) + MYSQL_YYABORT; $$.length= $1.length; } ; @@ -10362,6 +11256,8 @@ label_ident: { THD *thd= YYTHD; $$.str= thd->strmake($1.str, $1.length); + if ($$.str == NULL) + MYSQL_YYABORT; $$.length= $1.length; } ; @@ -10880,6 +11776,7 @@ ext_option_value: sys_option_value: option_type internal_variable_name equal set_expr_or_default { + THD *thd= YYTHD; LEX *lex=Lex; if ($2.var == trg_new_row_fake_var) @@ -10905,15 +11802,21 @@ sys_option_value: DBUG_ASSERT(lex->trg_chistics.action_time == TRG_ACTION_BEFORE && (lex->trg_chistics.event == TRG_EVENT_INSERT || lex->trg_chistics.event == TRG_EVENT_UPDATE)); - if (!(trg_fld= new Item_trigger_field(Lex->current_context(), - Item_trigger_field::NEW_ROW, - $2.base_name.str, - UPDATE_ACL, FALSE)) || - !(sp_fld= new sp_instr_set_trigger_field(lex->sphead-> - instructions(), - lex->spcont, - trg_fld, - it, lex))) + + trg_fld= new (thd->mem_root) + Item_trigger_field(Lex->current_context(), + Item_trigger_field::NEW_ROW, + $2.base_name.str, + UPDATE_ACL, FALSE); + if (trg_fld == NULL) + MYSQL_YYABORT; + + sp_fld= new sp_instr_set_trigger_field(lex->sphead-> + instructions(), + lex->spcont, + trg_fld, + it, lex); + if (sp_fld == NULL) MYSQL_YYABORT; /* @@ -10930,8 +11833,11 @@ sys_option_value: { /* System variable */ if ($1) lex->option_type= $1; - lex->var_list.push_back(new set_var(lex->option_type, $2.var, - &$2.base_name, $4)); + set_var *var= new set_var(lex->option_type, $2.var, + &$2.base_name, $4); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } else { @@ -10953,39 +11859,69 @@ sys_option_value: else if (spv->dflt) it= spv->dflt; else - it= new Item_null(); + { + it= new (thd->mem_root) Item_null(); + if (it == NULL) + MYSQL_YYABORT; + } sp_set= new sp_instr_set(lex->sphead->instructions(), ctx, spv->offset, it, spv->type, lex, TRUE); + if (sp_set == NULL) + MYSQL_YYABORT; lex->sphead->add_instr(sp_set); } } | option_type TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types { + THD *thd= YYTHD; LEX *lex=Lex; lex->option_type= $1; - lex->var_list.push_back(new set_var(lex->option_type, - find_sys_var(YYTHD, "tx_isolation"), - &null_lex_str, - new Item_int((int32) $5))); + Item *item= new (thd->mem_root) Item_int((int32) $5); + if (item == NULL) + MYSQL_YYABORT; + set_var *var= new set_var(lex->option_type, + find_sys_var(thd, "tx_isolation"), + &null_lex_str, + item); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } ; option_value: '@' ident_or_text equal expr { - Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var($2,$4))); + Item_func_set_user_var *item; + item= new (YYTHD->mem_root) Item_func_set_user_var($2, $4); + if (item == NULL) + MYSQL_YYABORT; + set_var_user *var= new set_var_user(item); + if (var == NULL) + MYSQL_YYABORT; + Lex->var_list.push_back(var); } | '@' '@' opt_var_ident_type internal_variable_name equal set_expr_or_default { LEX *lex=Lex; - lex->var_list.push_back(new set_var($3, $4.var, &$4.base_name, $6)); + set_var *var= new set_var($3, $4.var, &$4.base_name, $6); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } | charset old_or_new_charset_name_or_default { THD *thd= YYTHD; LEX *lex= thd->lex; - $2= $2 ? $2: global_system_variables.character_set_client; - lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2)); + CHARSET_INFO *cs2; + cs2= $2 ? $2: global_system_variables.character_set_client; + set_var_collation_client *var; + var= new set_var_collation_client(cs2, + thd->variables.collation_database, + cs2); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } | NAMES_SYM equal expr { @@ -11005,15 +11941,21 @@ option_value: | NAMES_SYM charset_name_or_default opt_collate { LEX *lex= Lex; - $2= $2 ? $2 : global_system_variables.character_set_client; - $3= $3 ? $3 : $2; - if (!my_charset_same($2,$3)) + CHARSET_INFO *cs2; + CHARSET_INFO *cs3; + cs2= $2 ? $2 : global_system_variables.character_set_client; + cs3= $3 ? $3 : cs2; + if (!my_charset_same(cs2, cs3)) { my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0), - $3->name, $2->csname); + cs3->name, cs2->csname); MYSQL_YYABORT; } - lex->var_list.push_back(new set_var_collation_client($3,$3,$3)); + set_var_collation_client *var; + var= new set_var_collation_client(cs3, cs3, cs3); + if (var == NULL) + MYSQL_YYABORT; + lex->var_list.push_back(var); } | PASSWORD equal text_or_password { @@ -11034,14 +11976,20 @@ option_value: MYSQL_YYABORT; user->host=null_lex_str; user->user.str=thd->security_ctx->priv_user; - thd->lex->var_list.push_back(new set_var_password(user, $3)); + set_var_password *var= new set_var_password(user, $3); + if (var == NULL) + MYSQL_YYABORT; + thd->lex->var_list.push_back(var); thd->lex->autocommit= TRUE; if (lex->sphead) lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; } | PASSWORD FOR_SYM user equal text_or_password { - Lex->var_list.push_back(new set_var_password($3,$5)); + set_var_password *var= new set_var_password($3,$5); + if (var == NULL) + MYSQL_YYABORT; + Lex->var_list.push_back(var); Lex->autocommit= TRUE; if (Lex->sphead) Lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT; @@ -11152,11 +12100,15 @@ text_or_password: Item_func_old_password::alloc(YYTHD, $3.str) : Item_func_password::alloc(YYTHD, $3.str) : $3.str; + if ($$ == NULL) + MYSQL_YYABORT; } | OLD_PASSWORD '(' TEXT_STRING ')' { $$= $3.length ? Item_func_old_password::alloc(YYTHD, $3.str) : $3.str; + if ($$ == NULL) + MYSQL_YYABORT; } ; @@ -11164,9 +12116,24 @@ text_or_password: set_expr_or_default: expr { $$=$1; } | DEFAULT { $$=0; } - | ON { $$=new Item_string("ON", 2, system_charset_info); } - | ALL { $$=new Item_string("ALL", 3, system_charset_info); } - | BINARY { $$=new Item_string("binary", 6, system_charset_info); } + | ON + { + $$=new (YYTHD->mem_root) Item_string("ON", 2, system_charset_info); + if ($$ == NULL) + MYSQL_YYABORT; + } + | ALL + { + $$=new (YYTHD->mem_root) Item_string("ALL", 3, system_charset_info); + if ($$ == NULL) + MYSQL_YYABORT; + } + | BINARY + { + $$=new (YYTHD->mem_root) Item_string("binary", 6, system_charset_info); + if ($$ == NULL) + MYSQL_YYABORT; + } ; /* Lock function */ @@ -11268,7 +12235,10 @@ handler: lex->expr_allows_subselect= FALSE; lex->sql_command = SQLCOM_HA_READ; lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */ - lex->current_select->select_limit= new Item_int((int32) 1); + Item *one= new (YYTHD->mem_root) Item_int((int32) 1); + if (one == NULL) + MYSQL_YYABORT; + lex->current_select->select_limit= one; lex->current_select->offset_limit= 0; if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0)) MYSQL_YYABORT; @@ -11591,8 +12561,9 @@ grant_user: { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1); - if (buff) - make_scrambled_password_323(buff, $4.str); + if (buff == NULL) + MYSQL_YYABORT; + make_scrambled_password_323(buff, $4.str); $1->password.str= buff; $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323; } @@ -11600,8 +12571,9 @@ grant_user: { char *buff= (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1); - if (buff) - make_scrambled_password(buff, $4.str); + if (buff == NULL) + MYSQL_YYABORT; + make_scrambled_password(buff, $4.str); $1->password.str= buff; $1->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH; } @@ -11631,6 +12603,8 @@ column_list_id: ident { String *new_str = new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); + if (new_str == NULL) + MYSQL_YYABORT; List_iterator iter(Lex->columns); class LEX_COLUMN *point; LEX *lex=Lex; @@ -11644,7 +12618,12 @@ column_list_id: if (point) point->rights |= lex->which_columns; else - lex->columns.push_back(new LEX_COLUMN (*new_str,lex->which_columns)); + { + LEX_COLUMN *col= new LEX_COLUMN (*new_str,lex->which_columns); + if (col == NULL) + MYSQL_YYABORT; + lex->columns.push_back(col); + } } ; @@ -12068,7 +13047,6 @@ view_list: view_select: { - THD *thd= YYTHD; LEX *lex= Lex; lex->parsing_options.allows_variable= FALSE; lex->parsing_options.allows_select_into= FALSE; @@ -12254,6 +13232,8 @@ sf_tail: } /* Order is important here: new - reset - init */ sp= new sp_head(); + if (sp == NULL) + MYSQL_YYABORT; sp->reset_thd_mem_root(thd); sp->init(lex); sp->init_sp_name(thd, lex->spname); @@ -12381,6 +13361,8 @@ sp_tail: /* Order is important here: new - reset - init */ sp= new sp_head(); + if (sp == NULL) + MYSQL_YYABORT; sp->reset_thd_mem_root(YYTHD); sp->init(lex); sp->m_type= TYPE_ENUM_PROCEDURE; diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index ddf35002880..6bf43b51df0 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -21,10 +21,34 @@ extern "C" { void sql_alloc_error_handler(void) { - THD *thd=current_thd; - if (thd) // QQ; To be removed - thd->fatal_error(); /* purecov: inspected */ sql_print_error(ER(ER_OUT_OF_RESOURCES)); + + THD *thd= current_thd; + if (thd) + { + if (! thd->is_error()) + { + /* + This thread is Out Of Memory. + An OOM condition is a fatal error. + It should not be caught by error handlers in stored procedures. + Also, recording that SQL condition in the condition area could + cause more memory allocations, which in turn could raise more + OOM conditions, causing recursion in the error handling code itself. + As a result, my_error() should not be invoked, and the + thread diagnostics area is set to an error status directly. + Note that Diagnostics_area::set_error_status() is safe, + since it does not call any memory allocation routines. + The visible result for a client application will be: + - a query fails with an ER_OUT_OF_RESOURCES error, + returned in the error packet. + - SHOW ERROR/SHOW WARNINGS may be empty. + */ + thd->main_da.set_error_status(thd, + ER_OUT_OF_RESOURCES, + ER(ER_OUT_OF_RESOURCES)); + } + } } } From 08d9e1207d346b05dee99c189a14df4dd4cc7ca7 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Wed, 13 Aug 2008 10:47:24 +0200 Subject: [PATCH 166/352] Bug#37402: Mysql cant read partitioned table with capital letter in the name Post push fix (compiler warning) --- sql/ha_partition.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index dfaa58c9249..af3ee000874 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1798,7 +1798,8 @@ uint ha_partition::del_ren_cre_table(const char *from, char from_buff[FN_REFLEN], to_buff[FN_REFLEN], from_lc_buff[FN_REFLEN], to_lc_buff[FN_REFLEN]; char *name_buffer_ptr; - const char *from_path, *to_path; + const char *from_path; + const char *to_path= NULL; uint i; handler **file, **abort_file; DBUG_ENTER("del_ren_cre_table()"); From 1ae849bbdd5d6f71d329dd841909a83cc09cd76f Mon Sep 17 00:00:00 2001 From: "timothy.smith@sun.com" <> Date: Wed, 13 Aug 2008 11:05:24 +0200 Subject: [PATCH 167/352] Raise version number after cloning 5.0.68 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index ab56fc24c71..e302aaa5c4a 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.68) +AM_INIT_AUTOMAKE(mysql, 5.0.69) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=68 +NDB_VERSION_BUILD=69 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From d2c1c3977b0a9180bf66a59a998fcfb01dabecef Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Wed, 13 Aug 2008 12:34:35 +0200 Subject: [PATCH 168/352] Correct the version number to 5.0.70. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index e302aaa5c4a..bd993bb5fcf 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.69) +AM_INIT_AUTOMAKE(mysql, 5.0.70) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=69 +NDB_VERSION_BUILD=70 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From a63601373059ea20c59a3eebbe0ec583f8d20f6d Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Wed, 13 Aug 2008 18:44:05 +0200 Subject: [PATCH 169/352] let's try to avoid re-defining _vsnprintf on Windows --- zlib/gzio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zlib/gzio.c b/zlib/gzio.c index afac5352323..7e90f4928fc 100644 --- a/zlib/gzio.c +++ b/zlib/gzio.c @@ -7,10 +7,10 @@ /* @(#) $Id$ */ -#include "zutil.h" - #include +#include "zutil.h" + #ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif From cf28ff2616990bb5db12e83eb876d4a7d8be59b5 Mon Sep 17 00:00:00 2001 From: Evgeny Potemkin Date: Wed, 13 Aug 2008 22:24:55 +0400 Subject: [PATCH 170/352] Bug#38195: Incorrect handling of aggregate functions when loose index scan is used causes server crash. When the loose index scan access method is used values of aggregated functions are precomputed by it. Aggregation of such functions shouldn't be performed in this case and functions should be treated as normal ones. The create_tmp_table function wasn't taking this into account and this led to a crash if a query has MIN/MAX aggregate functions and employs temporary table and loose index scan. Now the JOIN::exec and the create_tmp_table functions treat MIN/MAX aggregate functions as normal ones when the loose index scan is used. --- mysql-test/r/group_min_max.result | 27 +++++++++++++++++++++++++++ mysql-test/t/group_min_max.test | 12 ++++++++++++ sql/sql_select.cc | 5 ++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index 5982931e677..846e8ece656 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -2353,3 +2353,30 @@ a MIN(b) MAX(b) AVG(b) 2 1 3 2.0000 1 1 3 2.0000 DROP TABLE t1; +create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM; +insert into t1 (a,b) values (0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(0,7), +(0,8),(0,9),(0,10),(0,11),(0,12),(0,13); +insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a; +select * from t1; +a b +0 0 +0 1 +0 2 +0 3 +0 4 +0 5 +0 6 +0 7 +0 8 +0 9 +0 10 +0 11 +0 12 +0 13 +0 14 +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 Extra +1 SIMPLE t1 range PRIMARY,index PRIMARY 4 NULL 6 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; diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index 7f2607b513d..196dd3379f9 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -916,3 +916,15 @@ SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC; SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC; DROP TABLE t1; + +# +# Bug#38195: Incorrect handling of aggregate functions when loose index scan is +# used causes server crash. +# +create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM; +insert into t1 (a,b) values (0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(0,7), +(0,8),(0,9),(0,10),(0,11),(0,12),(0,13); +insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a; +select * from t1; +explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a; +drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6de4b296d34..6928effc1a5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1724,7 +1724,8 @@ JOIN::exec() if (!items1) { items1= items0 + all_fields.elements; - if (sort_and_group || curr_tmp_table->group) + if (sort_and_group || curr_tmp_table->group || + tmp_table_param.precomputed_group_by) { if (change_to_use_tmp_fields(thd, items1, tmp_fields_list1, tmp_all_fields1, @@ -9259,6 +9260,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, MI_COLUMNDEF *recinfo; uint total_uneven_bit_length= 0; bool force_copy_fields= param->force_copy_fields; + /* Treat sum functions as normal ones when loose index scan is used. */ + save_sum_fields|= param->precomputed_group_by; DBUG_ENTER("create_tmp_table"); DBUG_PRINT("enter",("distinct: %d save_sum_fields: %d rows_limit: %lu group: %d", (int) distinct, (int) save_sum_fields, From 8ca9c150b5235a7d007e1e8d52df90fa80bd2451 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Wed, 13 Aug 2008 20:50:08 +0200 Subject: [PATCH 171/352] Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that partition is corrupt Post push fix an DBUG_ASSERT broke the embedded server, fixed by initializing it in the embedded version of Protocol_text::prepare_for_resend --- libmysqld/lib_sql.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index e1c8ab5abb4..6e82812239e 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -1103,6 +1103,9 @@ void Protocol_text::prepare_for_resend() data->embedded_info->prev_ptr= &cur->next; next_field=cur->data; next_mysql_field= data->embedded_info->fields_list; +#ifndef DBUG_OFF + field_pos= 0; +#endif DBUG_VOID_RETURN; } From 35e47b31a283add902d87f36caf4aeaefd0dd098 Mon Sep 17 00:00:00 2001 From: Serge Kozlov Date: Wed, 13 Aug 2008 23:12:51 +0400 Subject: [PATCH 172/352] Bug#18817, removing --binlog-format option from .opt files --- mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt | 1 - mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt | 1 - mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt | 1 - mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt delete mode 100644 mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt delete mode 100644 mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt diff --git a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt deleted file mode 100644 index 83ed8522e72..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-format=row diff --git a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt deleted file mode 100644 index 4cb7a31da81..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-format=statement --log-slave-updates diff --git a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt deleted file mode 100644 index 01cf3e0520f..00000000000 --- a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-format=mixed diff --git a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test index 4ee6c98d463..5381dff95a3 100644 --- a/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test +++ b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test @@ -1,6 +1,6 @@ # Same test as rpl_truncate_7ndb.test, but with mixed mode # This is marked with 'big_test' just because the rpl_truncate_7ndb test is # so slow... - +--source include/have_binlog_format_mixed.inc --source include/big_test.inc --source t/rpl_truncate_7ndb.test From b14c8930c01cebf7088e28c4b3f56f6765801274 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Wed, 13 Aug 2008 21:42:21 +0200 Subject: [PATCH 173/352] Improve the testcases for Bug 12093 in ps_ddl.test Details: - add subtest with drop unrelated view - rearrange existing tests so that a distinction between drop procedure and drop function effects is possible --- mysql-test/include/ps_ddl_1.inc | 25 ++++++++++++++++++ mysql-test/r/ps_ddl.result | 47 ++++++++++++++++++++++++++++++++- mysql-test/t/ps_ddl.test | 36 +++++++++---------------- 3 files changed, 84 insertions(+), 24 deletions(-) create mode 100644 mysql-test/include/ps_ddl_1.inc diff --git a/mysql-test/include/ps_ddl_1.inc b/mysql-test/include/ps_ddl_1.inc new file mode 100644 index 00000000000..f6b4c8108a1 --- /dev/null +++ b/mysql-test/include/ps_ddl_1.inc @@ -0,0 +1,25 @@ +# include/ps_ddl_1.inc +# +# Auxiliary script to be used in ps_ddl.test +# + +prepare stmt_sf from 'select f_12093();'; +prepare stmt_sp from 'call p_12093(f_12093())'; +execute stmt_sf; +execute stmt_sp; + +connection con1; +eval $my_drop; +# +connection default; +--echo # XXX: used to be a bug +execute stmt_sf; +--echo # XXX: used to be a bug +execute stmt_sp; +# +--echo # XXX: used to be a bug +execute stmt_sf; +--echo # XXX: used to be a bug +execute stmt_sp; + +connection default; diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result index 58542f23cf2..c7e8812320c 100644 --- a/mysql-test/r/ps_ddl.result +++ b/mysql-test/r/ps_ddl.result @@ -1567,11 +1567,13 @@ drop table if exists t_12093; drop function if exists f_12093; drop function if exists f_12093_unrelated; drop procedure if exists p_12093; +drop view if exists v_12093_unrelated; create table t_12093 (a int); create function f_12093() returns int return (select count(*) from t_12093); create procedure p_12093(a int) select * from t_12093; create function f_12093_unrelated() returns int return 2; create procedure p_12093_unrelated() begin end; +create view v_12093_unrelated as select * from t_12093; prepare stmt_sf from 'select f_12093();'; prepare stmt_sp from 'call p_12093(f_12093())'; execute stmt_sf; @@ -1580,6 +1582,27 @@ f_12093() execute stmt_sp; a drop function f_12093_unrelated; +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +prepare stmt_sf from 'select f_12093();'; +prepare stmt_sp from 'call p_12093(f_12093())'; +execute stmt_sf; +f_12093() +0 +execute stmt_sp; +a drop procedure p_12093_unrelated; # XXX: used to be a bug execute stmt_sf; @@ -1595,7 +1618,29 @@ f_12093() # XXX: used to be a bug execute stmt_sp; a -call p_verify_reprepare_count(2); +prepare stmt_sf from 'select f_12093();'; +prepare stmt_sp from 'call p_12093(f_12093())'; +execute stmt_sf; +f_12093() +0 +execute stmt_sp; +a +drop view v_12093_unrelated; +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +# XXX: used to be a bug +execute stmt_sf; +f_12093() +0 +# XXX: used to be a bug +execute stmt_sp; +a +call p_verify_reprepare_count(6); SUCCESS drop table t_12093; diff --git a/mysql-test/t/ps_ddl.test b/mysql-test/t/ps_ddl.test index 8899ca967ca..fee235cd36c 100644 --- a/mysql-test/t/ps_ddl.test +++ b/mysql-test/t/ps_ddl.test @@ -1363,44 +1363,34 @@ drop table if exists t_12093; drop function if exists f_12093; drop function if exists f_12093_unrelated; drop procedure if exists p_12093; +drop view if exists v_12093_unrelated; --enable_warnings create table t_12093 (a int); - create function f_12093() returns int return (select count(*) from t_12093); - create procedure p_12093(a int) select * from t_12093; create function f_12093_unrelated() returns int return 2; create procedure p_12093_unrelated() begin end; - -prepare stmt_sf from 'select f_12093();'; -prepare stmt_sp from 'call p_12093(f_12093())'; - -execute stmt_sf; -execute stmt_sp; +create view v_12093_unrelated as select * from t_12093; connect (con1,localhost,root,,); -connection con1; - -drop function f_12093_unrelated; -drop procedure p_12093_unrelated; - connection default; ---echo # XXX: used to be a bug -execute stmt_sf; ---echo # XXX: used to be a bug -execute stmt_sp; +let $my_drop = drop function f_12093_unrelated; +--source include/ps_ddl_1.inc +# +let $my_drop = drop procedure p_12093_unrelated; +--source include/ps_ddl_1.inc +# +# A reprepare of stmt_sf and stmt_sp is necessary because there is no +# information about views within the table definition cache. +let $my_drop = drop view v_12093_unrelated; +--source include/ps_ddl_1.inc ---echo # XXX: used to be a bug -execute stmt_sf; ---echo # XXX: used to be a bug -execute stmt_sp; -call p_verify_reprepare_count(2); +call p_verify_reprepare_count(6); disconnect con1; - drop table t_12093; drop function f_12093; drop procedure p_12093; From 5d48042e45775d2219f0abd4613ac97e6089eee8 Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Wed, 13 Aug 2008 21:44:54 +0200 Subject: [PATCH 174/352] Fix for Bug#37853 Test "funcs_1.processlist_val_ps" fails in various ways + corrections of logic in poll routines + minor improvements --- .../funcs_1/datadict/processlist_val.inc | 612 +++++++++++------- .../funcs_1/r/processlist_val_no_prot.result | 298 ++++++--- .../suite/funcs_1/r/processlist_val_ps.result | 298 ++++++--- 3 files changed, 784 insertions(+), 424 deletions(-) diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc index 16c3dc71ff1..c34fb626bcd 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -1,313 +1,465 @@ -########### suite/funcs_1/datadict/processlist_val.inc ################# -# # -# Testing of values within INFORMATION_SCHEMA.PROCESSLIST # -# # -# Ensure that the values fit to the current event of the connection # -# and especially that they change if a connection does nothing or # -# runs some SQL. # -# Examples: # -# - change the default database # -# - send some time no SQL command to the server # -# - send a long running query # -# # -# Note(mleich): # -# 1. Please inform me if this test fails because of timing problems. # -# I tried to avoid instabilities but the values within the column # -# TIME are very sensible to fluctuations of the machine load. # -# I had to unify some TIME values with "--replace_result" in cases # -# where they are too unstable. # -# 2. Storage engine variants of this test do not make sense. # -# - I_S tables use the MEMORY storage engine whenever possible. # -# - There are some I_S table which need column data types which # -# are not supported by MEMORY. Example: LONGTEXT/BLOB # -# MyISAM will be used for such tables. # -# The column PROCESSLIST.INFO is of data type LONGTEXT # -# ----> MyISAM # -# - There is no impact of the GLOBAL(server) or SESSION default # -# storage engine setting on the engine used for I_S tables. # -# That means we cannot get NDB or InnoDB instead. # -# 3. The SHOW (FULL) PROCESSLIST command are for comparison. # -# The main test target is INFORMATION_SCHEMA.PROCESSLIST ! # -# # -# Creation: # -# 2007-08-09 mleich Implement this test as part of # -# WL#3982 Test information_schema.processlist # -# 2008-01-05 HHunger Changed time test and long statement test. # -# It could happen that the long statement test # -# fail due to timing problems. # -# 2008-04-14 pcrews Changed --replace_columns to include host # -# this is due to failure occurring on Windows # -# Win results included port number as well causing # -# test failures # -######################################################################## +########### suite/funcs_1/datadict/processlist_val.inc ######################### +# # +# Testing of values within INFORMATION_SCHEMA.PROCESSLIST # +# # +# Ensure that the values fit to the current state of the connection and # +# especially that they change if a connection does nothing or runs some SQL. # +# runs some SQL. # +# Examples: # +# - change the default database # +# - send some period of time no SQL command to the server # +# - send a long running query # +# # +# Note(mleich): # +# 1. Please inform me if this test fails because of timing problems. # +# 2. Storage engine variants of this test do not make sense. # +# - I_S tables use the MEMORY storage engine whenever possible. # +# - There are some I_S tables which need column data types which are not # +# supported by MEMORY. Example: LONGTEXT/BLOB # +# MyISAM will be used for such tables. # +# The column PROCESSLIST.INFO is of data type LONGTEXT ----> MyISAM # +# - There is no impact of the GLOBAL(server) or SESSION default storage # +# engine setting on the engine used for I_S tables. # +# That means we cannot get NDB or InnoDB instead. # +# 3. The SHOW (FULL) PROCESSLIST command are for comparison. # +# The main test target is INFORMATION_SCHEMA.PROCESSLIST ! # +# 4. Attention: # +# The values of the PROCESSLIST columns HOST and TIME tend to cause # +# problems and therefore their printing has to be suppressed. # +# Examples of the exact values: # +# HOST: 'localhost' (UNIX derivates) # +# 'localhost:' (WINDOWS) # +# TIME: In many cases within this test 0 seconds but if the testing box is # +# overloaded we might get up to 2 seconds. # +# Solution: # +# --replace_column 1 3 6